Line 6: |
Line 6: |
| ! Method Name !! Description | | ! Method Name !! Description |
| |- | | |- |
− | | <code>void resetRecord()</code> | + | | <code>void SamRecord::resetRecord()</code> |
| | Resets the record to be an empty record. This is not necessary when you are reading a Sam/Bam file, but if you are setting fields, it is a good idea to clean out a record before reusing it. Clearing it allows you to not have to set any empty fields. | | | Resets the record to be an empty record. This is not necessary when you are reading a Sam/Bam file, but if you are setting fields, it is a good idea to clean out a record before reusing it. Clearing it allows you to not have to set any empty fields. |
| |- | | |- |
− | | <code>bool setReadName(const char* readName)</code> | + | | <code>bool SamRecord::setReadName(const char* readName)</code> |
| | Sets QNAME to the passed in name. | | | Sets QNAME to the passed in name. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setFlag(int16_t flag)</code> | + | | <code>bool SamRecord::setFlag(int16_t flag)</code> |
| | Sets the bitwise FLAG to the passed in value. | | | Sets the bitwise FLAG to the passed in value. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setReferenceName(SamFileHeader& header, const char* referenceName)</code> | + | | <code>bool SamRecord::setReferenceName(SamFileHeader& header, const char* referenceName)</code> |
| | Sets the reference sequence name. The reference id is calculated using the header. | | | Sets the reference sequence name. The reference id is calculated using the header. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool set1BasedPosition(int32_t position)</code> | + | | <code>bool SamRecord::set1BasedPosition(int32_t position)</code> |
| | Sets the leftmost position. The value passed in is 1-based (SAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. | | | Sets the leftmost position. The value passed in is 1-based (SAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool set0BasedPosition(int32_t position)</code> | + | | <code>bool SamRecord::set0BasedPosition(int32_t position)</code> |
| | Sets the leftmost position. The value passed in is 0-based (BAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. | | | Sets the leftmost position. The value passed in is 0-based (BAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setMapQuality(int8_t mapQuality)</code> | + | | <code>bool SamRecord::setMapQuality(int8_t mapQuality)</code> |
| | Sets the mapping quality. | | | Sets the mapping quality. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setCigar(const char* cigar)</code> | + | | <code>bool SamRecord::setCigar(const char* cigar)</code> |
| | Sets the cigar string to the passed in CIGAR. This is a SAM formatted CIGAR string. Internal processing handles switching between SAM/BAM formats when read/written. | | | Sets the cigar string to the passed in CIGAR. This is a SAM formatted CIGAR string. Internal processing handles switching between SAM/BAM formats when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setMateReferenceName(SamFileHeader& header, const char* referenceName)</code> | + | | <code>bool SamRecord::setMateReferenceName(SamFileHeader& header, const char* referenceName)</code> |
| | Sets the mate reference sequence name. The mate reference id is calculated using the header. | | | Sets the mate reference sequence name. The mate reference id is calculated using the header. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool set1BasedMatePosition(int32_t matePosition)</code> | + | | <code>bool SamRecord::set1BasedMatePosition(int32_t matePosition)</code> |
| | Sets the leftmost mate position. The value passed in is 1-based (SAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. | | | Sets the leftmost mate position. The value passed in is 1-based (SAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool set0BasedMatePosition(int32_t matePosition)</code> | + | | <code>bool SamRecord::set0BasedMatePosition(int32_t matePosition)</code> |
| | Sets the leftmost mate position. The value passed in is 0-based (BAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. | | | Sets the leftmost mate position. The value passed in is 0-based (BAM formatted). Internal processing handles switching between SAM/BAM formats when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setInsertSize(int32_t insertSize)</code> | + | | <code>bool SamRecord::setInsertSize(int32_t insertSize)</code> |
| | Sets the inferred insert size. | | | Sets the inferred insert size. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setSequence(const char* seq)</code> | + | | <code>bool SamRecord::setSequence(const char* seq)</code> |
| | Sets the sequence string to the passed in string. This is a SAM formatted sequence string. Internal processing handles switching between SAM/BAM formats when read/written. | | | Sets the sequence string to the passed in string. This is a SAM formatted sequence string. Internal processing handles switching between SAM/BAM formats when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool setQuality(const char* quality)</code> | + | | <code>bool SamRecord::setQuality(const char* quality)</code> |
| | Sets the quality string to the passed in string. This is a SAM formatted quality string. Internal processing handles switching between SAM/BAM formats when read/written. | | | Sets the quality string to the passed in string. This is a SAM formatted quality string. Internal processing handles switching between SAM/BAM formats when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
| |- | | |- |
− | | <code>bool addTag(const char* tag, char vtype, const char* value)</code> | + | | <code>bool SamRecord::addTag(const char* tag, char vtype, const char* value)</code> |
| | Adds a tag to the record with the specified tag, vtype, and value. Vtype can be SAM/BAM vtype. Internal processing handles switching between SAM/BAM vtypes when read/written. | | | Adds a tag to the record with the specified tag, vtype, and value. Vtype can be SAM/BAM vtype. Internal processing handles switching between SAM/BAM vtypes when read/written. |
| Returns true if successfully set, false if not. | | Returns true if successfully set, false if not. |
Line 77: |
Line 77: |
| ! Method Name !! Description | | ! Method Name !! Description |
| |- | | |- |
− | | <code>bool isValid(SamFileHeader& header)</code> | + | | <code>bool SamRecord::isValid(SamFileHeader& header)</code> |
| | Returns true if the record is valid. This performs validation steps. TODO: the method exists, but it does not yet perform any checks, so just returns true. | | | Returns true if the record is valid. This performs validation steps. TODO: the method exists, but it does not yet perform any checks, so just returns true. |
| |- | | |- |
− | | <code>int32_t getBlockSize()</code> | + | | <code>int32_t SamRecord::getBlockSize()</code> |
| | Returns the BAM block size of the record. | | | Returns the BAM block size of the record. |
| |- | | |- |
− | | <code>const char* getReferenceName(SamFileHeader& header)</code> | + | | <code>const char* SamRecord::getReferenceName(SamFileHeader& header)</code> |
| | Returns the reference sequence name (SAM format). | | | Returns the reference sequence name (SAM format). |
| |- | | |- |
− | | <code>int32_t getReferenceID()</code> | + | | <code>int32_t SamRecord::getReferenceID()</code> |
| | Returns the reference sequence ID (BAM format). | | | Returns the reference sequence ID (BAM format). |
| |- | | |- |
− | | <code>int32_t get1BasedPosition()</code> | + | | <code>int32_t SamRecord::get1BasedPosition()</code> |
| | Returns the 1-based (SAM formatted) leftmost position. | | | Returns the 1-based (SAM formatted) leftmost position. |
| |- | | |- |
− | | <code>int32_t get0BasedPosition()</code> | + | | <code>int32_t SamRecord::get0BasedPosition()</code> |
| | Returns the 0-based (BAM formatted) leftmost position. | | | Returns the 0-based (BAM formatted) leftmost position. |
| |- | | |- |
− | | <code>int8_t getReadNameLength()</code> | + | | <code>int8_t SamRecord::getReadNameLength()</code> |
| | Returns the length of the ReadName (QNAME). | | | Returns the length of the ReadName (QNAME). |
| |- | | |- |
− | | <code>int8_t getMapQuality()</code> | + | | <code>int8_t SamRecord::getMapQuality()</code> |
| | Returns the map quality. | | | Returns the map quality. |
| |- | | |- |
− | | <code>int16_t getBin()</code> | + | | <code>int16_t SamRecord::getBin()</code> |
| | Returns the BAM bin for the record. | | | Returns the BAM bin for the record. |
| |- | | |- |
− | | <code>int16_t getCigarLength()</code> | + | | <code>int16_t SamRecord::getCigarLength()</code> |
| | Returns the length of the CIGAR in BAM format. | | | Returns the length of the CIGAR in BAM format. |
| |- | | |- |
− | | <code>int16_t getFlag()</code> | + | | <code>int16_t SamRecord::getFlag()</code> |
| | Returns the flag. | | | Returns the flag. |
| |- | | |- |
− | | <code>int32_t getReadLength()</code> | + | | <code>int32_t SamRecord::getReadLength()</code> |
| | Returns the length of the read. | | | Returns the length of the read. |
| |- | | |- |
− | | <code>const char* getMateReferenceName(SamFileHeader& header)</code> | + | | <code>const char* SamRecord::getMateReferenceName(SamFileHeader& header)</code> |
| | Returns the mate reference sequence name (SAM format). Returns the mate reference sequence name even if it is the same as the reference sequence name. | | | Returns the mate reference sequence name (SAM format). Returns the mate reference sequence name even if it is the same as the reference sequence name. |
| |- | | |- |
− | | <code>const char* getMateReferenceNameOrEqual(SamFileHeader& header)</code> | + | | <code>const char* SamRecord::getMateReferenceNameOrEqual(SamFileHeader& header)</code> |
| | Returns the mate reference sequence name (SAM format). Returns the mate reference sequence name, unless it is the same as the reference sequence name, then an "=" is returned.. | | | Returns the mate reference sequence name (SAM format). Returns the mate reference sequence name, unless it is the same as the reference sequence name, then an "=" is returned.. |
| |- | | |- |
− | | <code>int32_t getMateReferenceID()</code> | + | | <code>int32_t SamRecord::getMateReferenceID()</code> |
| | Returns the mate reference sequence id (BAM format). | | | Returns the mate reference sequence id (BAM format). |
| |- | | |- |
− | | <code>int32_t get1BasedMatePosition()</code> | + | | <code>int32_t SamRecord::get1BasedMatePosition()</code> |
| | Returns the 1-based (SAM formatted) mate leftmost position. | | | Returns the 1-based (SAM formatted) mate leftmost position. |
| |- | | |- |
− | | <code>int32_t get0BasedMatePosition()</code> | + | | <code>int32_t SamRecord::get0BasedMatePosition()</code> |
| | Returns the 0-based (BAM formatted) mate leftmost position. | | | Returns the 0-based (BAM formatted) mate leftmost position. |
| |- | | |- |
− | | <code>int32_t getInsertSize()</code> | + | | <code>int32_t SamRecord::getInsertSize()</code> |
| | Returns the insert size. | | | Returns the insert size. |
| |- | | |- |
− | | <code>int32_t get0BasedAlignmentEnd()</code> | + | | <code>int32_t SamRecord::get0BasedAlignmentEnd()</code> |
| | Returns the 0-based inclusive right-most position of the clipped sequence. | | | Returns the 0-based inclusive right-most position of the clipped sequence. |
| |- | | |- |
− | | <code>int32_t get1BasedAlignmentEnd()</code> | + | | <code>int32_t SamRecord::get1BasedAlignmentEnd()</code> |
| | Returns the 1-based inclusive right-most position of the clipped sequence. | | | Returns the 1-based inclusive right-most position of the clipped sequence. |
| |- | | |- |
− | | <code>int32_t get0BasedUnclippedStart()</code> | + | | <code>int32_t SamRecord::get0BasedUnclippedStart()</code> |
| | Returns the 0-based inclusive left-most position adjusted for clipped bases. | | | Returns the 0-based inclusive left-most position adjusted for clipped bases. |
| |- | | |- |
− | | <code>int32_t get1BasedUnclippedStart()</code> | + | | <code>int32_t SamRecord::get1BasedUnclippedStart()</code> |
| | Returns the 1-based inclusive left-most position adjusted for clipped bases. | | | Returns the 1-based inclusive left-most position adjusted for clipped bases. |
| |- | | |- |
− | | <code>int32_t get0BasedUnclippedEnd()</code> | + | | <code>int32_t SamRecord::get0BasedUnclippedEnd()</code> |
| | Returns the 0-based inclusive right-most position adjusted for clipped bases. | | | Returns the 0-based inclusive right-most position adjusted for clipped bases. |
| |- | | |- |
− | | <code>int32_t get1BasedUnclippedEnd()</code> | + | | <code>int32_t SamRecord::get1BasedUnclippedEnd()</code> |
| | Returns the 1-based inclusive right-most position adjusted for clipped bases. | | | Returns the 1-based inclusive right-most position adjusted for clipped bases. |
| |- | | |- |
− | | <code>const char* getReadName()</code> | + | | <code>const char* SamRecord::getReadName()</code> |
| | Returns the SAM formatted Read Name (QNAME). | | | Returns the SAM formatted Read Name (QNAME). |
| |- | | |- |
− | | <code>const char* getCigar()</code> | + | | <code>const char* SamRecord::getCigar()</code> |
| | Returns the SAM formatted CIGAR string. | | | Returns the SAM formatted CIGAR string. |
| |- | | |- |
− | | <code>const char* getSequence()</code> | + | | <code>const char* SamRecord::getSequence()</code> |
| | Returns the SAM formatted Sequence string. | | | Returns the SAM formatted Sequence string. |
| |- | | |- |
− | | <code>const char* getQuality()</code> | + | | <code>const char* SamRecord::getQuality()</code> |
| | Returns the SAM formatted Quality string. | | | Returns the SAM formatted Quality string. |
| |- | | |- |
− | | <code>bool getNextSamTag(char* tag, char& vtype, void** value)</code> | + | | <code>bool SamRecord::getNextSamTag(char* tag, char& vtype, void** value)</code> |
| | Returns true if a tag was read, false if there are no more tags. | | | Returns true if a tag was read, false if there are no more tags. |
| For a true return value, tag is sent to the tag of the tag, vtype is set to the vtype of the tag, and value is a pointer to the value of the tag. You will then need to use a switch to cast value to int, double, char, or String. | | For a true return value, tag is sent to the tag of the tag, vtype is set to the vtype of the tag, and value is a pointer to the value of the tag. You will then need to use a switch to cast value to int, double, char, or String. |
| |- | | |- |
− | | <code>bool isIntegerType(char vtype)</code> | + | | <code>bool SamRecord::isIntegerType(char vtype)</code> |
| | Returns true if the passed in vtype is of integer ('c', 'C', 's', 'S', 'i', 'I') type. | | | Returns true if the passed in vtype is of integer ('c', 'C', 's', 'S', 'i', 'I') type. |
| |- | | |- |
− | | <code>bool isDoubleType(char vtype)</code> | + | | <code>bool SamRecord::isDoubleType(char vtype)</code> |
| | Returns true if the passed in vtype is of double ('f') type. | | | Returns true if the passed in vtype is of double ('f') type. |
| |- | | |- |
− | | <code>bool isCharType(char vtype)</code> | + | | <code>bool SamRecord::isCharType(char vtype)</code> |
| | Returns true if the passed in vtype is of char ('A') type. | | | Returns true if the passed in vtype is of char ('A') type. |
| |- | | |- |
− | | <code>bool isStringType(char vtype)</code> | + | | <code>bool SamRecord::isStringType(char vtype)</code> |
| | Returns true if the passed in vtype is of String ('Z') type. | | | Returns true if the passed in vtype is of String ('Z') type. |
| |- | | |- |