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
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._id readGroup.created = self._creationTime readGroup.updated = self._updateTime readGroup.datasetId = None readGroup.description = None readGroup.experiment = None readGroup.info = {} readGroup.name = readGroup.id readGroup.predictedInsertSize = None readGroup.programs = [] readGroup.referenceSetId = None readGroup.sampleId = None return readGroup
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.dataset_id = dataset.getId() readGroup.name = self.getLocalId() readGroup.predicted_insert_size = pb.int(self.getPredictedInsertSize()) referenceSet = self._parentContainer.getReferenceSet() readGroup.sample_name = pb.string(self.getSampleName()) readGroup.bio_sample_id = pb.string(self.getBioSampleId()) if referenceSet is not None: readGroup.reference_set_id = referenceSet.getId() readGroup.stats.CopyFrom(self.getStats()) readGroup.programs.extend(self.getPrograms()) readGroup.description = pb.string(self.getDescription()) readGroup.experiment.CopyFrom(self.getExperiment()) return readGroup