Back to index

python-biopython  1.60
Functions
Bio.NMR.NOEtools Namespace Reference

Functions

def predictNOE
def _data_map
def _col_ave

Function Documentation

def Bio.NMR.NOEtools._col_ave (   list,
  col 
) [private]

Definition at line 66 of file NOEtools.py.

00066 
00067 def _col_ave(list,col):
00068 # Compute average values from a particular column in a string list
00069   total=0
00070   n=0
00071   for element in list:
00072     total += float(element.split()[col])
00073     n += 1
00074   return total/n

Here is the caller graph for this function:

def Bio.NMR.NOEtools._data_map (   labelline) [private]

Definition at line 53 of file NOEtools.py.

00053 
00054 def _data_map(labelline):
00055 # Generate a map between datalabels and column number
00056 #   based on a labelline
00057   i=0 # A counter
00058   datamap={} # The data map dictionary
00059   labelList=labelline.split() # Get the label line
00060 
00061   # Get the column number for each label
00062   for i in range(len(labelList)):
00063     datamap[labelList[i]] = i
00064 
00065   return datamap

Here is the caller graph for this function:

def Bio.NMR.NOEtools.predictNOE (   peaklist,
  originNuc,
  detectedNuc,
  originResNum,
  toResNum 
)

Definition at line 11 of file NOEtools.py.

00011 
00012 def predictNOE(peaklist,originNuc,detectedNuc,originResNum,toResNum):
00013 # Predict the i->j NOE position based on self peak (diagonal) assignments
00014 # 
00015 # example predictNOE(peaklist,"N15","H1",10,12)
00016 #    where peaklist is of the type xpktools.peaklist
00017 #    would generate a .xpk file entry for a crosspeak
00018 #    that originated on N15 of residue 10 and ended up
00019 #    as magnetization detected on the H1 nucleus of
00020 #    residue 12.
00021 # CAVEAT: The initial peaklist is assumed to be diagonal (self peaks only)
00022 #       and currently there is not checking done to insure that this
00023 #       assumption holds true.  Check your peaklist for errors and
00024 #       off diagonal peaks before attempting to use predictNOE.
00025 
00026   returnLine = "" # The modified line to be returned to the caller
00027 
00028   datamap = _data_map(peaklist.datalabels)
00029 
00030   # Construct labels for keying into dictionary
00031   originAssCol = datamap[originNuc+".L"]+1
00032   originPPMCol = datamap[originNuc+".P"]+1
00033   detectedPPMCol = datamap[detectedNuc+".P"]+1
00034 
00035   # Make a list of the data lines involving the detected
00036   if str(toResNum) in peaklist.residue_dict(detectedNuc) \
00037   and str(originResNum) in peaklist.residue_dict(detectedNuc):
00038     detectedList=peaklist.residue_dict(detectedNuc)[str(toResNum)]
00039     originList=peaklist.residue_dict(detectedNuc)[str(originResNum)]
00040     returnLine=detectedList[0]
00041 
00042     for line in detectedList:
00043 
00044       aveDetectedPPM = _col_ave(detectedList,detectedPPMCol)
00045       aveOriginPPM = _col_ave(originList,originPPMCol)
00046       originAss = originList[0].split()[originAssCol]
00047 
00048     returnLine=xpktools.replace_entry(returnLine,originAssCol+1,originAss)
00049     returnLine=xpktools.replace_entry(returnLine,originPPMCol+1,aveOriginPPM)
00050 
00051   return returnLine
00052 

Here is the call graph for this function: