getData/0000755000175000017500000000000012233431477012261 5ustar charlescharlesgetData/getData.conf.d/0000755000175000017500000000000012233420130014760 5ustar charlescharlesgetData/getData.conf.d/human.getData.mk0000644000175000017500000000021412233420130017766 0ustar charlescharlesORGANISM = Homo_sapiens ORGANISM_L = homo_sapiens BUILD = GRCh37.56 NICKNAME = hg19 include /etc/getData.conf.d/Ensembl_genome.mk getData/getData.conf.d/mouse.getData0000644000175000017500000000046412233420130017407 0ustar charlescharlesprint STDERR "Reading Mus musculus configuration file\n" if $verbose; $toBeMirrored{"mouse.genome"}={ "name" => "mm9 – Mouse Genome Sequencing Consortium", "tags" => ["mouse","genome"], "source" => "make -f /etc/getData.conf.d/mouse.getData.mk get unpack", # "post-download" => "make blast" }; 1; getData/getData.conf.d/mouse.getData.mk0000644000175000017500000000021412233420130020006 0ustar charlescharlesORGANISM = Mus_musculus ORGANISM_L = mus_musculus BUILD = NCBIM37.55 NICKNAME = mm9 include /etc/getData.conf.d/Ensembl_genome.mk getData/getData.conf.d/dog.getData.control0000644000175000017500000000107212233420130020503 0ustar charlescharlesSection: genome Priority: optional Standards-Version: 3.6.2 Package: dog-genome-blast Version: CanFam2.0-1 Maintainer: Charles Plessy Recommends: blast2 Architecture: all Files: canfam2.nhr /usr/share/genome/blast/canfam2.nhr canfam2.nin /usr/share/genome/blast/canfam2.nin canfam2.nsq /usr/share/genome/blast/canfam2.nsq Description: The dog genome indexed for NCBI blast. This is a completely experimental packages with no guaratee at all. Please do not use it yet if you find it by chance, it is not intended to be released for the moment. getData/getData.conf.d/pdb.getData0000644000175000017500000000034212233420130017017 0ustar charlescharles print STDERR "Reading PDB configuration file\n" if $verbose; $toBeMirrored{"pdb"}={ "name" => "PDB - protein structure database", "source" => "wget --mirror ftp://ftp.ebi.ac.uk/pub/databases/msd/pdb_uncompressed" }; 1; getData/getData.conf.d/human.getData0000644000175000017500000000045612233420130017370 0ustar charlescharlesprint STDERR "Reading Homo sapiens configuration file\n" if $verbose; $toBeMirrored{"human.genome"}={ "name" => "hg19 – Genome Reference Consortium", "tags" => ["human","genome"], "source" => "make -f /etc/getData.conf.d/human.getData.mk get unpack", # "post-download" => "make blast" }; 1; getData/getData.conf.d/rfam.getData0000644000175000017500000000050512233420130017200 0ustar charlescharlesprint STDERR "Reading Rfam configuration file\n" if $verbose; $toBeMirrored{"dog.genome"}={ "name" => "Rfam9.1 - Multiple alignments and covariance models of non-coding RNA families", "tags" => ["rna"], "source" => "ln -s /etc/getData.conf.d/rfam.getData.mk Makefile ; make get unpack", "post-download" => "" }; 1; getData/getData.conf.d/RefSeq.mk0000644000175000017500000000050612233420130016477 0ustar charlescharlesSHARED_WGET_OPTIONS=$(shell getData --getWgetOptions) # $SPECIES is provided to make in the call from /etc/getData.conf.d/RefSeq.getData. get: wget $(SHARED_WGET_OPTIONS) ftp://ftp.ncbi.nih.gov/refseq/$(SPECIES)/mRNA_Prot/*ff.gz unpack: for file in *ff.gz ; do zcat $$file > `basename $$file .gz` ; done blast: emboss: getData/getData.conf.d/rfam.getData.mk0000644000175000017500000000032212233420130017603 0ustar charlescharlesSHARED_WGET_OPTIONS=$(shell getData --getWgetOptions) get: wget $SHARED_WGET_OPTIONS ftp://ftp.sanger.ac.uk/pub/databases/Rfam/9.1/* unpack: for file in *.gz ; do zcat $$file > `basename $$file .gz` ; done getData/getData.conf.d/Ensembl_genome.mk0000644000175000017500000000045512233420130020234 0ustar charlescharlesSHARED_WGET_OPTIONS=$(shell getData --getWgetOptions) MIRROR = ftp://ftp.ensembl.org/pub/current_fasta get: wget $(SHARED_WGET_OPTIONS) $(MIRROR)/$(ORGANISM_L)/dna/$(ORGANISM).$(BUILD).dna.chromosome.*.fa.gz unpack: for file in *chromosome.*.fa.gz ; do zcat $$file > `basename $$file .gz` ; done getData/getData.conf.d/dog.getData.mk0000644000175000017500000000064612233420130017440 0ustar charlescharlesSHARED_WGET_OPTIONS=$(shell getData --getWgetOptions) get: wget $(SHARED_WGET_OPTIONS) ftp://ftp.ensembl.org/pub/current_fasta/canis_familiaris/dna/Canis_familiaris.BROADD2.50.dna.chromosome.*.fa.gz unpack: for file in *chromosome.*.fa.gz ; do zcat $$file > `basename $$file .gz` ; done blast: cat *fa | formatdb -i /dev/stdin -t CanFam2.0 -n canfam2 -p F deb: equivs-build /etc/getData.conf.d/dog.getData.control getData/getData.conf.d/dog.getData0000644000175000017500000000050412233420130017023 0ustar charlescharlesprint STDERR "Reading Canis lupus familiaris configuration file\n" if $verbose; $toBeMirrored{"dog.genome"}={ "name" => "CanFam2.0 - Dog Genome Sequencing Project", "tags" => ["dog","genome"], "source" => "ln -s /etc/getData.conf.d/dog.getData.mk Makefile ; make get unpack", "post-download" => "make blast" }; 1; getData/getData.conf.d/RefSeq.getData0000644000175000017500000000230512233420130017440 0ustar charlescharles# Proof-of-principle for RefSeq. Does not include everything. print STDERR "Reading Canis lupus familiaris configuration file\n" if $verbose; $toBeMirrored{"refseq.hsa"} = { "name" => "The NCBI Reference Sequence project – Homo sapiens", "tags" => ["human", "proteome", "transcriptome"], "source" => "ln -s /etc/getData.conf.d/RefSeq.mk Makefile ; SPECIES=H_sapiens make get unpack", "post-download" => "make emboss blast" }, $toBeMirrored{"refseq.mmu"} = { "name" => "The NCBI Reference Sequence project – Mus musculus", "tags" => ["mouse", "proteome", "transcriptome"], "source" => "ln -s /etc/getData.conf.d/RefSeq.mk Makefile ; SPECIES=M_musculus make get unpack", "post-download" => "make emboss blast" }, $toBeMirrored{"refseq.rno"} = { "name" => "The NCBI Reference Sequence project – Rattus norvegicus", "tags" => ["rat", "proteome", "transcriptome"], "source" => "ln -s /etc/getData.conf.d/RefSeq.mk Makefile ; SPECIES=R_norvegicus make get unpack", "post-download" => "make emboss blast" }, 1; getData/version0000644000175000017500000000000412233431476013662 0ustar charlescharles0.2 getData/TODO0000644000175000017500000000074712233420131012742 0ustar charlescharlesgetData - TODO ============== * define Debian packages and/or applications that must be installed prior to the execution of some scripts. -- Steffen Mon, 18 Feb 2008 13:46:48 +0100 * I think that we would need a tag-based sorting of data sources as their list will grow very, very big. * The RefSeq URL apparently taps in a daily build. Put a time stamp that is updated only if the data is actually changed. * Manage write permissions on /var/lib/getdata getData/README0000644000175000017500000000576512233420131013137 0ustar charlescharlesgetData ======= Computational biology as a science works without data. Well, but one cannot prove anything then or just learn from appling the computer to some new data, then. There are many reasons why Debian cares about bioinformatics, but alone for a contribution to the education of our students at all levels - something we cannot talk enough about, there needs to be an easy straight forward way to get access to data. For the professionals then around us, we also need those extra features like automated updates and whatever else comes to mind to maintain those data files in our daily routine. There are now various approaches to it. Many say that there should be data packages available which are tarballs or some other format of that data to be installed. This is very reasonable indeed. But alone for the concept of releases that comes with our and basically every other Linux distro, this concept is doomed. Nobody wants to use old biological databases when a new version is available basically at the very same costs. This package instead sets out to prepare the installation and maintenance of databases automatically - directly from the data creator's websites and redistributed as a Debian package. There may still be packages with the name of a particular database, like 'uniprot', but those should then merely provide the instructions to this new 'getData' tool on how to deal with the database for download, indexing and updating. The download of the databases listed in getData should all remain functional. The major challenge is the integration with the post-processing of the data. In this respect well performing should already be the swiss.dat (manually curated fraction of the UniProt protein sequence database) and trembl.dat (automated translating of coding sequences in the nucleotide sequence database EMBL) entries. For sites that have the EMBOSS tool kit installed, also the respective indexing is performed. Once the package has hit unstable, we shall have the configuration files with database-specific tools or database install packages. Please help with your direct contributions and/or feedback. 'getData' can be successful only when there is a strong communication among ourselves concerning new tools on the horizon that should possibly be added. And when there is a new URL for a particular pathway, then this should be updated in some community effort. So, please, should at us by saying "reportbug getdata" whenever there is something to report. While the development of this tools was indeed seeded by the Debian Med community, there is some strong hope that folks at Fedora and OpenSuSE would adopt this package from us. We'll see. Many thanks!!! Steffen and Charles Acknowledgements ---------------- This work was partially supported by the EU FP6 project "KnowARC", that aimed at preparing computational grids also for smaller research groups in Bioinformatics. Read more on http://www.knowarc.eu. -- Steffen Moeller and Charles Plessy <{moeller,plessy}@debian.org> Fri, 05 Nov 2010 13:58:32 +0100 getData/getData0000755000175000017500000005577712233420131013566 0ustar charlescharles#!/usr/bin/perl -w use strict; use vars qw(%toBeMirrored $sharedWgetOptions); $sharedWgetOptions = "--continue --recursive --no-host-directories --no-directories --level 1 --no-parent"; =head1 NAME getData - retrieves databases from the Internet =cut # This script shall help maintaining sets of frequently changing databases # of various sorts. It is motivated by demands in computational biology # and astronomy. # Copyright (c) 2008-2011 Steffen Moeller # Copyright (c) 2008-2011 Charles Plessy # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Or else go to GNU Web pages http://www.gnu.org and follow the white rabbit. # my ($mirrordir,$confd); my $configfile="/etc/getData.conf"; my $error=0; if ( -r $configfile ) { open(FH,"<$configfile") or die "Could not open config data at '$configfile'.\n"; while() { next if /^\s*#/; next unless /\s*(\S.*\S)\s*=\s*"([^"]*)"\s*/; #print STDERR "Read: $1\n"; if ("mirrordir" eq "$1") { $mirrordir=$2; print STDERR "Seting mirrordir to '$mirrordir'.\n"; } elsif ("confd" eq "$1") { $confd=$2; print STDERR "Configuration directory not existing: '$confd'\n" unless ! -d "$confd"; $error++; } } close FH; } exit -1 if $error; =head1 SYNOPSIS getData [ --mirrordir ] getData --list =head1 DESCRIPTION Bioinformatics has the intrinsic problem to bring the biological data to the end user. Astronomers have the equivalent problem and particle physicists, well, they haven come up with (first) the web and (second) the computational grids to address their problems. Debian helps with the programs but will not provide such huge datasets that are even frequently updated - not even in volatile.debian.org. Most bioinformatics researchers will not need too many of such databases. And even more so will gladly continue in using public services remotely. For those who need a set of databases on a regular basis, this script shall be a start to automate the burden to download the data and update indices and the like. The world has seen such magic before with the Lion Biosciences Prisma tool (http://bib.oxfordjournals.org/cgi/reprint/3/4/389.pdf) but how about something simpler (as a start) that at least gets close to what we desire and is Free. The aim must be to address the needs of all (most) communities, not only of the bioinformatics world. The seed was hence made with databases from astronomy. Please contact the Debian-Med community if you consider this program to be almost ready for your needs and explain what still needs to be added. Public databases that you managed to integrate with this system are also very warmly welcomed as feedback. =head1 OPTIONS =over 4 =item --help this help =item --man Present a more detailed description in form of a man page. =item --verbose Say one or two words more than required. =item --mirrordir Specifies destination directory. The data will be mirrored to the folder $mirrordir/$dbname/. Please be aware that this mirrordir is nowhere stored. The directory can consequently be moved to arbitrary locations at any time, if the users of the data are only informed about that moving. =item --list Lists all databases that may be requested to be installed. =item Only those databases that are explicitly requested to be downloaded will be downloaded. Such databases may require considerable bandwidth, so please make sure you know you are doing the right thing. =item --post Perform only the unpacking/indexing, but do not retrieve/update the databases. This option is considered useful when adding a new database management system to the system, e.g. after installing EMBOSS. =item --source Perform only the unpacking/indexing, but do not retrieve/update the databases. This option may be beneficial when the site administator is aware of current analyses that should not be disturbed by the indexing process but the downloading from the net can already be started. =item --confd Allows for the specification of a directory in which multiple files can be stored that will be read by getData upon its invocation. These may add values to the global variable %toBeMirrored that specifies the databases and their download scripts. =item --config Preparation of the configuration file that would be reuired for a particular system that deals with the database. The configuration is printed to stdout and is expected to be copied manually to the proper file or folder. One could imagine this process to be automated, though this is not yet implemented. Currently available is support for two systems: =over 8 =item emboss This specifies the EMBOSS suite of tools for bioinformatics (www.emboss.org) that is also available as a Debian package. The configuration for the Uniprot databases will allow the sequence retrieval with the seqret tool. =item dre - ARC Grid Runtime Environment Runtime environments (REs) are a concept of the ARC grid middleware of which more can be learned on http://www.nordugrid.org. A script is needed to indicate the presence of a runtime environment. Here, the name of the script is important, which is not definable by getData though since it only writes to stdout. =back Unfortunately, the configuration was not yet be found to be modularised. It all needs to happen within the getData script itself. =item --remove This command removes folders that store the data. In principle this could be perfomed manually, though some databases may have special requirements pre- or post-removal, which can be specified individually for every database. =back =head1 SPECIFICATION OF DATABASES Databases for download and their post-processing are specified at two different locations. One is the getData script itself, the other are files stored in /etc/getData.d. Either will define elements of a considerably large hash. The key is the identifier which is also shown by the 'getData --list' directive. The value is a reference to another hash, which assigns values to all the properties that a database has for its download and post-processing: =over 4 =item name - a human-readable pretty-printed name or short description that makes clear to the world what this database is about. A bad example is the mere assignment of "DE405", which few people understand. A better example is "Pfam-A : Manually curated protein families and domains, only the seed is presented.". One could argue that one should have that field renamed to "description". =item source - shell commands to perform the initial download and subsequent updates Commonly the wget tool is used for download. The such presented little script is executed underneath the mirrordir directory. One simple example is "wget --mirror ftp://ssd.jpl.nasa.gov/pub/eph/export/unix/unxp2[01]*.405". With increasing proficiency in using wget, one is tempted to substitute "--mirror" with "--recursive --no-host-directories --no-directories --level 1 --no-parent". =item post-download - shell commands to perform after the data has been downloaded. A simple (and unnecessary when used the right flags to wget) example is the mere setting of a symbolic link: "post-download" => "ln -s ssd.jpl.nasa.gov/pub/eph/export/unix/unxp*.405 ." Some more effort has been put into TrEMBL for the merging of releases with subsequent updates and the indexing for EMBOSS: "d=uncompressed; if [ ! -d \$d ]; then mkdir \$d; fi; " ."rm -rf \$d/trembl.dat; " ."(find ftp.ebi.ac.uk -name '*.dat.gz' | xargs -r zcat ) > \$d/trembl.dat; " ."[ -x /usr/bin/dbxflat ] " . "&& cd \$d && " . "dbxflat -dbresource embl -dbname trembllocal -idformat swiss -filenames=trembl.dat -fields id,acc -auto", The dots are connecting strings in Perl. This helps the readability of the code. When writing these scripts, please be aware the newlines don't separate the individual commands here. Semicolon are required. =item recommends - suggests a series of packages to be present for the use of the database or the performance of the indexing. This information is not used at the moment, also to render this script more useful for other Linux distributions than Debian. =item getWgetOptions - private command to get wget options This is used at download time by makefiles, is not intended to be used interactively, and could be removed anytime. =back =head1 EXAMPLES The following will list the identifiers and the descriptions of the first 4 databases that area available via getData on your system. ./getData --mirrordir=/local/databases/mirrored --list | head 4 To install any particular database, only give its name as an argument. If the installation is performed at another directory than the default, then the --mirrordir needs again to be set. ./getData swiss.dat To remove the database again, give the script a hint with the --remove flag ./getData --remove swiss.dat To perform the indexing only and circumvent the download (attention, this is dangerous since the index files will look newer than the database is), do ./getData --post swiss.dat A special exception to these extra scripts is the --config flag in that it takes a list of extra arguments. Each shall denote a particular system that this database may be of interest for. There are today two systems supported: =head1 TODO We now need a mechanism with which packages can specify hooks that shall be called upon an update of a database. But we cannot assume that every indexing that can be performed because of the installation of some package is also desired by the user. How to configure this properly is left to be decided. =head1 SEE ALSO http://debian-med.alioth.debian.org, http://wiki.debian.org/DebianMed, /etc/getData.conf =head1 AUTHORS This script was prepared by Steffen Moeller and Charles Plessy and is distributed under the terms of the GNU Public License (GPL). On Debian systems, this license can be found under /usr/share/common-licenses/GPL. =cut use strict; use Getopt::Long; use Cwd; %toBeMirrored = ( # # A S T R O N O M Y # "tycho2" => { name => "Tycho2 Star Coordinates", source => "wget --mirror ftp://cdsarc.u-strasbg.fr/pub/cats/I/259/ReadMe ftp://cdsarc.u-strasbg.fr/pub/cats/I/259/index.dat.gz ftp://cdsarc.u-strasbg.fr/pub/cats/I/259/tyc2.dat*", "post-download" => "[ -r tyc2.dat -a -z \"`find . -cnewer tyc2.dat " . "-a ! -name .listing`\" ] " . "&& echo \"No mirrored file newer than previously created index.\" " . "|| ( zcat cdsarc.u-strasbg.fr/pub/cats/I/259/tyc2.dat* > tycho2.dat && ln -sf tycho2.dat Tycho2.dat)" }, "astorb" => { name => "asteroid orbits", source => "wget --mirror ftp://ftp.lowell.edu/pub/elgb/astorb.dat.gz", "post-download" => "[ -r astorb.dat " . "-a ftp.lowell.edu/pub/elgb/astorb.dat.gz -nt astorb.dat ] " . "|| zcat ftp.lowell.edu/pub/elgb/astorb.dat.gz > astorb.dat" }, "DE405" => { name => "DE405", # URL moved #source => "wget $sharedWgetOptions ftp://ssd.jpl.nasa.gov/pub/eph/export/unix/unxp2[01]*.405", source => "wget $sharedWgetOptions ftp://ssd.jpl.nasa.gov/pub/eph/planets/ascii/de405/", "post-download" => "[ -r unxp2000.405 -a ascp1600.405 -nt unxp2000.405 ] || cat ascp*.405 > unxp2000.405", recommends => "jpl-eph-tools" }, # # B I O I N F O R M A T I C S # "ensembl.hsa" => { name => "ENSEMBL flatfile dump -- Homo Sapiens", source => "wget $sharedWgetOptions ftp://ftp.ensembl.org/pub/current_embl/homo_sapiens/*" }, "gene.ontology.rdf" => { name => "GeneOntology - RDF-formatted, terms only.", source => "wget $sharedWgetOptions ftp://ftp.geneontology.org/pub/go/godatabase/archive/latest/go_*-termdb.rdf-xml.gz", "post-download" => "gzip -dc ftp.geneontology.org/pub/go/godatabase/archive/latest/go_*-termdb.rdf-xml.gz > go-termdb.rdf-xml" }, "gwascatalog" => { name => "Genome.org - GWAScatalog: SNPs and diseases", source => "wget $sharedWgetOptions http://www.genome.gov/admin/gwascatalog.txt" }, "intact.psimitab" => { name => "IntACT Protein Interaction Database", source => "wget $sharedWgetOptions ftp://ftp.ebi.ac.uk/pub/databases/intact/current/psimitab/intact.zip", "post-download" => "unzip `find ftp.ebi.ac.uk -name '*.zip'`" }, "jaspar" => { name => "The high-quality transcription factor binding profile database", source => "wget $sharedWgetOptions --accept .zip " . "http://jaspar.genereg.net/html/DOWNLOAD/MatrixDir/", }, "jaspar.core" => { name => "Jaspar Core Database of transcription factor binding sites", source => "wget --mirror http://jaspar.genereg.net/html/DOWNLOAD/MatrixDir/JASPAR_CORE_2008/" #recommends => ["TFBS"] }, # "jaspar.sites" => { # name => "Sites subfolder of JASPAR database", # source => "wget --mirror http://jaspar.genereg.net/html/DOWNLOAD/SITES/*/*.sites" # }, # # "jaspar.MatrixDir" => { # name => "MatrixDir subfolder of JASPAR database", # source => "wget --mirror http://jaspar.genereg.net/html/DOWNLOAD/MatrixDir/*/*.sites" # } "kegg.brite" => { name => "Kegg Brite Database", source => "wget $sharedWgetOptions ftp://ftp.genome.jp/pub/kegg/release/current/brite.tar.gz" }, "kegg.pathway" => { name => "Kegg Pathway Database", source => "wget $sharedWgetOptions ftp://ftp.genome.jp/pub/kegg/release/current/pathway.tar.gz" }, "kegg.pathway.hsa" => { name => "Kegg Pathway Database (HSA)", source => "wget --mirror ftp://ftp.genome.jp/pub/kegg/pathway/organisms/hsa" }, "kegg.pathway.hsa.xml" => { name => "XML representation of pathways in KEGG", source => "wget --mirror ftp://ftp.genome.jp/pub/kegg/xml/README ftp://ftp.genome.jp/pub/kegg/xml//KGML.dtd ftp://ftp.genome.jp/pub/kegg/xml/ko ftp://ftp.genome.jp/pub/kegg/xml/map ftp://ftp.genome.jp/pub/kegg/xml/organisms/hsa" }, "reactome.tab.human" => { name => "Reactome Pathway Database - Human interactions as tab delimited", source => "wget $sharedWgetOptions http://www.reactome.org/download/interactions.README.txt http://www.reactome.org/download/current/homo_sapiens.interactions.txt.gz" }, "pfam-a" => { name => "Pfam-A : Manually curated protein families and domains, only the seed is presented.", source => "wget $sharedWgetOptions ftp://ftp.sanger.ac.uk/pub/databases/Pfam/current_release/Pfam-A-seed.gz" }, "pfam-b" => { name => "Pfam-B : Automated assembly of protein families", source => "wget $sharedWgetOptions ftp://ftp.sanger.ac.uk/pub/databases/Pfam/current_release/Pfam-B.gz" }, "pfam-c" => { name => "Pfam-C : Clans of sequences that may be assigned to multiple Pfam entries", source => "wget $sharedWgetOptions ftp://ftp.sanger.ac.uk/pub/databases/Pfam/current_release/Pfam-C.gz" }, "trembl.dat" => { name => "UniProt - TrEMBL in EMBL format", source => "wget $sharedWgetOptions ftp://ftp.ebi.ac.uk/pub/databases/swissprot/release_compressed/uniprot_trembl.dat.gz", "post-download" => "d=uncompressed; if [ ! -d \$d ]; then mkdir \$d; fi; " ."rm -rf \$d/trembl.dat; " ."(find . -name '*.dat.gz' | xargs -r zcat ) > \$d/trembl.dat; " ."[ -x /usr/bin/dbxflat ] " . "&& cd \$d && " . "dbxflat -dbresource embl -dbname trembllocal -idformat swiss -filenames=trembl.dat -fields id,acc -auto", "recommends" => ["emboss"], "test" => "seqret trembllocal:Q9YZN7" }, "swiss.dat" => { name => "UniProt - SwissProt in EMBL format", source => "wget $sharedWgetOptions ftp://ftp.ebi.ac.uk/pub/databases/swissprot/release_compressed/uniprot_sprot.dat.gz ftp://ftp.ebi.ac.uk/pub/databases/swissprot/updates_compressed/*.dat.gz", "post-download" => "d=uncompressed; if [ ! -d \$d ]; then mkdir \$d; fi; " ."rm -rf \$d/swissprot.dat; " ."(find . -name '*.dat.gz' | xargs -r zcat ) > \$d/swissprot.dat; " ."[ -x /usr/bin/dbiflat ] && " . "cd \$d && " . "dbiflat -dbname swisslocal -fields acc,des -idformat swiss -auto", # source => "wget --mirror ftp://ftp.ebi.ac.uk/pub/databases/swissprot/release_compressed/uniprot_sprot.dat.gz" "recommends" => ["emboss"], "test" => "seqret -feature swisslocal:p12345 -osf swiss -stdout -auto" }, "swiss.fasta" => { name => "UniProt - SWISS-PROT in FASTA format", source => "wget $sharedWgetOptions ftp://ftp.ebi.ac.uk/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_sprot.fasta.gz" }, "trembl.fasta" => { name => "UniProt - TrEMBL in FASTA format", source => "wget $sharedWgetOptions ftp://ftp.ebi.ac.uk/pub/databases/uniprot/current_release/knowledgebase/complete/uniprot_trembl.fasta.gz" }, ); $mirrordir = "/var/lib/mirrored" unless defined($mirrordir); $confd = "/etc/getData.conf.d" unless defined($confd); my ($post,$source,$removal,$config,$list,$help,$man,$verbose,$getWgetOptions)=(undef,undef,undef,0,0,0,0,0); my %options=("mirrordir:s" => \$mirrordir, "list" => \$list, "help"=>\$help, "man"=>\$man, "verbose"=>\$verbose, "post"=>\$post, "confd=s"=>\$confd, "config:s@"=>\$config, "remove"=>\$removal, "source"=>\$source, "getWgetOptions"=>\$getWgetOptions); my ($do_source,$do_post,$do_config,$do_removal)=(1,1,0,0); sub myhelp () { require "Pod/Usage.pm"; import Pod::Usage; pod2usage() unless defined($man); pod2usage( -verbose => 2 ); } GetOptions(%options) or die "Could not parse arguments.\n"; die "Cannot set both --post-download-only and --source-only options.\n" if $post and $source; if ($help or $man) { myhelp() } if ($getWgetOptions) { print "$sharedWgetOptions\n"; exit 0; } print "post: $post, source: $source\n" if $verbose; if ($post) { print "solely enabling post-download operations, disabling retrieval of database updates and removal.\n"; $do_source=0; $do_post=1; $do_config=0; $do_removal=0; } if ($source) { print "solely enabling download, disabling unpacking, configuration, indexing and removal.\n"; $do_post=0; $do_source=1; $do_config=0; $do_removal=0; } if ($config) { print "solely enabling database configuration for external systems, disabling retrieval of updates, the removal and their unpacking/indexing.\n"; $do_post=0; $do_source=0; $do_removal=0; $do_config=1; } if ($removal) { print "enabling removal, disabling retrieval of updates, the configuration and their unpacking/indexing.\n"; $do_post=0; $do_source=0; $do_config=0; $do_removal=1; } if ($verbose) { foreach my $o (keys %options) { print "$o => " . ${$options{$o}}."\n"; } } if ( -d "$confd" ) { foreach my $f (glob "$confd/*.getData") { eval require $f or die "Could not read '$f': $@\n"; print STDERR "Read '$f'\n"; } } ############## A C T I O N ################## if ($list) { my $maxlength=0; foreach my $db (keys %toBeMirrored) { $maxlength=length($db) if length($db)>$maxlength; } foreach my $db (sort keys %toBeMirrored) { printf "%-${maxlength}s",$db; # more information like the expected size should be printed here. print "\t".$toBeMirrored{$db}{"name"}; print "\n"; } exit 0; } die "Cannot write to root destination directory at '$mirrordir'.\n" unless ( -w "$mirrordir" or $do_config); #print join(", ",@ARGV)."\n"; my $d=getcwd(); foreach my $db (@ARGV) { unless(exists($toBeMirrored{$db})) { print STDERR "Unknown database: '$db'\n"; next; } if ($do_config) { die "Please specify a system to configure.\n" unless 0 \"$mirrordir\"\n"; unless ( -d "$mirrordir/$db" ) { if ($do_source) { print " creating directory $mirrordir/$db\n"; mkdir("$mirrordir/$db") or die "Could not create directory \"$mirrordir/$db\"\n"; } else { die "Directory '$mirrordir/$db' is not existing, no data to treat post-download," ." the download itself was disabled via the command line.\n"; } } chdir("$mirrordir/$db") or die "Could not change directory to \"$mirrordir/$db\"\n"; if ($do_source) { print "Mirroring ".$toBeMirrored{$db}{"name"}." ($db)\n"; my $cmd = $toBeMirrored{$db}{"source"}; if (!defined ($cmd) or "" eq $cmd) { print STDERR "$db: download instructions not specified - skipping.\n"; next; } print STDERR "$cmd\n"; system($cmd) and die "Experienced problem."; } if ($do_post) { print "Executing post-download scripts for ".$toBeMirrored{$db}{"name"}." ($db)\n"; my $cmd = $toBeMirrored{$db}{"post-download"}; if ( defined($cmd) and "" ne $cmd) { print STDERR "$cmd\n"; system($cmd) and die "$db: post-download: Experienced problem."; } else { print STDERR "$db: No post-download command defined.\n" if $verbose; } } if ($do_removal) { print "Removal of ".$toBeMirrored{$db}{"name"}." ($db)\n"; if (exists($toBeMirrored{$db}{"pre-removal"})) { my $cmd = $toBeMirrored{$db}{"pre-removal"}; print "Performing: '$cmd'\n" if $verbose; if (defined($cmd)) { system($cmd) and die "$db: pre-removal: Experienced problem while executing '$cmd': $@\n"; } } # This will be performed one way or the other my $cmd=""; if (exists($toBeMirrored{$db}{"removal"})) { $cmd = $toBeMirrored{$db}{"removal"}; } else { $cmd = "rm -rf \"$mirrordir/$db\""; } print "Performing: '$cmd'\n" if $verbose; system($cmd) and die "$db: removal: Experienced problem while executing '$cmd': $@\n"; if (exists($toBeMirrored{$db}{"post-removal"})) { my $cmd = $toBeMirrored{$db}{"post-removal"}; print "Performing: '$cmd'\n" if $verbose; if (defined($cmd)) { my $cmd = $toBeMirrored{$db}{"post-removal"}; system($cmd) and die "$db: post-removal: Experienced problem while executing '$cmd': $@\n"; } } } chdir($d) or die "Could not change back to dir '$d'.\n"; } getData/Makefile0000644000175000017500000000250012233420131013677 0ustar charlescharles#!/usr/bin/make -f # Copyright 2007-2008 Steffen Moeller # # This package is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This package is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this package; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # On Debian systems, the complete text of the GNU General # Public License can be found in `/usr/share/common-licenses/GPL'. all: getData.1 getData.1: getData pod2man getData > getData.1 getData.txt: getData pod2text getData > getData.txt commit: commit_flag commit_flag: getData.1 getData.txt svn commit touch $@ clean: rm --force getData.1 getData.txt VERSION=$(shell cat version) dist: clean cd .. && tar --exclude .svn --exclude debian --exclude .pc -czvf getdata_$(VERSION).orig.tar.gz getData .PHONY: commit clean all getData/COPYING0000644000175000017500000004325412233420131013305 0ustar charlescharles GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. getData/ChangeLog0000644000175000017500000000203512233420131014014 0ustar charlescharles2010-11-05 Steffen Moeller * add file version, indicating version 0.1 * added "make dist" 2009-11-23 Charles Plessy * getData.conf.d/human.getData.mk: added human genome build GRCh37.56. 2009-08-27 Charles Plessy * getData.conf.d/mouse.getData.mk: upgraded to build NCBIM37.55. 2009-06-19 Charles Plessy * getData.conf.d/Ensembl_genome.mk: factorises from dog.getData.mk. * getData.conf.d/mouse.getData*: mouse genome build NCBIM37.54 from Ensembl 2009-02-19 Charles Plessy * ChangeLog: Added. Let's follow the GNU coding standards. http://www.gnu.org/prep/standards/html_node/Change-Logs.html * getData.conf.d: Added support for mouse and human RefSeq. * getData.pl: Removed human RefSeq. * getData.conf.d/dog.getData, getData.conf.d/rfam.getData, getData.conf.d/pdb.getData: Print on STDERR only if verbose. * getData.conf.d/dog.getData.mk: added missing parenthesis around a make variable.