Пример #1
0
def updateTrackInfoToVersion15(genome, trackName):
    "genome trackName"
    if isinstance(trackName, str):
        trackName = qcf.convertTNstrToTNListFormat(trackName)

    ti = TrackInfo(genome, trackName)
    ti.preProcOverlapRules = []
    trackFormatList = []
    for allowOverlaps in [True, False]:
        from gold.origdata.PreProcessUtils import PreProcessUtils
        if PreProcessUtils.preProcFilesExist(genome, trackName, allowOverlaps):
            ti.preProcOverlapRules.append(allowOverlaps)
            if PreProcessUtils.mergedPreProcFilesExist(genome, trackName, allowOverlaps):
                mergedPrefixInfoDict = PreProcessUtils.getMergedPrefixInfoDict(genome, trackName, allowOverlaps)
                ti.mergedPrefixInfoDictPerOverlapRule[allowOverlaps] = mergedPrefixInfoDict
                trackFormatList.append(TrackFormat.createInstanceFromPrefixInfoDict(mergedPrefixInfoDict))
    if trackFormatList:
        ti.trackFormatHash = hash(tuple(trackFormatList))
    if not ti.geSourceVersion:
        ti.geSourceVersion = ti.preProcVersion
    ti.preProcVersion = '1.5'
    origPath = qcf.createOrigPath(genome, trackName)
    if os.path.exists(origPath):
        ti.id = ti.constructIdFromPath(genome, qcf.createOrigPath(genome, trackName), ti.geSourceVersion, ti.preProcVersion)
    print ti.id, ti.preProcOverlapRules, ti.mergedPrefixInfoDictPerOverlapRule, ti.trackFormatHash, ti.geSourceVersion, ti.preProcVersion
    ti.store()
    print Track(trackName).getUniqueKey(genome)
 def _calcTrackFormatHash(mergedPrefixInfoDictPerOverlapRule):
     trackFormatList = []
     for allowOverlaps in mergedPrefixInfoDictPerOverlapRule.keys():
         mergedPrefixInfoDict = mergedPrefixInfoDictPerOverlapRule[
             allowOverlaps]
         trackFormatList.append(
             TrackFormat.createInstanceFromPrefixInfoDict(
                 mergedPrefixInfoDict))
     trackFormatHash = hash(tuple(trackFormatList))
     return trackFormatHash