View Single Post
Old 07-19-2012, 09:31 AM   #10
vinay427
Member
 
Location: USA

Join Date: Jul 2012
Posts: 10
Default

Quote:
Originally Posted by alec View Post
My vote would be for a Python wrapper to bowtie or bwa. For example, I often have barcoded data and would like to write a loop that reads a fastq file, removes the barcode, aligns the read, and then uses pysam to write it to a different bam file depending on the barcode. This would also give me more control over how multiply aligned or mispaired reads are handled, or let me store additional information with the alignment.
What exactly do you mean by a wrapper? From what I've seen, would it basically pass through arguments to bowtie (or bowtie2) so that you can integrate it into your Python loop?

I found this example; is this essentially what you would want a Python wrapper for Bowtie to do, with different arguments?
Code:
input_filenames = ['BAM-1.bam','BAM-2.bam']
output_filename = 'all.bam'

merge_parameters = [output_filename] + input_filenames
pysam.merge(*merge_parameters)
vinay427 is offline   Reply With Quote