Thanks for your comments Devon. I will try to learn how to do it with python but in the meantime I will post the question on the Galaxy site, just in case.
Hi
I am using BWA to map my FASTQ files against two different reference sequences (V3-1 and V3-2) simultaneously on Galaxy to see the reads belonging to each sequence.
Once I've got the SAM file I would like to filter the mapped reads to generate two BAM files in order to get one file with the reads mapping V3-1 and another with those mapping V3-2.
Does any one know how I could filter these reads on Galaxy?
Many thanks
Juan
2 answers
Unless you are strictly limited to using Galaxy, I suggest using BBSplit for this purpose. It maps to all references at once, and produces one output fastq per reference (assigning reads to the reference they match best, when they map to more than one with different mapping scores), which is more accurate for resolving ambiguity than mapping one at a time and trying to postprocess the sam files.
That won't be very simple to do in Galaxy. The only route that I can advise is for you to use the python interactive environment, since pysam is probably already available in it. This would require you to know how to program in pysam, of course.
Having said that, you might want to post this question to the Galaxy site, where hopefully you'll get a simpler answer :)
Log in to answer this question.
Thank you Brian, sounds interesting. I will try
Please use
ADD REPLY/ADD COMMENTwhen responding to existing posts to keep threads logically organized.