![]() |
Extract aligned reads from a BAM file above a certain threshold
Hello everybody,
I have the following problem: I have a bam file with all the aligned sequences (it was filtered with bamtools filter -isMapped true). However I would like to filter not only the aligned reads BUT the aligned reads above a certain threshold (e.g. 200) in this way I can filter those sequences that align to a ref with just 1 or two reads There is a way to do it? Thanks! |
No one? :(
|
That would be pretty easy to do in a small perl/python/whatever script. There's also a pretty easy to use C api for samtools. I imagine you could also do that in a bash script, but I would personally find it simpler to just write a quick program.
|
Could you filter using awk?
|
Install bedtools and then a small script like the below should do it:
Code:
BAM=foo.bam |
All times are GMT -8. The time now is 08:36 PM. |
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.