Ejemplo n.º 1
0
    
    aas = Constants.addPepsToAADict(300)
    hashedAAs = Constants.hashAAsEpsilonRange(aas, epStep, maxEp)
    
    ambigOpenPenalty = 0
    ambigPenaltyFun = DNS.getAmbigEdgePenaltyFunction(options.minedge, ambigOpenPenalty, options.ambigpenalty)
    ppmPenaltyFun = DNS.getPPMPenaltyFun(options.ppmstd, hashedAAs, options.minedge, options.ppmpenalty, options.ppmsyserror, epStep)
    
    print 'Getting Clusters'
    parent = os.path.abspath(os.pardir)
    clusterSVMModel = svmutil.svm_load_model(parent + paramsDict['Cluster Configuration']['model'])
    clusterSVMRanges = svmutil.load_ranges(parent + os.path.splitext((paramsDict['Cluster Configuration']['model']))[0] + '.range')

    precMassClusters = Analytics.findSamePrecMassClusters(dtaList, ppm=options.ppmstd)
#    print 'precMassClusters', precMassClusters                                                                                                                                                                      
    samePeptideClusters = Analytics.getSamePeptideClusters(precMassClusters, scanFDict, clusterSVMModel, clusterSVMRanges, ppmSTD=options.ppmstd, cutOff=float(paramsDict['Cluster Configuration']['cutoff']))
#    samePeptideClusters = Analytics.getSamePeptideClusters(precMassClusters, scanFDict, clusterSVMModel, clusterSVMRanges, ppmSTD=options.ppmstd, cutOff=4)
#    samePeptideClusters = An.getSamePeptideClusters(precMassClusters, scanFDict, clusterSVMModel, clusterSVMRanges, ppmSTD=options.ppmstd, cutOff=4)

    # To test without any clustering
    #samePeptideClusters = [[scanF] for scanF in scanFDict]
    
    for pairConfigName in paramsDict['Pair Configurations']:
        
        print 'Getting heavy-light pairs for %s' % (pairConfigName,)
        t1 = time.time()

        pairConfig = paramsDict['Pair Configurations'][pairConfigName]
        pairs = Analytics.findDeltaPairsClusters(samePeptideClusters, scanFDict, pairConfig['NMod']+pairConfig['CMod'], ppm=options.ppmstd)
        addEnds = DNS.getSpectrumGraphEndpointInitFunction(pairConfig['NStatic'], pairConfig['CStatic'], paramsDict['Enzyme']['specificity'])
        termModHash = Constants.getTermModHashForPairConfig(pairConfig)
Ejemplo n.º 2
0
    pairs = {}
    times = {}

    t1 = time.time()
    print "Getting Clusters"
    clusterSVMModel = svmutil.svm_load_model(paramsDict["Cluster Configuration"]["model"])
    clusterSVMRanges = svmutil.load_ranges(
        os.path.splitext((paramsDict["Cluster Configuration"]["model"]))[0] + ".range"
    )

    precMassClusters = An.findSamePrecMassClusters(dtaList, ppm=options.ppmstd)
    #    print 'precMassClusters', precMassClusters
    samePeptideClusters = An.getSamePeptideClusters(
        precMassClusters,
        scanFDict,
        clusterSVMModel,
        clusterSVMRanges,
        ppmSTD=options.ppmstd,
        cutOff=float(paramsDict["Cluster Configuration"]["cutoff"]),
    )
    #    samePeptideClusters = An.getSamePeptideClusters(precMassClusters, scanFDict, clusterSVMModel, clusterSVMRanges, ppmSTD=options.ppmstd, cutOff=4)
    outFile.write("\n%i Clusters Found. Time taken: %f\n" % (len(samePeptideClusters), time.time() - t1))
    trueClusters = An.getTrueClusters(
        processedInfo[progName], dbDict["infoMap"], progDict, progName=progName, isComp=False, ppm=options.ppmstd
    )
    """
    clusteredScanFs = set()
    nonUniqueClusteredScanFs = []
    for cluster in trueClusters:
        if len(cluster & clusteredScanFs) > 0:
            print 'ERROR: Duplicate ScanFs in true clusters at cluster', cluster
        clusteredScanFs = clusteredScanFs | cluster