Open main menu

Genome Analysis Wiki β

Difference between revisions of "LibStatGen: FASTQ"

(Classes in the FASTQ Portion of Library)
 
(45 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Validation Criteria ==
+
[[Category:C++]]
=== Sequence Identifier Line ===
+
[[Category:libStatGen]]
{| class="wikitable" border="1"
+
[[Category:libStatGen FASTQ]]
|-
+
 
!  Validation Criteria
+
== Where to find the fastqFile Library and the FastQValidator ==
!  Error Message
+
 
|-
+
The fastQ Library is now a part of [[C++ Library: libStatGen]].
|  Line is at least 2 characters long ('@' and at least 1 for the sequence identifier)
+
 
|  ERROR on Line <current line #>:
+
The FastQValidator is documented at [[FastQValidator]].
|-
+
 
|  Line starts with an '@'
+
== FASTQ Library Component for Reading and Validating FastQFiles ==
|  ERROR on Line <current line #>:
+
The software reads and validates fastq files in both compressed and uncompressed formats.
|-
+
 
|  Line does not contain a space between the '@' and the first sequence identifier (which must be at least 1 character).
+
The FASTQ component of the library is found in libStatGen/fastq/.
|  ERROR on Line <current line #>:
 
|-
 
|  Every entry in the file should have a unique identifier.
 
|  ERROR on Line <current line #>: Repeated Sequence Identifier: <identifier> at Lines <previous line #> <current line #>
 
|}
 
  
=== Raw Sequence Line ===
+
See https://github.com/statgen/libStatGen/commits/master/fastq for a list of the most recent updates to the development version of the FASTQ portion of the library.
{| class="wikitable" border="1"
 
|-
 
!  Validation Criteria
 
!  Error Message
 
|-
 
|  A base sequence should have non-zero length.
 
|  ERROR on Line <current line #>:  
 
|-
 
|  All characters in the base sequence must be in the allowable set specified via configuration.
 
* Base Only: A C T G N a c t g n
 
* Color Space Only: 0 1 2 3 .(period)
 
* Base or Color Space: A C T G N a c t g n 0 1 2 3 .(period)
 
|  ERROR on Line <current line #>:
 
|-
 
|  Reads should be of a configurable minimum length since many mappers will get into trouble with very short reads.
 
* If the raw sequence spans lines, the sum of the lengths of all lines are validated, not each individual line.
 
|  ERROR on Line <current line #>:
 
|-
 
|  Each Line of a Raw Sequence should have at least 1 character (not be blank).
 
|  ERROR on Line <current line #>:
 
|}
 
  
=== Plus Line ===
+
For the old change log, see: [[C++ Library: FASTQ Change Log]]
{| class="wikitable" border="1"
 
|-
 
!  Validation Criteria
 
!  Error Message
 
|-
 
|  Must exist for every sequence.
 
|  ERROR on Line <current line #>:
 
|-
 
|  If the optional sequence identifier is specified, it must equal the one on the Sequence Identifier Line.
 
|  ERROR on Line <current line #>:  
 
|}
 
  
=== Quality String Line ===
+
=== Classes in the FASTQ Portion of Library ===
{| class="wikitable" border="1"
+
{| style="margin: 1em 1em 1em 0; background-color: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse;" border="1"
 +
|-style="background: #f2f2f2; text-align: center;"
 +
! Class Name !!  Description
 
|-
 
|-
!  Validation Criteria
+
| <code>[[C++ Class: FastQFile|FastQFile]]</code>
!  Error Message
+
| Class used for reading/validating a fastq file.
 
|-
 
|-
| A quality string should be present for every base sequence.
+
| <code>[http://csg.sph.umich.edu//mktrost/doxygen/current/classBaseCount.html BaseCount]</code>
ERROR on Line <current line #>:
+
| Wrapper around an array that has one index per base and an extra index for a total count of all bases.  This class is used to keep a count of the number of times each index has occurred. It can print a percentage of the occurrence of each base against the total number of bases.
 
|-
 
|-
| Paired quality and base sequences should be of the same length.
+
| <code>[http://csg.sph.umich.edu//mktrost/doxygen/current/classBaseComposition.html BaseComposition]</code>
| ERROR on Line <current line #>:
+
| Class that tracks the composition of base by read location.
 
|-
 
|-
| Valid quality values should all have ASCII codes &gt; 32.
+
| <code>[http://csg.sph.umich.edu//mktrost/doxygen/current/classFastQStatus.html FastQStatus]</code>
| ERROR on Line <current line #>:
+
| Status for FastQ operations.
 
|}
 
|}
  
== Additional Features ==
+
== FASTQ Output ==  
*Base composition are reported and tracked by position.
+
When a sequence is read, error messages for the first maxReportedErrors are output for failed [[C++ Class: FastQFile#Validation Criteria Used For Reading a Sequence|Validation Criteria]].
*Consumes gzipped and uncompressed text files transparently (see libcsg/InputFile.h).
+
For Example:
 
+
  ERROR on Line 25: The sequence identifier line was too short.
== Additional Wishlist - Not Implemented ==
+
  ERROR on Line 29: First line of a sequence does not begin wtih @
*To reduce memory usage, implement a two-pass algorithm that stores only a key for each sequence name (rather than complete sequence names) in memory (suggest a pair of options -1 -> one pass, high memory use, -2 -> two pass lower memory use, default is -1).
+
  ERROR on Line 33: No Sequence Identifier specified before the comment.
 
 
 
 
== Assumptions ==
 
*The Sequence Identifier is separated by an optional comment by a " ".
 
*No validation is required on the optional comment field of the Sequence Identifier Line.
 
*The Sequence Identifier and the '+' Lines cannot wrap lines.  The are each completely contained on one line.
 
*Raw Sequences and Quality Strings may wrap lines
 
*All lines are part of the Raw Sequence Line until a line that starts with a '+' is discovered.
 
*All lines are considered part of the quality string until at least the length of the associated raw sequence is hit (or the end of the file is reached).  This is due to the fact that '@' is a valid quality character, so does not necessarily indicate the start of a Sequence Identifier Line.
 
 
 
== How to Use the fastQValidator Executable ==
 
'''Required Parameters:'''
 
        -f : FastQ filename with path to be prorcessed.
 
 
 
'''Optional Parameters:'''
 
        -l : Minimum allowed read length (Defaults to 10).
 
        -e  :  Maximum number of errors to display before suppressing them(Defaults to 20).
 
        -b  :  Raw sequence type:  B - ACTGN only (Default)
 
                                  C - 0123. only
 
                                  BC - ACTGN or 0123.
 
 
 
'''Testing only Parameters:'''
 
        -t : If "ReadOnly" is specified, the fastq will be read but not processed.  This may be used for determining read time.
 
'''Usage:'''
 
        ./fastQValidator -f <fileName> -l <minReadLen> -e <maxReprotedErrors> -b <rawSeqType>
 
 
 
'''Examples:'''
 
        ../fastQValidator -f testFile.txt
 
        ../fastQValidator -f testFile.txt -l 10 -b BC -e 100
 
        ./fastQValidator -f test/testFile.txt -l 10 -b BC -e 100
 
        time ./fastQValidator -f test/testFile.txt -t ReadOnly
 
  
== FastQ Validator Output ==
+
== FastQValidator ==
'''Coming Soon'''
+
The [[FastQValidator]] was built using the FastQFile class.  More details on that program are at the supplied link.

Latest revision as of 10:49, 2 February 2017


Contents

Where to find the fastqFile Library and the FastQValidator

The fastQ Library is now a part of C++ Library: libStatGen.

The FastQValidator is documented at FastQValidator.

FASTQ Library Component for Reading and Validating FastQFiles

The software reads and validates fastq files in both compressed and uncompressed formats.

The FASTQ component of the library is found in libStatGen/fastq/.

See https://github.com/statgen/libStatGen/commits/master/fastq for a list of the most recent updates to the development version of the FASTQ portion of the library.

For the old change log, see: C++ Library: FASTQ Change Log

Classes in the FASTQ Portion of Library

Class Name Description
FastQFile Class used for reading/validating a fastq file.
BaseCount Wrapper around an array that has one index per base and an extra index for a total count of all bases. This class is used to keep a count of the number of times each index has occurred. It can print a percentage of the occurrence of each base against the total number of bases.
BaseComposition Class that tracks the composition of base by read location.
FastQStatus Status for FastQ operations.

FASTQ Output

When a sequence is read, error messages for the first maxReportedErrors are output for failed Validation Criteria. For Example:

ERROR on Line 25: The sequence identifier line was too short.
ERROR on Line 29: First line of a sequence does not begin wtih @
ERROR on Line 33: No Sequence Identifier specified before the comment.

FastQValidator

The FastQValidator was built using the FastQFile class. More details on that program are at the supplied link.