Difference between revisions of "SAM Validation Criteria"
From Genome Analysis Wiki
Jump to navigationJump to searchLine 181: | Line 181: | ||
|style="background-color:red;"| | |style="background-color:red;"| | ||
|- | |- | ||
− | | VTYPE is [AifZH] for SAM and [AcCsSiIfZH] | + | | VTYPE is [AifZH] for SAM and [AcCsSiIfZH] for BAM |
|style="background-color:red;"| | |style="background-color:red;"| | ||
|style="background-color:red;"| | |style="background-color:red;"| | ||
Line 222: | Line 222: | ||
|style="background-color:red;"| | |style="background-color:red;"| | ||
|style="background-color:red;"| | |style="background-color:red;"| | ||
+ | |- | ||
+ | | For TAG = E2, length should be the same as the Read Length | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |- | ||
+ | | For TAG = E2, each base should be different than the read Base (unless 'N') | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |- | ||
+ | | For TAG = U2, length should be the same as the Read Length | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |style="background-color:red;"| | ||
+ | |- | ||
|} | |} | ||
Revision as of 17:24, 24 May 2010
SAM Header Validation Rules
TODO
Validation Criteria | Implemented | Tested | ||
---|---|---|---|---|
SAM | BAM | SAM | BAM | |
All Required Fields are set |
SAM Alignment Validation
Validation Criteria | Implemented | Tested | ||
---|---|---|---|---|
SAM | BAM | SAM | BAM | |
QNAME.Length() > 0 and <= 254 | ||||
QNAME does not contain [ \t\n\r] | ||||
FLAG is an integer [0-9]+ | N/A: just interpret the bits as an int. | N/A: just interpret the bits as an int. | ||
FLAG is [0, (2^16)-1] | Parse Error since it will be written into a 16 bit field. | N/A: only a 16 bit field | N/A: only a 16 bit field | |
RNAME does not contain [ \t\n\r@=] | ||||
RNAME is found in an SQ header record if there are any SQs in the header. | ||||
Reference Name length does not match specified length. | N/A: reference name length is in BAM format only | N/A: reference name length is in BAM format only | ||
Reference ID is in range of the number of references | N/A: rID is in BAM format only | N/A: rID is in BAM format only | ||
POS is an integer [0-9]+ | N/A: just interpret the bits as an int. | N/A: just interpret the bits as an int. | ||
POS is [0, (2^29)-1] | Parse Error if it can't fit in the 32 bit field, other out of range is a validation error. | |||
MAPQ is an integer [0-9]+ | N/A: just interpret the bits as an int. | N/A: just interpret the bits as an int. | ||
MAPQ is [0, (2^8)-1] | Parse Error since it will be written into an 8 bit field. | N/A: only a 8 bit field | N/A: only a 8 bit field | |
CIGAR ([0-9]+[MIDNSHP])+|\* | ||||
MRNM does not contain [ \t\n\r@] ('=' means it is the same as RNAME) | ||||
If SQ is in the header RNAME & MRNM (if not “=”) must be in SQ. | ||||
MPOS is an integer [0-9]+ | ||||
MPOS is [0, (2^29)-1] | ||||
ISIZE is an integer -?[0-9]+ | ||||
ISIZE is [-(2^29), 2^29] | ||||
SEQ is [acgtnACGTN.=]+|\* | ||||
If SEQ is * then QUAL is * | ||||
QUAL is [!-~]+|* → dec 33 – 126 or dec 42 (which is in 32-126) (for BAM, it is between [0,93]) | ||||
If QUAL is not “*” it is the same length as SEQ. | ||||
TAG is [A-Z][A-Z0-9] | ||||
A TAG only appears once per alignment | ||||
VTYPE is [AifZH] for SAM and [AcCsSiIfZH] for BAM | ||||
VALUE does NOT contain [\t\n\r] | ||||
For VTYPE = “A”, VALUE is a printable character | ||||
For VTYPE = “i”, VALUE is a signed 32-bit integer. | ||||
For VTYPE = “f”, VALUE is a single-precision float. | ||||
For VTYPE = “Z”, VALUE is a printable string. | ||||
For VTYPE = “H”, VALUE is a Hex string. | ||||
For TAG = E2, length should be the same as the Read Length | ||||
For TAG = E2, each base should be different than the read Base (unless 'N') | ||||
For TAG = U2, length should be the same as the Read Length |
NOTE: There are other TAG Validations that can be done. They will come later.
NOTE: There may be other BAM Validations that can be done. They will come later.
Consider may want to validate the cigar string against the read length...
Other Read Validation
Validation Criteria | Implemented | Tested | ||
---|---|---|---|---|
SAM | BAM | SAM | BAM | |
If specified to check sort order (either based on SO flag or user specifies coordinate or query name). |
SAM Questions
- Comment says: “If the mapping position of the query is not available, RNAME and CIGAR are set as “*”, and POS and MAPQ as 0.” Is it all or nothing? Can some be set to “*”/0 but not all?
- Same question for MRNM = “*” and MPOS & ISIZE = 0
- Comment says: “The name of a pair/read is required to be unique in the SAM file, but one pair/read may appear multiple times in different alignment records, representing multiple or split hits.” - Is there anything here that needs to be validated???