Get Random Alignments From Sam File
Hi all,
I have a .sam file and I want to extract random alignments from it.
I googled a bit and there are quite a few tools that have commands to "downsample a sam file" like Picard and GATK. I couldn't really find if these tools would allow me to extract a certain percentage or certain number of alignments from the SAM file.
I also got an alternative which would allow me to do that from sample sam file
But I would like to do the same thing using Picard or GATK. Any suggestions?
-Komal Rathi
• 539 views
•
link
1 answer
Since the question has been deleted I added my answer Sample Sam File.
• 0 views
•
link
Log in to answer this question.
Why must you use Picard/GATK? Just curious because I don't see why the means matters, as long as your end goal is accomplished.
It is just out of curiosity. I wanted to see if there is a one line alternative to the five lines of code instead. Keeps code clean when writing long scripts. I was just wondering whether Picard or GATK or any other tool has the capability of specifying how many reads or percentage of reads you would like to sample from a given SAM file. Although I have been able to get results from the answer suggested @sample sam file
cross posted from http://seqanswers.com/forums/showthread.php?t=33675
So? does that make a difference if I post the same question at other sites? I wasn't receiving any answers/comments on that post and well I posted it here.
No, but it's usually nice to mention that in your post, so that user that might spend some time composing an answer don't duplicate the effort users of the other site.
But that is my own post. And I posted it here only after I received no comments but several views on my questions on the other resource.