Question: How to pass shell script`s arguments when calling BBMap from Python?
0
gravatar for elvissober
5.0 years ago by
elvissober20
South Africa
elvissober20 wrote:

How to pass shell script`s arguments when calling BBMap from Python? Trying to call BBMap from Python 2.7. There are subprocess and os modules for that. All efforts are wrong.

Here is a code:

import os
import subprocess

os.chdir(r"/home/user/Documents/bbmap") # changing the directory to run subsequent scripts
os.system("bbmap.sh ref=fake.fa") # 1st way
process=subprocess.Popen(['bbmap.sh',str(ref=fake.fa),shell=True,stdin=PIPE,stderr=PIPE) # 2 attempt
subprocess.call('bbmap.sh, ref=fake.fa') # 3hrd way

What code can do this job?

 

bash shell soft sequencing python • 1.4k views
ADD COMMENTlink modified 5.0 years ago • written 5.0 years ago by elvissober20
0
gravatar for Devon Ryan
5.0 years ago by
Devon Ryan97k
Freiburg, Germany
Devon Ryan97k wrote:

The syntax for the 2nd and 3rd way is wrong and you'll get an error. Unless you care what it write to stdout or stderr then just use subprocess.call()

BTW, this is just a python question, you might try a python forum next time.

ADD COMMENTlink modified 11 months ago by _r_am31k • written 5.0 years ago by Devon Ryan97k

what arguments to pass to subprocess.call()? thx

ADD REPLYlink written 5.0 years ago by elvissober20
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: 1051 users visited in the last hour