예제 #1
0
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)
예제 #2
0
    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)
예제 #3
0
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)
예제 #4
0
파일: 3054.py 프로젝트: gtrack/gtrackcore
 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
예제 #6
0
 def _getTrackView(self, trackName, region, allowOverlaps):
     track = Track(trackName)
     track.addFormatReq(TrackFormatReq(allowOverlaps=allowOverlaps))
     return track.getTrackView(region)
예제 #7
0
 def _getTrack(self):
     track = Track(self._trackName)
     track.addFormatReq(TrackFormatReq(allowOverlaps=self._allowOverlaps))
     return track