Browse Source

extra/biopython: Upgraded to biopython-1.51.

slackware-14.2
Damien Goutte-Gattat 12 years ago
parent
commit
81c53505e1
  1. 1
      extra/biopython/biopython-1.50b.tar.gz.sha1
  2. 1
      extra/biopython/biopython-1.51.tar.gz.sha1
  3. 63
      extra/biopython/biopython.SlackBuild
  4. 53
      extra/biopython/fix-genbank-writer.diff

1
extra/biopython/biopython-1.50b.tar.gz.sha1

@ -1 +0,0 @@
33131e51c1e923af7737a350f3f09b28028dfc64 biopython-1.50b.tar.gz

1
extra/biopython/biopython-1.51.tar.gz.sha1

@ -0,0 +1 @@
1d48208fc0fd5549958fea3eac40d12f032a6473 biopython-1.51.tar.gz

63
extra/biopython/biopython.SlackBuild

@ -1,45 +1,49 @@
#!/bin/bash
# Build script for Slackware
# Damien Goutte-Gattat "gouttegd" <dgouttegattat at incenp.org>
# Copyright (C) 2009 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications, is
# permitted provided that the following conditions are met:
# Redistribution and use of this script, with or without modifications,
# is permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest biopython sourcecode is available at:
# http://www.biopython.org/
# <http://www.biopython.org/>.
#
# Recommmends: extra/numpy, extra/reportlab, extra/psycopg2
# Recommends: extra/numpy, extra/reportlab
# Optional: extra/psycopg2, extra/mysql-python
# Source package infos
NAMESRC=${NAMESRC:-biopython}
VERSION=${VERSION:-1.50b}
VERSION=${VERSION:-1.51}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
WGET=${WGET:-http://biopython.org/DIST/$ARCHIVE}
# Built package infos
NAMETGZ=${NAMETGZ:-biopython}
BUILD=${BUILD:-2GGD}
# Build infos
NAMEPKG=${NAMEPKG:-biopython}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-i486}
TARGET=${TARGET:-i486}
EXT=${EXT:-txz}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMETGZ}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
@ -59,6 +63,9 @@ case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
;;
*)
CPUOPT="-O2"
;;
@ -66,22 +73,26 @@ esac
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget "$WGET"
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -1 | cut -d / -f 1)
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# Compile
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
patch -p 1 < $CWD/fix-genbank-writer.diff
CFLAGS=$CPUOPT \
CXXFLAGS=$CPUOPT \
python setup.py build
python setup.py install --root=$PKG
# Strip binaries
find $PKG | xargs file | grep "ELF \(32\|64\)-bit LSB" | cut -d : -f 1 | \
xargs strip --strip-unneeded 2> /dev/null
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 \
@ -97,7 +108,7 @@ cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMETGZ-$VERSION-$ARCH-$BUILD.tgz
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/$NAME
"

53
extra/biopython/fix-genbank-writer.diff

@ -1,53 +0,0 @@
diff -Naur biopython-1.50b.orig/Bio/SeqIO/InsdcIO.py biopython-1.50b/Bio/SeqIO/InsdcIO.py
--- biopython-1.50b.orig/Bio/SeqIO/InsdcIO.py 2009-04-01 12:08:06.000000000 +0200
+++ biopython-1.50b/Bio/SeqIO/InsdcIO.py 2009-04-07 14:05:01.000000000 +0200
@@ -29,6 +29,7 @@
from Bio.GenBank.Scanner import GenBankScanner, EmblScanner
from Bio import Alphabet
from Interfaces import SequentialSequenceWriter
+from Bio import SeqFeature
# NOTE
# ====
@@ -139,9 +140,9 @@
if not isinstance(a, Alphabet.Alphabet) :
raise TypeError("Invalid alphabet")
elif isinstance(a, Alphabet.ProteinAlphabet) :
- units = "bp"
- elif isinstance(a, Alphabet.NucleotideAlphabet) :
units = "aa"
+ elif isinstance(a, Alphabet.NucleotideAlphabet) :
+ units = "bp"
else :
#Must be something like NucleotideAlphabet or
#just the generic Alphabet (default for fasta files)
@@ -303,12 +304,23 @@
handle.write("//\n")
def _write_feature(self, feature):
- """Write a single SeqFeature object to features table.
-
- Not implemented yet, but this stub exists in the short term to
- facilitate working on writing GenBank files with a sub-class."""
- #TODO - Features...
- pass
+ """Write a single SeqFeature object to features table."""
+
+ if not isinstance(feature.location._start, SeqFeature.ExactPosition):
+ return
+ if not isinstance(feature.location._end, SeqFeature.ExactPosition):
+ return
+ start = feature.location._start.position + 1
+ end = feature.location._end.position
+ if feature.strand == -1:
+ loc = "complement(%i..%i)" % (start, end)
+ else:
+ loc = "%i..%i" % (start, end)
+ self.handle.write(" %-16s%s\n" % (feature.type, loc))
+ for q in feature.qualifiers.keys():
+ for val in feature.qualifiers[q]:
+ self.handle.write(" /%s=\"%s\"\n" % \
+ (q, val))
if __name__ == "__main__" :
print "Quick self test"
Loading…
Cancel
Save