Entering edit mode
8.9 years ago
elvissober
▴
20
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 some 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?
what arguments to pass to
subprocess.call()
? thx