How to delect lines from BAM? using manual input index
1
0
Entering edit mode
2.0 years ago
wt215 • 0

I have 2 BAMs of the some reads, but mapped to different genome. I extracted MAPQ from both, and get some index which correspond to reads that have the same MAPQ in both BAMs (using R). Then I can export those index in txt format.

Now how do I use the index found, for example, 2,3,4,5,8,9, to subset one of the BAM file?

The real problem is a bit more complex, as there are more than 2 BAMs, and I need to summarize the MAPQ across them.

Many thanks!

BAM • 433 views
ADD COMMENT
0
Entering edit mode
2.0 years ago
wt215 • 0

Found a solution here (https://bioinformatics.stackexchange.com/questions/3380/how-to-subset-a-bam-by-a-list-of-qnames): samtools view file.bam | grep -f 'qnames.txt > subset.sam

The frustrated thing is, it seems that after filtering the BAM, in 10X, you have to convert it back to fastq then rerun the analysis.

ADD COMMENT

Login before adding your answer.

Traffic: 1346 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6