Changes

From Genome Analysis Wiki
Jump to navigationJump to search
378 bytes added ,  08:19, 11 August 2010
no edit summary
Line 100: Line 100:  
|-
 
|-
 
| <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 0-based 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.
 
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.
   Line 108: 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 0-based 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.
 
Pass in "" or "*" in order to read the section of the bam file not associated with any reference name.
 
Pass in "" or "*" in order to read the section of the bam file not associated with any reference name.
   Line 114: Line 114:     
Return Value: true = success; false = failure.
 
Return Value: true = success; false = failure.
 +
|-
 +
| <code>uint32_t SamFile::GetNumOverlaps(SamRecord& samRecord)</code>
 +
| Returns the number of bases in the passed in read that overlap the region that is currently set for this file.
 +
| Overlapping means that the bases occur in both the read and the reference as either matches or mismatches.  This does not count insertions, deletions, clips, pads, or skips.
 
|}
 
|}
  

Navigation menu