Question: python subprocesses and wrappers for Jce tool
0
gravatar for mossig89
6.2 years ago by
mossig890
Lebanon
mossig890 wrote:

Hi everyone,

I'm fairly new to Biopython, I'm interested in the tool Jce (protein structure alignment by combinatorial extensions) provided @ http://source.rcsb.org/jfatcatserver/ . now the online application works perfectly fine, however I need to implement this tool in my code, possibly using wrappers or python subprocess module. However by my lack of knowledge about these modules i'm unable to find a way to give input to this tool (i.e. two sequences in fasta format and get the output as provided by the tool). can anyone guide me through this? thank you.

biopython alignment python • 1.5k views
ADD COMMENTlink modified 6.2 years ago by donfreed1.5k • written 6.2 years ago by mossig890
2
gravatar for donfreed
6.2 years ago by
donfreed1.5k
San Francisco
donfreed1.5k wrote:

This post might be off-topic for Biostars. See http://stackoverflow.com/questions/89228/calling-an-external-command-in-python/89243#89243 and https://docs.python.org/2/library/subprocess.html.

That being said, this is how I implemented something similar in a recent project:

import subprocess
import shlex

command_line = "samtools depth -r " + regions[key][0] + " " + bamfile
shell_args = shlex.split(command_line)
p = subprocess.Popen(shell_args, stdout=subprocess.PIPE)
for line in p.stdout:
        #Do something

ADD COMMENTlink written 6.2 years ago by donfreed1.5k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1773 users visited in the last hour