Get The Read That Map In Two Postions At Time Using Samtools
1
0
Entering edit mode
10.8 years ago
antgomo ▴ 30

I am wondering if it is possible to get the reads that map two postions at same time with samtools, I know that I could get those which map in one positions or all in two, but I am only interested in those which map at same time at two

Am I right if I use this filtering flag in samtools?

samtools view -c -F100 HG00330.1.M_120209_2.bam chr17:41247863-41247882 chr17:41243030-41243049

Thanks

samtools reads mapping • 1.9k views
ADD COMMENT
1
Entering edit mode
10.8 years ago

This information is not required to be present in the SAM file.

Depending on how the aligner works you may have a row for each alignment in which case you will need to sort with samtools sort -n then use another simple script to find the readnames that are duplicated.

Another possibility is to look for the SAM optional field NH:

NH i Number of reported alignments that contains the query in the current record

Not all aligners fill these attributes though.

ADD COMMENT

Login before adding your answer.

Traffic: 1892 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