From Genome Analysis Wiki
Jump to: navigation, search

LibStatGen: FASTQ

780 bytes added, 15:23, 15 March 2010
no edit summary
== How to Use the fastQFile Library ==
*'''Library Name:''' libfqf.a
*'''Additional Libraries Needed:''' libcsg/libcsg.a thirdParty/samtools/libbam.a**Note: When you include the libraries, make sure you include them in this order: <path to base pipeline directory>/fastQFile/libfqf.a <path to base pipeline directory>/libcsg/libcsg.a <path to base pipeline directory>/thirdParty/samtools/libbam.a
*'''Include Files:''' FastQFile.h
*'''Class Name:''' FastQFile
Here is an example of how this would be done.
<your return type> <yourMethod>() { FastQFile fastQFile;
String filename = <your filename>;
BaseAsciiMap::SPACE_TYPE spaceType = <BASE_SPACE/COLOR_SPACE>;/ Open the fastqfile with the default UNKNOWN space type which will determine the // Open base type from the first character in the fastqfilesequence. if(fastQFile.openFile(filename, spaceType) != FASTQ_SUCCESS)
// Failed to open the specified file.
// Keep reading the file until there are no more fastq sequences to process.
while (!ifeoffastQFile.isEof(myFile))
// Read one sequence. This call will read all the lines for
// one sequence.
FastQFile::FastQStatus = readFastQSequence;
// NOTE: It is up to you if you want to process only for success:
// Do NOT try to process on a FASTQ_FAILURE
if(fastQFile.readFastQSequence() == FastQFile::FASTQ_SUCCESS)
// The sequence is valid.
<Your Processing Here>
// For example if you want to print the lines of the sequence:
printf("The Sequence ID Line is: %s", fastQFile.mySequenceIdLine.c_str());
printf("The Sequence ID is: %s", fastQFile.mySequenceIdentifier.c_str());
printf("The Sequence Line is: %s", fastQFile.myRawSequence.c_str());
printf("The Plus Line is: %s", fastQFile.myPlusLine.c_str());
printf("The Quality String Line is: %s", fastQFile.myQualityString.c_str());
// Finished processing all of the sequences in the file.
// Close the input file.
return(<your return info>); // It is up to you to determine your return.
== Validation Criteria Used For Reading a Sequence ==

Navigation menu