How to get an aligment file to the reference in a raw format (.txt file etc).
1
0
Entering edit mode
5.8 years ago
vellryba • 0

Hello,

is there a way to get an alignment file out? I am after something that you get after the tview command but I want it in a text file.

Is there a way to do this?

Thank you

PS: I cannot reply to Pierre. This doesnt work for me and produces something like this:

CG************C*********** S. .
TC************.*********** .C************G*********** TT************G***********

I dont seem to be able to reply or add comments. I am using the latest version.

sequencing alignment next-gen • 998 views
ADD COMMENT
0
Entering edit mode

Which version of samtools are you using? Hopefully the latest (v.1.8).

ADD REPLY
0
Entering edit mode
5.8 years ago

I suppose you're asking about samtools tview , use option '-d '?

$ samtools tview -d T -p ref:20 --reference toy.fa toy.bam > align.txt
$ cat align.txt
 21        31         41        51        61        71        81                
CTGTGCTAGTAGGCAG*TCAGCGCCATNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
.....K.K......K. ..........                                                     
...      ,,,,,    ,,,,,,,,,                                                     
..>>>>>>>>>>>>>>T.....
ADD COMMENT
0
Entering edit mode

Hi, unfortunately this doesnt work for me. Any idea? My goal is to look at correlated mutations in particular reads. Wanted to extract reads that cover both of these mutations using python from the raw alignment file. Do you have any other idea how to do that?

ADD REPLY
0
Entering edit mode

Hi, unfortunately this doesnt work for me

without any error message / command it's not possible to help you.

Wanted to extract reads that cover both of these mutations using python from the raw alignment file.

how is it related to your initial question ?

ADD REPLY
0
Entering edit mode

I dont get an error message but this what I get back:

CG************C*********** S. .
TC************.*********** .C************G*********** TT************G***********

Its not in the nice readable format you show. My command - samtools tview -d T s90_mapped-sorted.bam ref_E2_J6.fa > align.txt

ADD REPLY
0
Entering edit mode

what's your version of samtools ?

ADD REPLY
0
Entering edit mode

My samtools are version v.1.8

ADD REPLY

Login before adding your answer.

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