Transfer Fasta to Fastq
1
0
Entering edit mode
Bin Ma ▴ 20
@bin-ma-4363
Last seen 10.2 years ago
Dear all, Is there any function can transfer Fasta to Fastq file. With Best Regards Bin Ma -------------------------------------------------- http://lvandma.wordpress.com Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant Nutrition, College of Environmental and Natural Resource Sciences, Zhejiang University, Hangzhou 310029, China [[alternative HTML version deleted]]
• 2.6k views
ADD COMMENT
0
Entering edit mode
Bin Ma ▴ 20
@bin-ma-4363
Last seen 10.2 years ago
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https: stat.ethz.ch="" pipermail="" bioconductor="" attachments="" 20101124="" cd5afd77="" attachment-0001.pl="">
ADD COMMENT
0
Entering edit mode
Just curious, but where would the quality score information come from? Or do you have them in a separate .qual file? chris On Nov 24, 2010, at 5:56 AM, Bin Ma wrote: > Dear all, > > Is there any function can transfer Fasta to Fastq file. > > > With Best Regards > > Bin Ma > -------------------------------------------------- > http://lvandma.wordpress.com > Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant Nutrition, > College of Environmental and Natural Resource Sciences, > Zhejiang University, Hangzhou 310029, China > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
Hi, if you got fasta + qual files, there is an example perl script here: http://biostar.stackexchange.com/questions/2774/how-to-convert-454 -data-to-sam-format/2778#2778 have nothing in R yet, but that shows the principle and could be easily done in R. If you don't have a qual file, you will have to make the values up using eg. some constant values. Using an offset of 33 gives you Sanger style quality code, while -i think- using offset 64 should yield Illumina score codes. Best Michael On Nov 24, 2010, at 2:36 PM, Chris Fields wrote: > Just curious, but where would the quality score information come from? Or do you have them in a separate .qual file? > > chris > > On Nov 24, 2010, at 5:56 AM, Bin Ma wrote: > >> Dear all, >> >> Is there any function can transfer Fasta to Fastq file. >> >> >> With Best Regards >> >> Bin Ma >> -------------------------------------------------- >> http://lvandma.wordpress.com >> Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant Nutrition, >> College of Environmental and Natural Resource Sciences, >> Zhejiang University, Hangzhou 310029, China >> >> [[alternative HTML version deleted]] >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
The read454 function in ShortRead will parse fasta and qual files into a ShortReadQ. No trivial way to write that out as a fastq, but it could be done. On Wed, Nov 24, 2010 at 5:50 AM, Michael Dondrup <michael.dondrup@uni.no>wrote: > Hi, > if you got fasta + qual files, there is an example perl script here: > > http://biostar.stackexchange.com/questions/2774/how-to-convert-454 -data-to-sam-format/2778#2778 > have nothing in R yet, but that shows the principle and could be easily > done in R. If you don't have a qual file, > you will have to make the values up using eg. some constant values. > > Using an offset of 33 gives you Sanger style quality code, while -i think- > using offset 64 should yield Illumina > score codes. > > Best > Michael > > On Nov 24, 2010, at 2:36 PM, Chris Fields wrote: > > > Just curious, but where would the quality score information come from? > Or do you have them in a separate .qual file? > > > > chris > > > > On Nov 24, 2010, at 5:56 AM, Bin Ma wrote: > > > >> Dear all, > >> > >> Is there any function can transfer Fasta to Fastq file. > >> > >> > >> With Best Regards > >> > >> Bin Ma > >> -------------------------------------------------- > >> http://lvandma.wordpress.com > >> Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant > Nutrition, > >> College of Environmental and Natural Resource Sciences, > >> Zhejiang University, Hangzhou 310029, China > >> > >> [[alternative HTML version deleted]] > >> > >> _______________________________________________ > >> Bioconductor mailing list > >> Bioconductor@stat.math.ethz.ch > >> https://stat.ethz.ch/mailman/listinfo/bioconductor > >> Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
On 11/24/2010 06:42 AM, Michael Lawrence wrote: > The read454 function in ShortRead will parse fasta and qual files into a > ShortReadQ. No trivial way to write that out as a fastq, but it could be > done. ShortRead::writeFastq Also ?ShortReadQ to construct piece together the fasta / fastq components if they're from separate fasta-style files Martin > > On Wed, Nov 24, 2010 at 5:50 AM, Michael Dondrup <michael.dondrup at="" uni.no="">wrote: > >> Hi, >> if you got fasta + qual files, there is an example perl script here: >> >> http://biostar.stackexchange.com/questions/2774/how-to-convert-454 -data-to-sam-format/2778#2778 >> have nothing in R yet, but that shows the principle and could be easily >> done in R. If you don't have a qual file, >> you will have to make the values up using eg. some constant values. >> >> Using an offset of 33 gives you Sanger style quality code, while -i think- >> using offset 64 should yield Illumina >> score codes. >> >> Best >> Michael >> >> On Nov 24, 2010, at 2:36 PM, Chris Fields wrote: >> >>> Just curious, but where would the quality score information come from? >> Or do you have them in a separate .qual file? >>> >>> chris >>> >>> On Nov 24, 2010, at 5:56 AM, Bin Ma wrote: >>> >>>> Dear all, >>>> >>>> Is there any function can transfer Fasta to Fastq file. >>>> >>>> >>>> With Best Regards >>>> >>>> Bin Ma >>>> -------------------------------------------------- >>>> http://lvandma.wordpress.com >>>> Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant >> Nutrition, >>>> College of Environmental and Natural Resource Sciences, >>>> Zhejiang University, Hangzhou 310029, China >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> _______________________________________________ >>>> Bioconductor mailing list >>>> Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>>> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: >> http://news.gmane.org/gmane.science.biology.informatics.conductor >> > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Computational Biology Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: M1-B861 Telephone: 206 667-2793
ADD REPLY
0
Entering edit mode
Yes there is one, just figured out the writeFastQ method for ShortRead. So here is a code example, because it wasn't quite clear for me how to feed the the read454 function with data in the correct way, maybe there should be a better example in the documentation (eg. this ): > rpath = RochePath(experimentPath="/directory/with/fna+qual/") > reads = read454(rpath) Read 460210 items > writeFastq(reads, file="~/out.fastq") It wa not quite clear to me from the docu what happens if there are multiple files in that directory, I guess just one is taken? Best Michael On Nov 24, 2010, at 3:42 PM, Michael Lawrence wrote: > The read454 function in ShortRead will parse fasta and qual files into a ShortReadQ. No trivial way to write that out as a fastq, but it could be done. > > On Wed, Nov 24, 2010 at 5:50 AM, Michael Dondrup <michael.dondrup at="" uni.no=""> wrote: > Hi, > if you got fasta + qual files, there is an example perl script here: > http://biostar.stackexchange.com/questions/2774/how-to-convert-454 -data-to-sam-format/2778#2778 > have nothing in R yet, but that shows the principle and could be easily done in R. If you don't have a qual file, > you will have to make the values up using eg. some constant values. > > Using an offset of 33 gives you Sanger style quality code, while -i think- using offset 64 should yield Illumina > score codes. > > Best > Michael > > On Nov 24, 2010, at 2:36 PM, Chris Fields wrote: > > > Just curious, but where would the quality score information come from? Or do you have them in a separate .qual file? > > > > chris > > > > On Nov 24, 2010, at 5:56 AM, Bin Ma wrote: > > > >> Dear all, > >> > >> Is there any function can transfer Fasta to Fastq file. > >> > >> > >> With Best Regards > >> > >> Bin Ma > >> -------------------------------------------------- > >> http://lvandma.wordpress.com > >> Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant Nutrition, > >> College of Environmental and Natural Resource Sciences, > >> Zhejiang University, Hangzhou 310029, China > >> > >> [[alternative HTML version deleted]] > >> > >> _______________________________________________ > >> Bioconductor mailing list > >> Bioconductor at stat.math.ethz.ch > >> https://stat.ethz.ch/mailman/listinfo/bioconductor > >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor at stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >
ADD REPLY
0
Entering edit mode
On Wed, Nov 24, 2010 at 7:43 AM, Michael Dondrup <michael.dondrup@uni.no>wrote: > Yes there is one, > > just figured out the writeFastQ method for ShortRead. So here is a code > example, because it wasn't quite clear for me how to > feed the the read454 function with data in the correct way, maybe there > should be a better example in the documentation (eg. this ): > > > rpath = RochePath(experimentPath="/directory/with/fna+qual/") > > reads = read454(rpath) > Read 460210 items > > writeFastq(reads, file="~/out.fastq") > > It wa not quite clear to me from the docu what happens if there are > multiple files in that directory, I guess just one is taken? > > As is the convention with ShortRead, all files matching the pattern are concatenated into the resulting ShortReadQ object. If you want to read a single file, use the complete path to the file. Also, the readFastaQual alias for that function might be conceptually more appropriate if you're not dealing with 454 data. > Best > Michael > > On Nov 24, 2010, at 3:42 PM, Michael Lawrence wrote: > > > The read454 function in ShortRead will parse fasta and qual files into a > ShortReadQ. No trivial way to write that out as a fastq, but it could be > done. > > > > On Wed, Nov 24, 2010 at 5:50 AM, Michael Dondrup <michael.dondrup@uni.no> > wrote: > > Hi, > > if you got fasta + qual files, there is an example perl script here: > > > http://biostar.stackexchange.com/questions/2774/how-to-convert-454 -data-to-sam-format/2778#2778 > > have nothing in R yet, but that shows the principle and could be easily > done in R. If you don't have a qual file, > > you will have to make the values up using eg. some constant values. > > > > Using an offset of 33 gives you Sanger style quality code, while -i > think- using offset 64 should yield Illumina > > score codes. > > > > Best > > Michael > > > > On Nov 24, 2010, at 2:36 PM, Chris Fields wrote: > > > > > Just curious, but where would the quality score information come from? > Or do you have them in a separate .qual file? > > > > > > chris > > > > > > On Nov 24, 2010, at 5:56 AM, Bin Ma wrote: > > > > > >> Dear all, > > >> > > >> Is there any function can transfer Fasta to Fastq file. > > >> > > >> > > >> With Best Regards > > >> > > >> Bin Ma > > >> -------------------------------------------------- > > >> http://lvandma.wordpress.com > > >> Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant > Nutrition, > > >> College of Environmental and Natural Resource Sciences, > > >> Zhejiang University, Hangzhou 310029, China > > >> > > >> [[alternative HTML version deleted]] > > >> > > >> _______________________________________________ > > >> Bioconductor mailing list > > >> Bioconductor@stat.math.ethz.ch > > >> https://stat.ethz.ch/mailman/listinfo/bioconductor > > >> Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > > > _______________________________________________ > > > Bioconductor mailing list > > > Bioconductor@stat.math.ethz.ch > > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > https://stat.ethz.ch/mailman/listinfo/bioconductor > > Search the archives: > http://news.gmane.org/gmane.science.biology.informatics.conductor > > > > [[alternative HTML version deleted]]
ADD REPLY
0
Entering edit mode
In my opinion, it's always best to convert to Sanger-based FASTQ if possible. IIRC that is what most archive resources (SRA, etc) currently support, it's now spec'ed in a publication (so you can at least point to that and blame the authors if something isn't correct :) Not to mention it's fairly difficult to discern between the variant FASTQ forms based on the quality string alone. http://www.ncbi.nlm.nih.gov/pubmed/20015970?dopt=Abstract chris (full disclosure, one of the co-authors on that paper) On Nov 24, 2010, at 7:50 AM, Michael Dondrup wrote: > Hi, > if you got fasta + qual files, there is an example perl script here: > http://biostar.stackexchange.com/questions/2774/how-to-convert-454 -data-to-sam-format/2778#2778 > have nothing in R yet, but that shows the principle and could be easily done in R. If you don't have a qual file, > you will have to make the values up using eg. some constant values. > > Using an offset of 33 gives you Sanger style quality code, while -i think- using offset 64 should yield Illumina > score codes. > > Best > Michael > > On Nov 24, 2010, at 2:36 PM, Chris Fields wrote: > >> Just curious, but where would the quality score information come from? Or do you have them in a separate .qual file? >> >> chris >> >> On Nov 24, 2010, at 5:56 AM, Bin Ma wrote: >> >>> Dear all, >>> >>> Is there any function can transfer Fasta to Fastq file. >>> >>> >>> With Best Regards >>> >>> Bin Ma >>> -------------------------------------------------- >>> http://lvandma.wordpress.com >>> Zhejiang Provincial Key Laboratory of Subtropical Soil and Plant Nutrition, >>> College of Environmental and Natural Resource Sciences, >>> Zhejiang University, Hangzhou 310029, China >>> >>> [[alternative HTML version deleted]] >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY

Login before adding your answer.

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