[med-svn] [python-pysam] 02/03: Adding individual files form new upstream
Jorge Soares
jssoares-guest at moszumanska.debian.org
Wed Nov 26 11:37:51 UTC 2014
This is an automated email from the git hooks/post-receive script.
jssoares-guest pushed a commit to branch master
in repository python-pysam.
commit 62a776ad93968d9fec095435340e3ce975e5e4e2
Author: Jorge Soares <j.s.soares at gmail.com>
Date: Wed Nov 26 11:34:32 2014 +0000
Adding individual files form new upstream
---
AUTHORS | 32 ++++++
install-CGAT-tools.sh | 281 ++++++++++++++++++++++++++++++++++++++++++++++++++
requires.txt | 1 +
3 files changed, 314 insertions(+)
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..308641e
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,32 @@
+List of contributors:
+
+Andreas Heger, Tildon Grant Belgard, Kevin B. Jacobs, Florian
+Finkernagel, Leo Goodstadt, Martin Goodson all contributed code
+to pysam.
+
+Gerton Lunter provided a VCF parser.
+
+Marcel Martin implemented python 3 compatibility.
+Ben Schiller contributed a Windows compatible clone.
+
+The sources in the directory samtools are from the samtools project:
+http://samtools.sourceforge.net/. All of these are available under the
+MIT licence. The attributions for this code are as follows:
+
+Heng Li from the Sanger Institute wrote most of the initial source code
+of SAMtools and various converters.
+
+Bob Handsaker from the Broad Institute is a major contributor to the
+SAM/BAM specification. He designed and implemented the BGZF format, the
+underlying indexable compression format for the BAM format. BGZF does
+not support arithmetic between file offsets.
+
+Jue Ruan for the Beijing Genome Institute designed and implemented the
+RAZF format, an alternative indexable compression format. RAZF supports
+arithmetic between file offsets, at the cost of increased index file
+size and the full compatibility with gzip. RAZF is optional and only
+used in `faidx' for indexing RAZF compressed fasta files.
+
+Colin Hercus updated novo2sam.pl to support gapped alignment by
+novoalign.
+
diff --git a/install-CGAT-tools.sh b/install-CGAT-tools.sh
new file mode 100755
index 0000000..ae9a6cb
--- /dev/null
+++ b/install-CGAT-tools.sh
@@ -0,0 +1,281 @@
+#!/usr/bin/env bash
+
+# function to detect the Operating System
+detect_os(){
+
+if [ -f /etc/os-release ]; then
+
+ OS=$(cat /etc/os-release | awk '/VERSION_ID/ {sub("="," "); print $2;}' | sed 's/\"//g' | awk '{sub("\\."," "); print $1;}')
+ if [ "$OS" != "12" ] ; then
+
+ echo
+ echo " Ubuntu version not supported "
+ echo
+ echo " Only Ubuntu 12.x has been tested so far "
+ echo
+ exit 1;
+
+ fi
+
+ OS="ubuntu"
+
+elif [ -f /etc/system-release ]; then
+
+ OS=$(cat /etc/system-release | awk ' {print $4;}' | awk '{sub("\\."," "); print $1;}')
+ if [ "$OS" != "6" ] ; then
+ echo
+ echo " Scientific Linux version not supported "
+ echo
+ echo " Only 6.x Scientific Linux has been tested so far "
+ echo
+ exit 1;
+ fi
+
+ OS="sl"
+
+else
+
+ echo
+ echo " Operating system not supported "
+ echo
+ echo " Exiting installation "
+ echo
+ exit 1;
+
+fi
+} # detect_os
+
+# message to display when the OS is not correct
+sanity_check_os() {
+ echo
+ echo " Unsupported operating system: $OS "
+ echo " Installation aborted "
+ echo
+ exit 1;
+} # sanity_check_os
+
+# function to install operating system dependencies
+install_os_packages() {
+
+if [ "$OS" == "ubuntu" -o "$OS" == "travis" ] ; then
+
+ echo
+ echo " Installing packages for Ubuntu "
+ echo
+
+ apt-get install -y gcc g++ zlib1g-dev libssl-dev libbz2-dev libfreetype6-dev libpng12-dev libblas-dev libatlas-dev liblapack-dev gfortran libpq-dev r-base-dev libreadline-dev libmysqlclient-dev libboost-dev libsqlite3-dev mercurial;
+
+elif [ "$OS" == "sl" ] ; then
+
+ echo
+ echo " Installing packages for Scientific Linux "
+ echo
+
+ yum -y install gcc zlib-devel gcc-c++ freetype-devel libpng-devel blas atlas lapack gcc-gfortran postgresql-devel R-core-devel readline-devel mysql-devel boost-devel sqlite-devel mercurial openssl-devel bzip2-devel
+
+else
+
+ sanity_check_os
+
+fi # if-OS
+} # install_os_packages
+
+# funcion to install Python dependencies
+install_python_deps() {
+
+if [ "$OS" == "ubuntu" -o "$OS" == "sl" ] ; then
+
+ echo
+ echo " Installing Python dependencies for $1 "
+ echo
+
+ # Create virtual environment
+ cd
+ mkdir CGAT
+ cd CGAT
+ wget --no-check-certificate https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.10.1.tar.gz
+ tar xvfz virtualenv-1.10.1.tar.gz
+ rm virtualenv-1.10.1.tar.gz
+ cd virtualenv-1.10.1
+ python virtualenv.py cgat-venv
+ source cgat-venv/bin/activate
+
+ # Install Python prerequisites
+ pip install cython
+
+elif [ "$OS" == "travis" ] ; then
+ # Travis-CI provides a virtualenv with Python 2.7
+ echo
+ echo " Installing Python dependencies in travis "
+ echo
+
+ # Install Python prerequisites
+ pip install cython
+ pip install nose
+
+else
+
+ sanity_check_os
+
+fi # if-OS
+} # install_python_deps
+
+install_nosetests_deps() {
+
+return
+
+if [ "$OS" == "ubuntu" -o "$OS" == "travis" ] ; then
+
+ # GCProfile
+ apt-get install -y libc6-i386 libstdc++5:i386
+
+elif [ "$OS" == "sl" ] ; then
+
+ # GCProfile
+ yum install -y glibc.i686 compat-libstdc++-33.i686
+
+else
+
+ sanity_check_os
+
+fi # if-OS
+
+} # install_nosetests_deps
+
+# common set of tasks to prepare external dependencies
+nosetests_external_deps() {
+echo
+echo " Running nosetests for $1 "
+echo
+
+pushd .
+
+# create a new folder to store external tools
+mkdir -p $HOME/CGAT/external-tools
+cd $HOME/CGAT/external-tools
+
+# install samtools
+curl -L http://downloads.sourceforge.net/project/samtools/samtools/1.1/samtools-1.1.tar.bz2 > samtools-1.1.tar.bz2
+tar xjvf samtools-1.1.tar.bz2
+cd samtools-1.1
+make
+PATH=$PATH:$HOME/CGAT/external-tools/samtools-1.1
+
+popd
+
+} # nosetests_external_deps
+
+
+# function to run nosetests
+run_nosetests() {
+
+echo
+echo " Running nosetests for $1 "
+echo
+
+# prepare external dependencies
+nosetests_external_deps $OS
+
+# install code
+python setup.py install
+
+# change into tests directory. Otherwise,
+# 'import pysam' will import the repository,
+# not the installed version. This causes
+# problems in the compilation test.
+cd tests
+
+# create auxilliary data
+echo
+echo 'building test data'
+echo
+make -C pysam_data
+
+# run nosetests
+# -s: do not capture stdout, conflicts with pysam.dispatch
+# -v: verbose output
+nosetests -s -v
+
+} # run_nosetests
+
+# function to display help message
+help_message() {
+echo
+echo " Use this script as follows: "
+echo
+echo " 1) Become root and install the operating system* packages: "
+echo " ./install-CGAT-tools.sh --install-os-packages"
+echo
+echo " 2) Now, as a normal user (non root), install the Python dependencies**: "
+echo " ./install-CGAT-tools.sh --install-python-deps"
+echo
+echo " At this stage the CGAT Code Collection is ready to go and you do not need further steps. Please type the following for more information:"
+echo " source $HOME/CGAT/virtualenv-1.10.1/cgat-venv/bin/activate"
+echo " cgat --help "
+echo
+echo " The CGAT Code Collection tests the software with nosetests. If you are interested in running those, please continue with the following steps:"
+echo
+echo " 3) Become root to install external tools and set up the environment: "
+echo " ./install-CGAT-tools.sh --install-nosetests-deps"
+echo
+echo " 4) Then, back as a normal user (non root), run nosetests as follows:"
+echo " ./install-CGAT-tools.sh --run-nosetests"
+echo
+echo " NOTES: "
+echo " * Supported operating systems: Ubuntu 12.x and Scientific Linux 6.x "
+echo " ** An isolated virtual environment will be created to install Python dependencies "
+echo
+exit 1;
+}
+
+
+# the main script starts here
+
+if [ $# -eq 0 -o $# -gt 1 ] ; then
+
+ help_message
+
+else
+
+ if [ "$1" == "--help" ] ; then
+
+ help_message
+
+ elif [ "$1" == "--travis" ] ; then
+
+ OS="travis"
+ install_os_packages
+ install_python_deps
+ install_nosetests_deps
+ run_nosetests
+
+ elif [ "$1" == "--install-os-packages" ] ; then
+
+ detect_os
+ install_os_packages
+
+ elif [ "$1" == "--install-python-deps" ] ; then
+
+ detect_os
+ install_python_deps
+
+ elif [ "$1" == "--install-nosetests-deps" ] ; then
+
+ detect_os
+ install_nosetests_deps
+
+ elif [ "$1" == "--run-nosetests" ] ; then
+
+ detect_os
+ run_nosetests
+
+ else
+
+ echo
+ echo " Incorrect input parameter: $1 "
+ help_message
+
+ fi # if argument 1
+
+fi # if number of input parameters
+
diff --git a/requires.txt b/requires.txt
new file mode 100644
index 0000000..743df07
--- /dev/null
+++ b/requires.txt
@@ -0,0 +1 @@
+cython>=0.17
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-pysam.git
More information about the debian-med-commit
mailing list