diff options
author | Justin Lecher <jlec@gentoo.org> | 2011-10-07 19:23:04 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2011-10-07 19:23:04 +0000 |
commit | a982162f6dfde1416b60d72b99d3fdceed30bfcd (patch) | |
tree | 0494a75cfc84dac4246586d512fd19ae15be8ff2 /sci-chemistry/aria/files | |
parent | Add calendar to mimetype and categories, reuse emid in ebuild logic (diff) | |
download | historical-a982162f6dfde1416b60d72b99d3fdceed30bfcd.tar.gz historical-a982162f6dfde1416b60d72b99d3fdceed30bfcd.tar.bz2 historical-a982162f6dfde1416b60d72b99d3fdceed30bfcd.zip |
Add patches for newer ccpn data model, kindly provided by Tim Stevens
Package-Manager: portage-2.2.0_alpha62/cvs/Linux x86_64
Diffstat (limited to 'sci-chemistry/aria/files')
-rw-r--r-- | sci-chemistry/aria/files/aria-2.3.2-through-space.patch | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/sci-chemistry/aria/files/aria-2.3.2-through-space.patch b/sci-chemistry/aria/files/aria-2.3.2-through-space.patch new file mode 100644 index 000000000000..bda76aa11c80 --- /dev/null +++ b/sci-chemistry/aria/files/aria-2.3.2-through-space.patch @@ -0,0 +1,118 @@ + src/py/aria/exportToCcpn.py | 24 +++++++++++------------- + src/py/aria/importFromCcpn.py | 25 +++++++------------------ + 2 files changed, 18 insertions(+), 31 deletions(-) + +diff --git a/src/py/aria/exportToCcpn.py b/src/py/aria/exportToCcpn.py +index c742a88..aae7b7d 100644 +--- a/src/py/aria/exportToCcpn.py ++++ b/src/py/aria/exportToCcpn.py +@@ -1,5 +1,5 @@ + from ccpnmr.analysis.core.ConstraintBasic import makeNmrConstraintStore, makeStructureGeneration, getFixedResonance +-from ccpnmr.analysis.core.ExperimentBasic import getOnebondDataDims ++from ccpnmr.analysis.core.ExperimentBasic import getOnebondDataDims, getThroughSpaceDataDims + from ccpnmr.analysis.core.AssignmentBasic import assignAtomsToRes, assignResToDim + from ccpnmr.analysis.core.PeakBasic import pickPeak, setManualPeakIntensity + from ccpnmr.analysis.core.MoleculeBasic import DEFAULT_ISOTOPES +@@ -791,12 +791,13 @@ def getPeakAssignmentsFromAria2(project, ariaRestraints, namesDict=None, + ariaDims = ariaDimDict.get(spectrum) + if not ariaDims: + ariaDims = [] #[0,1,2] ++ throughSpaceDataDims = getThroughSpaceDataDims(spectrum) + + dataDims = spectrum.sortedDataDims() + if len(dataDims) == 3: + for dataDim in dataDims: + expDimRef = dataDim.findFirstDataDimRef().expDimRef +- if '1H' in expDimRef.isotopeCodes: # 0 or 2 ++ if dataDim in throughSpaceDataDims: # 0 or 2 + if onebondDims.get(dataDim.dim): + if ppmX1 is None: + ariaDims.append(2) +@@ -816,21 +817,18 @@ def getPeakAssignmentsFromAria2(project, ariaRestraints, namesDict=None, + ariaDims.append(1) + + else: +- transfer = spectrum.experiment.findFirstExpTransfer(transferType='through-space') or \ +- spectrum.experiment.findFirstExpTransfer(transferType='NOESY') + ++ i = 0 + for dataDim in dataDims: +- expDimRefs = [dataDimRef.expDimRef for dataDimRef in dataDim.dataDimRefs] +- i = 0 +- for expDimRef in transfer.sortedExpDimRefs(): +- if expDimRef in expDimRefs: +- ariaDims.append(i) +- boundDim = onebondDims.get(dataDim.dim) +- if boundDim: +- ariaDims.append(i+1) +- ++ if dataDim in throughSpaceDataDims: ++ ariaDims.append(i) ++ boundDim = onebondDims.get(dataDim.dim) ++ if boundDim: ++ ariaDims.append(i+1) ++ + i += 2 + ++ + ariaDimDict[spectrum] = ariaDims + + if namesDict: +diff --git a/src/py/aria/importFromCcpn.py b/src/py/aria/importFromCcpn.py +index a65ae3e..91ad123 100644 +--- a/src/py/aria/importFromCcpn.py ++++ b/src/py/aria/importFromCcpn.py +@@ -196,19 +196,10 @@ def getNoesyPeakLists(project, molSystem=None): + + for spectrum in experiment.dataSources: + if (spectrum.dataType == 'processed') and (spectrum.numDim > 1): +- +- isotopes = [] +- for dataDim in spectrum.dataDims: +- for expDimRef in dataDim.expDim.expDimRefs: +- if expDimRef.measurementType in ('shift','Shift'): +- isotope = ','.join(expDimRef.isotopeCodes) +- isotopes.append(isotope) +- break +- +- if isotopes.count('1H') > 1: +- for peakList in spectrum.peakLists: +- if peakList.findFirstPeak(): +- peakLists.append(peakList) ++ for peakList in spectrum.sortedPeakLists(): ++ if excludeSimulated and peakList.isSimulated: ++ continue ++ peakLists.append(peakList) + + + return peakLists +@@ -952,8 +943,6 @@ def makeAriaSpectrum(peakList, ariaMolecule, filterRejected=True): + expDimRefDict = {} + + for expDimRef in transfer.sortedExpDimRefs(): +- if expDimRef.isotopeCodes != ('1H',): +- raise Exception('Not an H-H experiment') + + onebondTransfer = expDimRef.findFirstExpTransfer(transferType='onebond') + +@@ -1095,7 +1084,7 @@ def getAriaAtomsFromResonance(resonance, ariaMolecule, cache={}): + + # TJS modify to return just a list of atoms, rather than a list of list + ariaAtoms = [] +- for atom in atomSet.sortedAtoms(): ++ for atom in atomSet.atoms: + ariaAtom = ariaResidue.atoms.get(atom.name) + if not ariaAtom: + messager.warning('Could not find ARIA Atom for CCPN atom %d%s %s' % (residue.seqCode,residue.ccpCode, atom.name)) +@@ -1256,9 +1245,9 @@ def getAriaDistanceRestraintsList(constraint_list, constraint_type, aria_mol): + restraint.setWeight(weight) + + +- for constrItem in distConstr.sortedItems(): ++ for constrItem in distConstr.items: + +- reso1, reso2 = constrItem.sortedResonances() ++ reso1, reso2 = constrItem.resonances + + # TJS fix for mapping prochirals + # always use real resonnances where possible |