SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid perl scripts for converting colour-space <-> base-space gringer Bioinformatics 7 07-20-2011 07:35 AM
TopHat color space SongLi Bioinformatics 3 12-28-2010 09:27 AM
Converting nucleotide-space to color-space javijevi Bioinformatics 7 11-29-2010 02:14 AM
Solid formats translator(base space/color space/double encoded) AronaldJ SOLiD 0 10-26-2010 12:10 AM
direct mapping of color-space data against color-space begsch SOLiD 1 09-09-2009 09:25 PM

Reply
 
Thread Tools
Old 10-09-2012, 08:18 AM   #1
loituna
Junior Member
 
Location: canada

Join Date: Aug 2011
Posts: 5
Default Converting sam to color space

Hi,

Does anybody know if a tool exists for converting sam (or bam) back to original csfasta file?
I know that the color space information is included in the sam format, but I can't find a tool that does the conversion.
So far, from what I read, neither samtool view nor picard tool have that option.
That would be great if it existed, I really don't want to do it myself

Thanks!
loituna is offline   Reply With Quote
Old 10-09-2012, 03:21 PM   #2
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

Seems like time for a perl one liner. Try this:
Code:
cat <in.sam> | grep -v "^@" | perl -ne '$_ =~ s/\t.*CS:Z:([^\t]+).*/\n$1/g; print ">$_";'
nilshomer is offline   Reply With Quote
Old 10-10-2012, 06:19 AM   #3
loituna
Junior Member
 
Location: canada

Join Date: Aug 2011
Posts: 5
Default

Thanks!
But I am not sure it is making exactly what I want :
The problem is that I want to get the original read, as they were output from the sequencer.
So if part of the read was cut because the end was considered not matching I would like to put them back together. Same as if the read was align not continously on the genome (part of a read was matching somewhere and the other part somewhere else, because eg of rearrangement).
I am not sure the solution is trivial to write especially a fast solution. or is it?

And I am not entirely sure either that the problem I am describing is correct, and there might be other issue I don't see right now...

what do you think?
loituna is offline   Reply With Quote
Old 10-11-2012, 04:56 PM   #4
nilshomer
Nils Homer
 
nilshomer's Avatar
 
Location: Boston, MA, USA

Join Date: Nov 2008
Posts: 1,285
Default

The CS tag should give ALL the colors, not just the aligned portion.
nilshomer is offline   Reply With Quote
Old 10-12-2012, 02:10 AM   #5
loituna
Junior Member
 
Location: canada

Join Date: Aug 2011
Posts: 5
Default

Great!

Then that solve my problem..

Thanks
loituna is offline   Reply With Quote
Reply

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 10:57 AM.


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