This is a test version of Biostars. For the public version, visit https://www.biostars.org.
read strand identification from sam file

I have sam files (aligned RNAseq to genome) and converted the bam files to sam file. I am working with python. in my pipeline I need to know the strand of the reads. the following lines are 2 examples of the reads that I have in my sam file:

D00645:305:CCVLRANXX:1:1104:13111:49466 272 chr1    35222   0   31M *   0   0   CAAGTGTTTAGAGCTTAATCGTGTTCAAAAT GGGGGGCCGFGGGGC<0F>BGF1F/BEGGGG AS:i:0  XN:i:0  XM:i:0  XO:i:0  XG:i :0 NM:i:0  MD:Z:31 YT:Z:UU NH:i:6  CC:Z:chr12  CP:i:68440  HI:i:0

D00645:305:CCVLRANXX:1:2203:2308:37794  272 chr1    35222   0   31M *   0   0   CAAGTGTTTAGAGCTTAATCGTGTTCAAAAT GGGEGGGGGGGGGGGGGGGGGEGGGGGGGGG AS:i:0  XN:i:0  XM:i:0  XO:i:0  XG:i:0  NM:i:0  MD:Z:31 YT:Z:UU NH:i:6  CC:Z:chr12  CP:i:68440  HI:i:0

do you know how I can identify the strand of these 2 reads. I actually looked it up but did not find any solution.

rna-seq alignment

1 answer

in second column : samflag 172 -> https://broadinstitute.github.io/picard/explain-flags.html -> read is UNMAPPED (while its' mate is mapped on reverse strand )

in second column : samflag 272 -> https://broadinstitute.github.io/picard/explain-flags.html -> read reverse strand

Log in to answer this question.