Line 86: |
Line 86: |
| | Tell the class which reference ID should be read from the BAM file. This is the index into the BAM Index list of reference information: 0 - #references. The records for that reference id will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified reference id, <code>ReadRecord</code> will return false until a new read section is set. | | | Tell the class which reference ID should be read from the BAM file. This is the index into the BAM Index list of reference information: 0 - #references. The records for that reference id will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified reference id, <code>ReadRecord</code> will return false until a new read section is set. |
| Pass in -1 in order to read the section of the bam file not associated with any reference ID. | | Pass in -1 in order to read the section of the bam file not associated with any reference ID. |
| + | |
| + | Must be called after <code>ReadHeader</code>. |
| | | |
| Returns true if the read section was successfully set, false if not. False is returned if the BAM Index File has not yet been read or if a BAM file is not open for reading. | | Returns true if the read section was successfully set, false if not. False is returned if the BAM Index File has not yet been read or if a BAM file is not open for reading. |
Line 92: |
Line 94: |
| | Tell the class which reference name should be read from the BAM file. The specified name will be mapped to the index into the BAM Index list of reference information: 0 - #references. The records for that reference name will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified reference name, <code>ReadRecord</code> will return false until a new read section is set. | | | Tell the class which reference name should be read from the BAM file. The specified name will be mapped to the index into the BAM Index list of reference information: 0 - #references. The records for that reference name will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified reference name, <code>ReadRecord</code> will return false until a new read section is set. |
| Pass in -1 in order to read the section of the bam file not associated with any reference ID. | | Pass in -1 in order to read the section of the bam file not associated with any reference ID. |
| + | |
| + | Must be called after <code>ReadHeader</code>. |
| | | |
| Returns true if the read section was successfully set, false if not. False is returned if the BAM Index File has not yet been read or if a BAM file is not open for reading. | | Returns true if the read section was successfully set, false if not. False is returned if the BAM Index File has not yet been read or if a BAM file is not open for reading. |
Line 97: |
Line 101: |
| | <code>bool SamFile::SetReadSection(int32_t refID, int32_t start, int32_t end)</code> | | | <code>bool SamFile::SetReadSection(int32_t refID, int32_t start, int32_t end)</code> |
| | Sets what part of the BAM file should be read. Fails if this is not a BAM file &/or the index file has not yet been read. This version will set it to only read a specific reference id and start(inclusive)/end(exclusive) region. The records for this section will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified section, ReadRecord will return failure until a new read section is set. | | | Sets what part of the BAM file should be read. Fails if this is not a BAM file &/or the index file has not yet been read. This version will set it to only read a specific reference id and start(inclusive)/end(exclusive) region. The records for this section will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified section, ReadRecord will return failure until a new read section is set. |
| + | |
| + | Must be called after <code>ReadHeader</code>. |
| | | |
| Return Value: true = success; false = failure. | | Return Value: true = success; false = failure. |
Line 102: |
Line 108: |
| | <code>bool SamFile::SetReadSection(const char* refName, int32_t start, int32_t end)</code> | | | <code>bool SamFile::SetReadSection(const char* refName, int32_t start, int32_t end)</code> |
| | Sets what part of the BAM file should be read. Fails if this is not a BAM file &/or the index file has not yet been read. This version will set it to only read a specific reference name and start(inclusive)/end(exclusive) region. The records for this section will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified section, ReadRecord will return failure until a new read section is set. | | | Sets what part of the BAM file should be read. Fails if this is not a BAM file &/or the index file has not yet been read. This version will set it to only read a specific reference name and start(inclusive)/end(exclusive) region. The records for this section will be retrieved on each <code>ReadRecord</code> call. When all records have been retrieved for the specified section, ReadRecord will return failure until a new read section is set. |
| + | |
| + | Must be called after <code>ReadHeader</code>. |
| | | |
| Return Value: true = success; false = failure. | | Return Value: true = success; false = failure. |