Our Sponsors



Download BioinformaticsOnline(BOL) Apps in your chrome browser.

Freelancer

AdvertiseWithUs

Subprocess pkg

Subprocess pkg

Last updated 1158 days ago by Rahul Agarwal

Subprocess is one of simplest way of running linux command from within python code

Example:

if you want to run fastqc for QC of fastq file:

from subprocess import Popen,PIPE,call

p=Popen(["fastqc","-f","fastq","-o", "/home/name/result/","/dev/stdin"],stdin=fopen("read.fastq","r") ,stdout=PIPE,stderr=PIPE)

print p.stderr

p.stdout.close()

More:

http://pymotw.com/2/subprocess/