def createTrackContentFromFile(genome, path, allowOverlaps): # TODO fix # trackName = trackName.split(':') # NOT SYSTEM safe!! Fix this later! trackName = path.split("/")[-1] trackName = trackName.split(".")[0] importTrackIntoGTrack(trackName, genome, path) track = Track(trackName.split(":")) # We do not want to set this.. track.addFormatReq(TrackFormatReq(allowOverlaps=False, borderHandling="crop")) trackViewList = OrderedDict() for region in genome.regions: try: trackViewList[region] = track.getTrackView(region) except OSError: # There can be regions that the track does not cover.. # This is a temp fix.. should be bare of the api pass return TrackContents(genome, trackViewList)
def _createTrackContent(self, trackName, allowOverlaps): trackName = trackName.split(':') track = Track(trackName) track.addFormatReq(TrackFormatReq(allowOverlaps=allowOverlaps, borderHandling='crop')) trackViewList = OrderedDict() print self.hg18 print(type(self.hg18)) for region in self.hg18: print(region) print(type(region)) trackViewList[region] = track.getTrackView(region) return TrackContents('hg18', trackViewList)
def extractTrackFromGTrackCore(genome, trackName): """ Extract a track from GTracCore :param genome: :param trackName: :return: """ trackName = trackName.split(".")[0] track = Track(trackName.split(":")) trackViewList = OrderedDict() for region in genome.regions: try: trackViewList[region] = track.getTrackView(region) except OSError: # There can be regions that the track does not cover.. # This is a temp fix.. should be bare of the api pass return TrackContents(genome, trackViewList)
def _getTrackView(self, trackName, region, allowOverlaps): track = Track(trackName) track.addFormatReq(TrackFormatReq(allowOverlaps=allowOverlaps)) return track.getTrackView(region)
def _getTrack(self): track = Track(self._trackName) track.addFormatReq(TrackFormatReq(allowOverlaps=self._allowOverlaps)) return track