我正在写一个用于调用AMOS包的程序的python包装器(专门用于使用AMOS中的良好ol'minimus2合并来自不同来源的基因组程序)。
直接使用shell时应该像这样调用脚本:
toAmos -s myinput.fasta -o testoutput.afg
minimus2 testoutput -D REFCOUNT=400 -D OVERLAP=500[just for clarification:
-toAmos: converts my input.fasta file to .afg format and requires an input sequence argument ("-s") and an output argument ("-o")
-minimus2: merges a sequence dataset against reference contigs and requires an argument "-D REFCOUNT=x" for stating the number of rerference seqeunces in your input and an argument "-D OVERLAP=Y" for stating the minimum overlap between sequences]
因此,在我的脚本中,我使用subprocess.call()来调用必要的AMOS工具。
基本上我这样做:
from subprocess import call:
output_basename = "testoutput"
inputfile = "myinput.fasta"
call(["toAmos", "-s