python subprocesses and wrappers for Jce tool
1
0
Entering edit mode
9.7 years ago
mossig89 ▴ 10

Hi everyone,

I'm fairly new to Biopython, I'm interested in the tool Jce (protein structure alignment by combinatorial extensions) provided at 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.

python alignment biopython • 2.1k views
ADD COMMENT
2
Entering edit mode
9.7 years ago
donfreed ★ 1.6k

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 COMMENT

Login before adding your answer.

Traffic: 2226 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6