Entering edit mode
8.6 years ago
lien
▴
90
Dear all,
I would like to call BWA mem from within a python script. This works, but I cannot specify an output filename. The output is printed to stdout, but off course this is not what I want. From within BWA I should use '>' but this is not working from within python. This is the call function that I'm using:
aln_value=call([script_dir+"/software/bwa","mem", "-t 4", "-M", script_dir+"/ref/hg19.navin", args.fastq_file ],stderr=ERR_LOG,stdout=OUT_LOG)
Is there a simple alternative that allows me to specify the outputfile from within the python script?
Thanks , Lien
You can build the command as a string in python however you want, then run the command using os.system:
Thanks, this worked for me (Python 3.7). It seems that BWA doesn't work properly with os.subprocess(), but instead os.system() works perfectly. The bug about os.subprocess() should be something with output handling, I'm not sure.