summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2011-10-07 19:23:04 +0000
committerJustin Lecher <jlec@gentoo.org>2011-10-07 19:23:04 +0000
commit23dd6d41cf93b069a75b5f84c01447519896f670 (patch)
tree3883cd2eba6f18320cc6959b94bb5ef72abd0082 /sci-chemistry/aria
parentAdd calendar to mimetype and categories, reuse emid in ebuild logic (diff)
downloadgentoo-2-23dd6d41cf93b069a75b5f84c01447519896f670.tar.gz
gentoo-2-23dd6d41cf93b069a75b5f84c01447519896f670.tar.bz2
gentoo-2-23dd6d41cf93b069a75b5f84c01447519896f670.zip
Add patches for newer ccpn data model, kindly provided by Tim Stevens
(Portage version: 2.2.0_alpha62/cvs/Linux x86_64)
Diffstat (limited to 'sci-chemistry/aria')
-rw-r--r--sci-chemistry/aria/ChangeLog8
-rw-r--r--sci-chemistry/aria/aria-2.3.2-r1.ebuild92
-rw-r--r--sci-chemistry/aria/files/aria-2.3.2-through-space.patch118
3 files changed, 217 insertions, 1 deletions
diff --git a/sci-chemistry/aria/ChangeLog b/sci-chemistry/aria/ChangeLog
index 86dc9ddc7d64..51206a1a1b8c 100644
--- a/sci-chemistry/aria/ChangeLog
+++ b/sci-chemistry/aria/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for sci-chemistry/aria
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/aria/ChangeLog,v 1.9 2011/08/30 13:51:56 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/aria/ChangeLog,v 1.10 2011/10/07 19:23:04 jlec Exp $
+
+*aria-2.3.2-r1 (07 Oct 2011)
+
+ 07 Oct 2011; Justin Lecher <jlec@gentoo.org> +aria-2.3.2-r1.ebuild,
+ +files/aria-2.3.2-through-space.patch:
+ Add patches for newer ccpn data model, kindly provided by Tim Stevens
30 Aug 2011; Justin Lecher <jlec@gentoo.org> aria-2.3.2.ebuild:
Corrected dep version of cns so that new changes are present
diff --git a/sci-chemistry/aria/aria-2.3.2-r1.ebuild b/sci-chemistry/aria/aria-2.3.2-r1.ebuild
new file mode 100644
index 000000000000..fc25192f54b6
--- /dev/null
+++ b/sci-chemistry/aria/aria-2.3.2-r1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/aria/aria-2.3.2-r1.ebuild,v 1.1 2011/10/07 19:23:04 jlec Exp $
+
+EAPI=3
+
+PYTHON_DEPEND="2"
+PYTHON_USE_WITH="tk"
+
+inherit base eutils python versionator
+
+MY_P="${PN}$(get_version_component_range 1-2 ${PV})"
+
+DESCRIPTION="Automated NOE assignment and NMR structure calculation"
+HOMEPAGE="http://aria.pasteur.fr/"
+SRC_URI="http://aria.pasteur.fr/archives/${MY_P}.2.tar.gz"
+
+SLOT="0"
+LICENSE="cns"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples"
+
+RDEPEND="
+ sci-chemistry/clashlist
+ sci-chemistry/procheck
+ sci-libs/clashscore-db
+ dev-python/numpy
+ dev-python/matplotlib[tk]
+ >=sci-chemistry/cns-1.2.1-r7[aria,openmp]
+ >=dev-lang/tk-8.3
+ >=sci-chemistry/ccpn-2.0.5
+ >=dev-tcltk/tix-8.1.4"
+DEPEND="${RDEPEND}"
+
+RESTRICT="fetch"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_nofetch(){
+ einfo "Go to ${HOMEPAGE}, download ${A}"
+ einfo "and place it in ${DISTDIR}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-through-space.patch
+}
+
+src_test(){
+ export CCPNMR_TOP_DIR="${EPREFIX}"/$(python_get_sitedir)
+ export PYTHONPATH=.:${CCPNMR_TOP_DIR}/ccpn/python
+ $(PYTHON) check.py || die
+}
+
+src_install(){
+ insinto "$(python_get_sitedir)/${PN}"
+ doins -r src aria2.py || die "failed to install ${PN}"
+ insinto "$(python_get_sitedir)/${PN}"/cns
+ doins -r cns/{protocols,toppar,src/helplib} || die "failed to install cns part"
+
+ if use examples; then
+ insinto /usr/share/${P}/
+ doins -r examples || die
+ fi
+
+ # ENV
+ cat >> "${T}"/20aria <<- EOF
+ ARIA2="${EPREFIX}/$(python_get_sitedir)/${PN}"
+ EOF
+
+ doenvd "${T}"/20aria
+
+ # Launch Wrapper
+ cat >> "${T}"/aria <<- EOF
+ #!/bin/sh
+ export CCPNMR_TOP_DIR="${EPREFIX}/$(python_get_sitedir)"
+ export PYTHONPATH="${EPREFIX}/$(python_get_sitedir)/ccpn/python"
+ exec "$(PYTHON)" -O "\${ARIA2}"/aria2.py \$@
+ EOF
+
+ dobin "${T}"/aria || die "failed to install wrapper"
+ dosym aria /usr/bin/aria2
+
+ dodoc README || die
+}
+
+pkg_postinst() {
+ python_mod_optimize ${PN}
+}
+
+pkg_postrm() {
+ python_mod_cleanup ${PN}
+}
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