pairConfigName = pairConfigurations.keys()[0] dtaList = glob.glob(options.dtadir + '/*.dta') scanFDict = SDTDV.getScanFDict(dtaList) if options.sequest: SEQUESTMASCOTResults = DataFile.indexDataByKey(DataFile.getScanInfo(options.sequest, delimiter='\t')) else: SEQUESTMASCOTResults = {} outFile = open(options.output, 'w') # rankModel = loadRankingModel(options.discmodel) # linearDiscVec = np.loadtxt(options.discmodel) svmModel = svmutil.svm_load_model(options.discmodel) svmRange = svmutil.load_ranges(os.path.splitext(options.discmodel)[0] + '.range') """ cols = ['ScanF', 'M+H', 'PEAKS ALC', 'PEAKS TLC', 'PEAKS Sequence', 'SEQUEST XCorr', 'MASCOT Ion Score', 'SEQUEST MASCOT Sequence', 'Accuracy', 'Precision'] outFile.write('\t'.join([col for col in cols]) + '\n') PEAKSInfo = DataFile.indexDataByKey(DataFile.getScanInfo(options.lads, delimiter='\t'), key='ScanF') for scan in PEAKSInfo: if scan not in SEQUESTMASCOTResults: continue scanData = {'ScanF': scan} scanData['M+H'] = scanFDict[scan]['precMass'] scanData['PEAKS ALC'] = PEAKSInfo[scan]['ALC (%)'] scanData['PEAKS TLC'] = PEAKSInfo[scan]['TLC'] scanData['PEAKS Sequence'] = PEAKSInfo[scan]['Peptide']
PNet = PN.ProbNetwork(options.config, options.model) dtaList = glob.glob(options.dtadir + '/*.dta') scanFDict = getScanFDict(dtaList) 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()
dbDict["infoMap"], progDict, paramsDict["Pair Configurations"][pairConfigName], progName=progName, isComp=False, ppm=options.ppmstd, ) 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(