SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
MAPping Quality v.s. Alignment Score (AS) in SAM format xiangwulu Bioinformatics 4 03-02-2016 04:35 AM
SAM/BAM format to wiggle format pinki999 Bioinformatics 19 08-12-2015 12:35 AM
SAM to CUFFLINKS SAM format repinementer Bioinformatics 4 03-15-2012 08:53 AM
Looking process to convert gff3 format into ace format or sam format andylai Bioinformatics 1 05-17-2011 02:09 AM
anyone help me on bowtie format -> sam format! tninja Bioinformatics 2 04-25-2010 09:33 PM

Reply
 
Thread Tools
Old 11-16-2016, 05:56 AM   #1
leontovyc_roman
Junior Member
 
Location: Czech Republic

Join Date: Aug 2016
Posts: 5
Default Mapping possition in SAM format

Hi all,
I have question concerning the SAM format. I need to define position of read mapped to the reference. Which means position of first base of the read regardless if matched or not to reference. I know there is field POS in SAM format but it refers to position of the first matched base.

example:
reference-AGCATGTTAGATAAGTGTCTAGGATCATATGCATGA
mapped read--TAGTTAGATAAGTGT

using this example POS is 6 - the first matched base is G on the 6th position of the reference
however I need to get 4 because T is the aligned with 4th position

Do you have any idea how to get this information from SAM format?

cheers

Roman
leontovyc_roman is offline   Reply With Quote
Old 11-16-2016, 06:14 AM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,480
Default

If the position is 6, then the first two bases were soft-clipped and the CIGAR string starts with 2S. You can, thus, parse the CIGAR string and modify the start position as appropriate. There are some functions in the pysam module that can help with this, should that be useful for you.
dpryan is offline   Reply With Quote
Old 11-21-2016, 07:39 AM   #3
leontovyc_roman
Junior Member
 
Location: Czech Republic

Join Date: Aug 2016
Posts: 5
Default

Quote:
Originally Posted by dpryan View Post
If the position is 6, then the first two bases were soft-clipped and the CIGAR string starts with 2S. You can, thus, parse the CIGAR string and modify the start position as appropriate. There are some functions in the pysam module that can help with this, should that be useful for you.
Great, I piped couple of awk commands and it works perfectly. Thanks for saving my time

Roman
leontovyc_roman is offline   Reply With Quote
Reply

Tags
alignment, mapping, position, sam

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 04:23 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO