示例#1
0
 def getStats(self):
     """
     Returns the GA4GH protocol representation of this read group set's
     ReadStats.
     """
     stats = protocol.ReadStats()
     stats.aligned_read_count = self._numAlignedReads
     stats.unaligned_read_count = self._numUnalignedReads
     return stats
示例#2
0
 def getStats(self):
     """
     Returns the GA4GH protocol representation of this read group's
     ReadStats.
     """
     stats = protocol.ReadStats()
     stats.aligned_read_count = self.getNumAlignedReads()
     stats.unaligned_read_count = self.getNumUnalignedReads()
     # TODO base_count requires iterating through all reads
     return stats
示例#3
0
文件: reads.py 项目: snehitp/server
 def toProtocolElement(self):
     """
     Returns the GA4GH protocol representation of this ReadGroup.
     """
     # TODO this is very incomplete, but we don't have the
     # implementation to fill out the rest of the fields currently
     readGroup = protocol.ReadGroup()
     readGroup.id = self.getId()
     readGroup.created = self._creationTime
     readGroup.updated = self._updateTime
     dataset = self.getParentContainer().getParentContainer()
     readGroup.datasetId = dataset.getId()
     readGroup.description = None
     readGroup.info = {}
     readGroup.name = self.getLocalId()
     readGroup.predictedInsertSize = self.getPredictedInsertSize()
     readGroup.programs = []
     referenceSet = self._parentContainer.getReferenceSet()
     readGroup.referenceSetId = None
     readGroup.sampleId = self.getSampleId()
     if referenceSet is not None:
         readGroup.referenceSetId = referenceSet.getId()
     stats = protocol.ReadStats()
     stats.alignedReadCount = self.getNumAlignedReads()
     stats.unalignedReadCount = self.getNumUnalignedReads()
     stats.baseCount = None  # TODO requires iterating through all reads
     readGroup.stats = stats
     readGroup.programs = self.getPrograms()
     readGroup.description = self.getDescription()
     experiment = protocol.Experiment()
     experiment.id = self.getExperimentId()
     experiment.instrumentModel = self.getInstrumentModel()
     experiment.sequencingCenter = self.getSequencingCenter()
     experiment.description = self.getExperimentDescription()
     experiment.info = {}
     experiment.instrumentDataFile = None
     experiment.library = self.getLibrary()
     experiment.libraryLayout = None
     experiment.molecule = None
     experiment.name = None
     experiment.platformUnit = self.getPlatformUnit()
     experiment.recordCreateTime = self._iso8601
     experiment.recordUpdateTime = self._iso8601
     experiment.runTime = self.getRunTime()
     experiment.selection = None
     experiment.strategy = None
     readGroup.experiment = experiment
     return readGroup
示例#4
0
 def toProtocolElement(self):
     """
     Returns the GA4GH protocol representation of this ReadGroupSet.
     """
     readGroupSet = protocol.ReadGroupSet()
     readGroupSet.id = self.getId()
     readGroupSet.readGroups = [
         readGroup.toProtocolElement()
         for readGroup in self.getReadGroups()]
     readGroupSet.name = self.getLocalId()
     readGroupSet.datasetId = self.getParentContainer().getId()
     stats = protocol.ReadStats()
     stats.alignedReadCount = self.getNumAlignedReads()
     stats.unalignedReadCount = self.getNumUnalignedReads()
     readGroupSet.stats = stats
     return readGroupSet