Exemple #1
0
 def count(self, interval):
     ref, start, end = parse_interval(interval)        
     assert ref in self.hdf_group
     group_attrs = self.hdf_group._v_attrs        
     ca = self.hdf_group._f_getChild(ref)
     return np.sum(ca[start:end]) / float(group_attrs.read_length)
Exemple #2
0
 def rpkm(self, interval):
     ref, start, end = parse_interval(interval)        
     assert ref in self.hdf_group
     group_attrs = self.hdf_group._v_attrs        
     ca = self.hdf_group._f_getChild(ref)
     return np.sum(ca[start:end]) * (1.0e9 / (group_attrs.reads * group_attrs.read_length * (end - start)))
Exemple #3
0
 def coverage(self, interval, norm=True):
     ref, start, end = parse_interval(interval)
     assert ref in self.hdf_group
     norm_length = max(self.get_fragment_length(), self.get_read_length())        
     ca = self.hdf_group._f_getChild(ref)
     return ca[start:end] * (1.0e6 / (self.get_mapped_reads() * norm_length))