本文整理汇总了Python中pysam.Samfile.seek方法的典型用法代码示例。如果您正苦于以下问题:Python Samfile.seek方法的具体用法?Python Samfile.seek怎么用?Python Samfile.seek使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysam.Samfile
的用法示例。
在下文中一共展示了Samfile.seek方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _BamReaderBase
# 需要导入模块: from pysam import Samfile [as 别名]
# 或者: from pysam.Samfile import seek [as 别名]
#.........这里部分代码省略.........
def sequencingChemistry(self):
"""
List of the sequencing chemistries by movie. Order is
unspecified.
"""
return list(self.readGroupTable.SequencingChemistry)
#TODO: elide "Info" innames?
@property
def referenceInfoTable(self):
return self._referenceInfoTable
#TODO: standard? how about subread instead? why capitalize ccs?
# can we standardize this? is cDNA an additional possibility
@property
def readType(self):
"""
Either "standard", "CCS", "mixed", or "unknown", to represent the
type of PacBio reads aligned in this BAM file.
"""
readTypes = self.readGroupTable.ReadType
if all(readTypes == "SUBREAD"):
return "standard"
elif all(readTypes == "CCS"):
return "CCS"
elif all((readTypes == "CCS") | (readTypes == "SUBREAD")):
return "mixed"
else:
return "unknown"
#TODO: Marcus needs to put something in the spec for this
@property
def version(self):
raise Unimplemented()
#TODO: Marcus needs to put something in the spec for this
def versionAtLeast(self, minimalVersion):
raise Unimplemented()
def softwareVersion(self, programName):
raise Unimplemented()
@property
def isSorted(self):
return True
@property
def isBarcoded(self):
raise Unimplemented()
@property
def isEmpty(self):
return (len(self) == 0)
# TODO: make this private in cmp.h5 reader
def alignmentGroup(self, alnGroupId):
raise UnavailableFeature("BAM has no HDF5 groups")
def referenceInfo(self, key):
return self._referenceDict[key]
def atOffset(self, offset):
self.peer.seek(offset)
return BamAlignment(self, next(self.peer))
def hasPulseFeature(self, featureName):
return featureName in self._pulseFeaturesAvailable
def pulseFeaturesAvailable(self):
return self._pulseFeaturesAvailable
@property
def barcode(self):
raise Unimplemented()
@property
def barcodeName(self):
raise Unimplemented()
@property
def barcodes(self):
raise Unimplemented()
def __repr__(self):
return "<%s for %s>" % (type(self).__name__, self.filename)
def __len__(self):
return self.peer.mapped
def close(self):
if hasattr(self, "file") and self.file is not None:
self.file.close()
self.file = None
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.close()
示例2: _BamReaderBase
# 需要导入模块: from pysam import Samfile [as 别名]
# 或者: from pysam.Samfile import seek [as 别名]
#.........这里部分代码省略.........
return set([mi.MovieName for mi in self.readGroupTable])
@property
def readGroupTable(self):
return self._readGroupTable
def readGroupInfo(self, readGroupId):
return self._readGroupDict[readGroupId]
@property
def sequencingChemistry(self):
"""
List of the sequencing chemistries by movie. Order is
unspecified.
"""
return list(self.readGroupTable.SequencingChemistry)
@property
def referenceInfoTable(self):
return self._referenceInfoTable
#TODO: standard? how about subread instead? why capitalize ccs?
# can we standardize this? is cDNA an additional possibility
@property
def readType(self):
"""
Either "standard", "CCS", "mixed", or "unknown", to represent the
type of PacBio reads aligned in this BAM file.
"""
readTypes = self.readGroupTable.ReadType
if all(readTypes == "SUBREAD"):
return "standard"
elif all(readTypes == "CCS"):
return "CCS"
elif all((readTypes == "CCS") | (readTypes == "SUBREAD")):
return "mixed"
else:
return "unknown"
@property
def version(self):
return self.peer.header["HD"]["pb"]
def versionAtLeast(self, minimalVersion):
raise Unimplemented()
def softwareVersion(self, programName):
raise Unimplemented()
@property
def isSorted(self):
return self.peer.header["HD"]["SO"] == "coordinate"
@property
def isBarcoded(self):
raise Unimplemented()
@property
def isEmpty(self):
return (len(self) == 0)
def referenceInfo(self, key):
return self._referenceDict[key]
def atOffset(self, offset):
self.peer.seek(offset)
return BamAlignment(self, next(self.peer))
def hasPulseFeature(self, featureName):
return featureName in self._pulseFeaturesAvailable
def pulseFeaturesAvailable(self):
return self._pulseFeaturesAvailable
@property
def barcode(self):
raise Unimplemented()
@property
def barcodeName(self):
raise Unimplemented()
@property
def barcodes(self):
raise Unimplemented()
@requiresBai
def __len__(self):
return self.peer.mapped + self.peer.unmapped
def close(self):
if hasattr(self, "file") and self.file is not None:
self.file.close()
self.file = None
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
self.close()