Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can muscle be made to take two or more non-file cli arguments (input streams)? [v3.8] #59

Closed
rtviii opened this issue May 3, 2023 · 1 comment

Comments

@rtviii
Copy link

rtviii commented May 3, 2023

Can muscle be made to take two (or more) non-file cli arguments?

I realize that one can be piped from stdin. That is what i'm doing currently (Python subprocess snippet). Yet when there are two or more moving pieces this appears super limiting. In the case below i also need to precompute a given "class_profile" and it would have been ideal to be able to send a second stream - into muscl.

    class_profile_path = msa_class_proteovision_path(poly_class)
    cmd = [
        '/home/my/musclepath/muscle3.8',
        '-profile',
        '-in1',
        class_profile_path,
        '-in2',
        '-',
        '-quiet']

    process = subprocess.Popen(cmd,
                               stdout = subprocess.PIPE,
                               stdin  = subprocess.PIPE,
                               stderr = subprocess.PIPE, env = os.environ.copy())

    stdout, stderr = process.communicate(input=fasta_from_string(fasta_target).encode())
    out   ,err     = stdout.decode(), stderr.decode()
    process.wait()

I've looked for unix-y ways to resolve this, but it seems that short of something painful and possibly inconsistent like tricking the program with expects, there is nothing to be done and arguments past -in1(assuming this consumes stdin),-in2,-in3, -inX have to rely on filepaths. I don't think even a synthetic File object works. Am i missing something?

Tried process substituion ./muscle -profile -in1 <( echo $msa1) -in2 <(echo $msa2) -quiet but strings are too long. Getting OSError: [Errno 36] File name too long

Resorted to temporary files in the end.

This is regarding version 3.8 and i would understand if is now offtopic, yet, still wondering.
Thanks and kind regards!

@rcedgar
Copy link
Owner

rcedgar commented May 3, 2023

No idea, sorry.

@rcedgar rcedgar closed this as completed May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants