Meaning of the column of sam file
1
0
Entering edit mode
3.0 years ago
Jimpix ▴ 10

Hello! Referring to this columns in sam file:

  1. QNAME
  2. FLAG
  3. RNAME
  4. POS
  5. MAPQ
  6. CIGAR
  7. RNEXT
  8. PNEXT
  9. TLEN
  10. SEQ
  11. QUAL

I wanted to ask how to extract the information about end position of the read? Morover if I want to know which strand it is, it will be depend on FLAG? If the FLAG is 16 that mean it is reverse and in the other cases it will be forward?

reads position sam • 1.5k views
ADD COMMENT
1
Entering edit mode
3.0 years ago

I wanted to ask how to extract the information about end position of the read?

you have to 'walk' over the CIGAR string. C Api For Bam: Iterating Over A Cigar String. https://stackoverflow.com/questions/39710796 , or you can use a tool like "bedtools bamtobed"

If the FLAG is 16 that mean it is reverse and in the other cases it will be forward?

if it's mapped, yes

ADD COMMENT
0
Entering edit mode

Thanks for the answer! Why is not enought just to POS add length of SEQ?

ADD REPLY
2
Entering edit mode

Because alignment may contain soft-clipped sequence.

ADD REPLY
2
Entering edit mode

and indels...

ADD REPLY

Login before adding your answer.

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