I was wondering if there is a tutorial or a small code snippet to understand how to write bioinformatics pipeline using python, for example
- use a aligner (say hisat)
- get the output and process it using samtools
I was able to use subprocess from python2.7 for this purpose using samtools but i am not able to link both the processes.i.e given path(which I can use argparse) for directory with fastq files output would be processed bam.
sample code for samtools sam to bam :
import subprocess
subprocess.run(['samtools','view', '-bS',
'../some.sam',
'>',
'../some.bam'])