This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Interpreting Flags in SAM file

Hi,

I have Illumina pair ended reads mapped to contigs. All the pair ended reads have innie (------> <----------) orientation. I want to find orientation of contigs inferred from reads. Please see following cases

  1. When the read is first in pair and is mapped to forward strand:

----------------------------------> contig

------------> read

  1. When the read is first in pair and mapped to reverse strand:

<---------------------------- contig (rev complemented)

-----------> read

  1. When the read is second in pair and mapped to forward strand:

<---------------------------- contig (rev complemented)

<------------

  1. When the read is second in pair and mapped to reverse strand:

------------------------------> contig

<------------ read

Is the correct way to interpret?

Thank you very much.

sam assembly illumina

It is not entirely clear what you are asking:

samtools flags

will tell you all the flags that you can use. Then you can add that to the -F and/or -f as needed (you can combine into a single number but sometimes is more explicit to list each separately). For example reads that are: mapped, first in pair, forward strand

-F 4 -f 64 -F 16

2 answers

you're wrong with first and second in pair: first and second means that if the read comes from a paired-end experiment (output was something like R1.fastq.gz and R2.fastq.gz), then "1st in pair" was a read from R1.fastq.gz and "2nd in pair" came from "R2.fastq.gz". And that's it, there is no indication about the position.

Basically, it all comes down to if the sequencing was stranded - i.e. during PCR the original strand of DNA being amplified is some how recorded.

Maybe this post will help you: How many ways a read pair can be mapped?

Log in to answer this question.