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

I am a complete beginner so I am trying this out for practice. I am trying to align a read to a reference.

This is the read

head ali.fq 
@GAII02_0001:1:115:1514:5351#0/2
G
+
C

This is the reference:

head test.fa

>TAIR45S
CCCTGCCCCT

I then use bwa to align the read:

$RSE = ali.fq 

$REF=test.fa

bwa index $REF

bwa mem $REF $RSE > bwa.sam

My SAM file looks like

@SQ SN:TAIR45S  LN:10
@PG ID:bwa  PN:bwa  VN:0.7.17-r1188 CL:bwa mem test.fa ali.fq
GAII02_0001:1:115:1514:5351#0   4   *   0   0   *   *   0   0   G   C   AS:i:0  XS:i:0

I understand that the read consisting of only G got mapped but I don't know where in the output I can find the location of where G got mapped? Like in this example it got mapped to the 5th position.

Any help would be really appreciated.

sam bwa

I am only mapping one base as a demonstration. Sorry, bad example.

An example of one of my aligned reads looks like this.

GACCCTCCCCTAAATCACTCCAAAAAAAACAATCCCCAATTCTACACAAGTGTTTCTACACTAACAAAGCAAC   @CCFFFFFHHDHH>HIIJIJJIJGGHEHIIHHHCHCHIIIIGFA88'6AEEEFFCDEEEEEDDDDDD@@CEDDDEDDDDDC>A@8CCCDB  NM:i:0  MD:Z:71 MC:Z:90M    AS:i:71XS:i:0

Which position in the reference is my read mapped?

Which position in the reference is my read mapped?

please, don't be lazy and read what fin swimmer wrote:

To understand the sam format have a look into the specs https://samtools.github.io/hts-specs/SAMv1.pdf You will see that your read is unmapped (column 2 has the flag 4 and column 3 has the value *).

1 answer

Hello,

you cannot use bwa to map reads with just 1 base. Why are you trying this?

To understand the sam format have a look into the specs. You will see that your read is unmapped (column 2 has the flag 4 and column 3 has the value *).

fin swimmer

Log in to answer this question.