Clarify documentation of index statistics with CRAM files
For .crai indexes, hts_idx_get_stat() and hts_idx_get_n_no_coor()
return 0 as these indexes don't record these statistics. Mention
this in the documentation for the `AlignmentFile` methods that
use these routines. Clarifies and
@@ -1760,6 +1760,8 @@ cdef class AlignmentFile(HTSFile):
"""int with total number of mapped alignments according to the
statistics recorded in the index. This is a read-only
attribute.
+ (This will be 0 for a CRAM file indexed by a .crai index, as that
+ index format does not record these statistics.)
"""
def __get__(self):
self.check_index()
@@ -1776,6 +1778,8 @@ cdef class AlignmentFile(HTSFile):
"""int with total number of unmapped reads according to the statistics
recorded in the index. This number of reads includes the number of reads
without coordinates. This is a read-only attribute.
+ (This will be 0 for a CRAM file indexed by a .crai index, as that
+ index format does not record these statistics.)
"""
def __get__(self):
self.check_index()
@@ -1792,6 +1796,8 @@ cdef class AlignmentFile(HTSFile):
"""int with total number of reads without coordinates according to the
statistics recorded in the index, i.e., the statistic printed for "*"
by the ``samtools idxstats`` command. This is a read-only attribute.
+ (This will be 0 for a CRAM file indexed by a .crai index, as that
+ index format does not record these statistics.)
"""
def __get__(self):
self.check_index()
@@ -1805,6 +1811,9 @@ cdef class AlignmentFile(HTSFile):
they are stored in the index, similarly to the statistics printed
by the ``samtools idxstats`` command.
+ CRAI indexes do not record these statistics, so for a CRAM file
+ with a .crai index the returned statistics will all be 0.
+
Returns:
list :
a list of records for each chromosome. Each record has the
