zachary-foster / alignreads

A wrapper for YASRA and associated parsing scripts
GNU General Public License v2.0
1 stars 0 forks source link

Add @SQ lines to sam file #10

Open zachary-foster opened 9 years ago

zachary-foster commented 9 years ago

Samtools needs @SQ lines after the @HD lines to read the sam file correctly. Since YASRA does not seem to add these lines, I can add them in after the fact. Below is the solution that Angela Mcdonnell used to fix this problem:

I needed to manipulate it and add one @SQ line (right after the @HD line) for each contig so I could use samtools after alignreads:

@HD VN:1.3

97111-1 0 Contig1_phylogenetic_probe_set_0_590 1 255 3S73M * 0 0 CAATTTCTTTAGATACCTTTCTCAAGCATTGCTCTAACTCTCATTGGCAAACCATACAGCCTAATGAATCCAGCAG 5555555555555555555555555555555555555555555555555555555555555555555555555555

39387-1 16 Contig1_phylogenetic_probe_set_0_590 1 255 76M * 0 0 TTTCTTTAGATACCTTTCTCAAGCATTGCTCTAACTCTCATTGGCAAACCATACAGCCTAATGAATCCAGCAGCAT 5555555555555555555555555555555555555555555555555555555555555555555555555555

So, I have a script that one of our HPCC center staff wrote that allows me to write each unique value in the third column with some additional data in a new tab-delimited text file:

@SQ SN:"unique string of third column" LN:"difference of the two numbers at the end of the string of third column, plus one"