Changes

From Genome Analysis Wiki
Jump to navigationJump to search
780 bytes added ,  15:23, 15 March 2010
no edit summary
Line 1: Line 1:  
== How to Use the fastQFile Library ==
 
== How to Use the fastQFile Library ==
 
*'''Library Name:''' libfqf.a
 
*'''Library Name:''' libfqf.a
*'''Additional Libraries Needed:''' libcsg.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
 
*'''Include Files:''' FastQFile.h
 
*'''Class Name:''' FastQFile
 
*'''Class Name:''' FastQFile
Line 80: Line 82:  
Here is an example of how this would be done.
 
Here is an example of how this would be done.
   −
<your return type> <yourMethod>()
+
  FastQFile fastQFile;
{
   
   String filename = <your filename>;
 
   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 the fastqfile.
+
   // base type from the first character in the sequence.
   if(openFile(filename, spaceType) != FASTQ_SUCCESS)
+
   if(fastQFile.openFile(filename) != FASTQ_SUCCESS)
 
   {
 
   {
 
       // Failed to open the specified file.
 
       // Failed to open the specified file.
Line 93: Line 94:  
   }
 
   }
 
   // Keep reading the file until there are no more fastq sequences to process.
 
   // Keep reading the file until there are no more fastq sequences to process.
   while (!ifeof(myFile))
+
   while (!fastQFile.isEof())
 
   {
 
   {
 
       // Read one sequence. This call will read all the lines for  
 
       // Read one sequence. This call will read all the lines for  
 
       // one sequence.
 
       // one sequence.
      FastQFile::FastQStatus = readFastQSequence;
   
       /////////////////////////////////////////////////////////////////
 
       /////////////////////////////////////////////////////////////////
 
       // NOTE: It is up to you if you want to process only for success:
 
       // NOTE: It is up to you if you want to process only for success:
Line 105: Line 105:  
       // Do NOT try to process on a FASTQ_FAILURE
 
       // Do NOT try to process on a FASTQ_FAILURE
 
       /////////////////////////////////////////////////////////////////
 
       /////////////////////////////////////////////////////////////////
       if(readFastQSequence() == FASTQ_SUCCESS)
+
       if(fastQFile.readFastQSequence() == FastQFile::FASTQ_SUCCESS)
 
       {
 
       {
 
         // The sequence is valid.
 
         // The sequence is valid.
 
         <Your Processing Here>
 
         <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.
 
   // Finished processing all of the sequences in the file.
 
   // Close the input file.
 
   // Close the input file.
   closeFile();
+
   fastQFile.closeFile();
 
   return(<your return info>); // It is up to you to determine your return.
 
   return(<your return info>); // It is up to you to determine your return.
}
+
 
    
== Validation Criteria Used For Reading a Sequence ==
 
== Validation Criteria Used For Reading a Sequence ==

Navigation menu