Position of aligned read in SAM file.
1
0
Entering edit mode
5.6 years ago

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 • 2.5k views
ADD COMMENT
0
Entering edit mode

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?

ADD REPLY
0
Entering edit mode

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 *).

ADD REPLY
4
Entering edit mode
5.6 years ago

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

ADD COMMENT

Login before adding your answer.

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