Trees | Indices | Help |
---|
|
1 # NOEtools.py: A python module for predicting NOE coordinates from 2 # assignment data. 3 # 4 # The input and output are modelled on nmrview peaklists. 5 # This modules is suitable for directly generating an nmrview 6 # peaklist with predicted crosspeaks directly from the 7 # input assignment peaklist. 8 9 import xpktools 1012 # Predict the i->j NOE position based on self peak (diagonal) assignments 13 # 14 # example predictNOE(peaklist,"N15","H1",10,12) 15 # where peaklist is of the type xpktools.peaklist 16 # would generate a .xpk file entry for a crosspeak 17 # that originated on N15 of residue 10 and ended up 18 # as magnetization detected on the H1 nucleus of 19 # residue 12. 20 # CAVEAT: The initial peaklist is assumed to be diagonal (self peaks only) 21 # and currently there is not checking done to insure that this 22 # assumption holds true. Check your peaklist for errors and 23 # off diagonal peaks before attempting to use predictNOE. 24 25 returnLine="" # The modified line to be returned to the caller 26 27 datamap=_data_map(peaklist.datalabels) 28 29 # Construct labels for keying into dictionary 30 originAssCol = datamap[originNuc+".L"]+1 31 originPPMCol = datamap[originNuc+".P"]+1 32 detectedPPMCol = datamap[detectedNuc+".P"]+1 33 34 # Make a list of the data lines involving the detected 35 if str(toResNum) in peaklist.residue_dict(detectedNuc) \ 36 and str(originResNum) in peaklist.residue_dict(detectedNuc): 37 detectedList=peaklist.residue_dict(detectedNuc)[str(toResNum)] 38 originList=peaklist.residue_dict(detectedNuc)[str(originResNum)] 39 returnLine=detectedList[0] 40 41 for line in detectedList: 42 43 aveDetectedPPM =_col_ave(detectedList,detectedPPMCol) 44 aveOriginPPM =_col_ave(originList,originPPMCol) 45 originAss =originList[0].split()[originAssCol] 46 47 returnLine=xpktools.replace_entry(returnLine,originAssCol+1,originAss) 48 returnLine=xpktools.replace_entry(returnLine,originPPMCol+1,aveOriginPPM) 49 50 return returnLine51 5254 # Generate a map between datalabels and column number 55 # based on a labelline 56 i=0 # A counter 57 datamap={} # The data map dictionary 58 labelList=labelline.split() # Get the label line 59 60 # Get the column number for each label 61 for i in range(len(labelList)): 62 datamap[labelList[i]]=i 63 64 return datamap65 73
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun May 3 15:54:04 2009 | http://epydoc.sourceforge.net |