Possible Duplicate:
How to generate a consensus fasta sequence from SAM tools pileup?
I was trying to convert a fastq consensus sequnece (generated by the mpileup samtools) to a fasta file. However the original FASTQ lines are wrapped. Most of fastq parsers do not work with multi-line fastq files. They only work for 4 lines standard fastq format. Is there a perl script or C# or Java tools to deal with this issue? Please don't use Python, I am not strong on it and I don't want to be an expert on many programming languages during a short time. Of cource, if python is realy powerful, it is considerable.:)
Also if we can get the corresponding quality score for each of the entries, it will be great.
Thanks.
1 answer
It's not too hard to alter the samtools.pl program itself to make fastas instead of fastqs. perl programs are just ordinary text. You want to find the place where it prints out "@" and sequence, and change the "@" to a ">", and you want to comment out the lines where it prints out the "+", newline, and the quality string, by putting "#" in front of those lines.
That's what I did. I don't have access to it here, but I can pull it up tomorrow. Poke around here or seqanswers for the last time I told someone how to fix the perl script to do that.
Or, you could do it with a short perl script, or maybe a line of sed.
Log in to answer this question.