diff options
author | Martin Mokrejš <mmokrejs@fold.natur.cuni.cz> | 2016-04-01 00:50:10 +0200 |
---|---|---|
committer | Martin Mokrejš <mmokrejs@fold.natur.cuni.cz> | 2016-04-01 00:50:10 +0200 |
commit | c2774f23f13407f20176e96d3c85d8918c8ca9c1 (patch) | |
tree | 600c155d1f52915f1ded8285ca32f8108d09ba46 | |
parent | sci-biology/karect: new package (diff) | |
download | sci-c2774f23f13407f20176e96d3c85d8918c8ca9c1.tar.gz sci-c2774f23f13407f20176e96d3c85d8918c8ca9c1.tar.bz2 sci-c2774f23f13407f20176e96d3c85d8918c8ca9c1.zip |
sci-biology/reapr: quick and dirty Debian patches do not help me with sci-biology/bamtools-2.3.0 installed site-wide; the bundled bamtools do not start to compile and tehrefore reapr linking steps fail while using using system-wide incompatible version
Package-Manager: portage-2.2.28
-rw-r--r-- | sci-biology/reapr/files/fix_sort_samtools13.patch | 16 | ||||
-rw-r--r-- | sci-biology/reapr/files/use_shared_libs.patch | 252 | ||||
-rw-r--r-- | sci-biology/reapr/reapr-1.0.18.ebuild | 12 |
3 files changed, 277 insertions, 3 deletions
diff --git a/sci-biology/reapr/files/fix_sort_samtools13.patch b/sci-biology/reapr/files/fix_sort_samtools13.patch new file mode 100644 index 000000000..f009223ce --- /dev/null +++ b/sci-biology/reapr/files/fix_sort_samtools13.patch @@ -0,0 +1,16 @@ +Description: adapt samtools sort usage to 1.3 syntax + Samtools 1.3 changed the syntax of the 'samtools sort' command, breaking + REAPR's smaltmap command in the process. + Discussed and forwarded to upstream in person, hence no URL. +Author: Sascha Steinbiss <sascha@steinbiss.name> +--- a/src/task_smaltmap.pl ++++ b/src/task_smaltmap.pl +@@ -155,7 +155,7 @@ + . " | $samtools view -S -T $assembly -b - > $raw_bam"; + + # sort the bam by coordinate +-push @commands, "$samtools sort $raw_bam $raw_bam.sort"; ++push @commands, "$samtools sort $raw_bam -O bam -o $raw_bam.sort.bam"; + + # remove duplicates + push @commands, "$samtools rmdup $raw_bam.sort.bam $rmdup_bam"; diff --git a/sci-biology/reapr/files/use_shared_libs.patch b/sci-biology/reapr/files/use_shared_libs.patch new file mode 100644 index 000000000..b748c7e6d --- /dev/null +++ b/sci-biology/reapr/files/use_shared_libs.patch @@ -0,0 +1,252 @@ +Description: Use_shared_libs +--- a/src/Makefile ++++ b/src/Makefile +@@ -1,7 +1,6 @@ +-BAMTOOLS_ROOT = $(CURDIR)/bamtools + CC = g++ +-CFLAGS = -Wl,-rpath,$(BAMTOOLS_ROOT)/lib -Wall -O3 -I $(BAMTOOLS_ROOT)/include -L $(BAMTOOLS_ROOT)/lib +-TABIX = tabix/tabix.o -L./tabix -ltabix -lz ++CFLAGS = -Wall -O3 -I /usr/include/bamtools -I /usr/include ++TABIX = -ltabix -lhts -lz + STATS_OBJS = trianglePlot.o coveragePlot.o fasta.o histogram.o utils.o + SCORE_OBJS = errorWindow.o utils.o histogram.o + BREAK_OBJS = fasta.o utils.o +@@ -35,46 +34,46 @@ + $(CC) $(CFLAGS) -c histogram.cpp + + utils.o: utils.cpp +- $(CC) $(CFLAGS) -lbamtools -c utils.cpp ++ $(CC) $(CFLAGS) -c utils.cpp + + task_stats: task_stats.o $(STATS_OBJS) +- $(CC) $(CFLAGS) task_stats.o $(STATS_OBJS) -lbamtools -o task_stats $(TABIX) ++ $(CC) $(CFLAGS) task_stats.o $(STATS_OBJS) -lbamtools $(TABIX) -o task_stats + + task_stats.o: task_stats.cpp $(STATS_OBJS) + $(CC) $(CFLAGS) -c task_stats.cpp + + task_score: task_score.o $(SCORE_OBJS) +- $(CC) $(CFLAGS) task_score.o $(SCORE_OBJS) -lbamtools -o task_score $(TABIX) ++ $(CC) -o task_score $(CFLAGS) task_score.o $(SCORE_OBJS) -lbamtools $(TABIX) + + task_score.o: task_score.cpp $(SCORE_OBJS) + $(CC) $(CFLAGS) -c task_score.cpp + + task_break: task_break.o $(BREAK_OBJS) +- $(CC) $(CFLAGS) task_break.o $(BREAK_OBJS) -lbamtools -o task_break $(TABIX) ++ $(CC) $(CFLAGS) task_break.o $(BREAK_OBJS) -lbamtools $(TABIX) -o task_break + + task_break.o: task_break.cpp $(BREAK_OBJS) + $(CC) $(CFLAGS) -c task_break.cpp + + bam2fragCov: bam2fragCov.o $(BAM2COV_OBJS) +- $(CC) $(CFLAGS) bam2fragCov.o $(BAM2COV_OBJS) -lbamtools -o bam2fragCov $(TABIX) ++ $(CC) $(CFLAGS) bam2fragCov.o $(BAM2COV_OBJS) $(TABIX) -lbamtools -o bam2fragCov + + bam2fragCov.o: bam2fragCov.cpp $(BAM2COV_OBJS) + $(CC) $(CFLAGS) -c bam2fragCov.cpp + + bam2insert: bam2insert.o $(BAM2INSERT_OBJS) +- $(CC) $(CFLAGS) bam2insert.o $(BAM2INSERT_OBJS) -lbamtools -o bam2insert $(TABIX) ++ $(CC) $(CFLAGS) bam2insert.o $(BAM2INSERT_OBJS) $(TABIX) -lbamtools -o bam2insert + + bam2insert.o: bam2insert.cpp $(BAM2INSERT_OBJS) + $(CC) $(CFLAGS) -c bam2insert.cpp + + bam2perfect: bam2perfect.o $(BAM2PERFECT_OBJS) +- $(CC) $(CFLAGS) bam2perfect.o $(BAM2PERFECT_OBJS) -lbamtools -o bam2perfect $(TABIX) ++ $(CC) $(CFLAGS) bam2perfect.o $(BAM2PERFECT_OBJS) $(TABIX) -lbamtools -o bam2perfect + + bam2perfect.o: bam2perfect.cpp $(BAM2PERFECT_OBJS) + $(CC) $(CFLAGS) -c bam2perfect.cpp + + bam2fcdEstimate: bam2fcdEstimate.o $(BAM2FCDESTIMATE_OBJS) +- $(CC) $(CFLAGS) bam2fcdEstimate.o $(BAM2FCDESTIMATE_OBJS) -lbamtools -o bam2fcdEstimate $(TABIX) ++ $(CC) $(CFLAGS) bam2fcdEstimate.o $(TABIX) $(BAM2FCDESTIMATE_OBJS) -o bam2fcdEstimate + + bam2fcdEstimate.o: bam2fcdEstimate.cpp $(BAM2FCDESTIMATE_OBJS) + $(CC) $(CFLAGS) -c bam2fcdEstimate.cpp +@@ -110,13 +109,13 @@ + $(CC) $(CFLAGS) -c scaff2contig.cpp + + task_gapresize: task_gapresize.o $(GAPRESIZE_OBJS) +- $(CC) $(CFLAGS) task_gapresize.o $(GAPRESIZE_OBJS) -lbamtools -o task_gapresize $(TABIX) ++ $(CC) $(CFLAGS) task_gapresize.o $(TABIX) $(GAPRESIZE_OBJS) -o task_gapresize + + task_gapresize.o: task_gapresize.cpp $(GAPRESIZE_OBJS) + $(CC) $(CFLAGS) -c task_gapresize.cpp + + task_fcdrate: task_fcdrate.o $(FCDRATE_OBJS) +- $(CC) $(CFLAGS) task_fcdrate.o $(FCDRATE_OBJS) -lbamtools -o task_fcdrate $(TABIX) ++ $(CC) $(CFLAGS) task_fcdrate.o $(TABIX) $(FCDRATE_OBJS) -o task_fcdrate + + task_fcdrate.o: task_fcdrate.cpp $(FCDRATE_OBJS) + $(CC) $(CFLAGS) -c task_fcdrate.cpp +--- a/src/task_break.cpp ++++ b/src/task_break.cpp +@@ -10,7 +10,6 @@ + #include <assert.h> + #include "fasta.h" + #include "utils.h" +-#include "tabix/tabix.hpp" + + using namespace std; + +--- a/src/task_score.cpp ++++ b/src/task_score.cpp +@@ -18,7 +18,6 @@ + #include "histogram.h" + #include "api/BamMultiReader.h" + #include "api/BamReader.h" +-#include "tabix/tabix.hpp" + + using namespace BamTools; + using namespace std; +--- a/src/task_stats.cpp ++++ b/src/task_stats.cpp +@@ -18,7 +18,6 @@ + #include "utils.h" + #include "api/BamMultiReader.h" + #include "api/BamReader.h" +-#include "tabix/tabix.hpp" + + using namespace BamTools; + using namespace std; +--- a/src/utils.h ++++ b/src/utils.h +@@ -11,7 +11,7 @@ + + #include "api/BamMultiReader.h" + #include "api/BamReader.h" +-#include "tabix/tabix.hpp" ++#include "tabix.hpp" + + const short INNIE = 1; + const short OUTTIE = 2; +--- a/src/task_fcdrate.cpp ++++ b/src/task_fcdrate.cpp +@@ -9,7 +9,6 @@ + + #include "utils.h" + #include "histogram.h" +-#include "tabix/tabix.hpp" + + using namespace std; + +--- a/src/reapr.pl ++++ b/src/reapr.pl +@@ -12,8 +12,8 @@ + $this_script = File::Spec->rel2abs($this_script); + my ($scriptname, $scriptdir) = fileparse($this_script); + $scriptdir = File::Spec->rel2abs($scriptdir); +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix'); +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip'); ++my $tabix = 'tabix'; ++my $bgzip = 'bgzip'; + my $version = '1.0.18'; + + if ($#ARGV == -1) { +--- a/src/task_preprocess.pl ++++ b/src/task_preprocess.pl +@@ -52,9 +52,9 @@ + my $ideal_fcd_file = File::Spec->catfile($sample_dir, 'ideal_fcd.txt'); + my $lowess_prefix = File::Spec->catfile($sample_dir, 'gc_vs_cov.lowess'); + my $r_script = File::Spec->catfile($sample_dir, 'gc_vs_cov.R'); +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix'); +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip'); +-my $samtools = File::Spec->catfile($scriptdir, 'samtools'); ++my $tabix = 'tabix'; ++my $bgzip = 'bgzip'; ++my $samtools = 'samtools'; + + # make directory and soft links to required files + $fasta_in = File::Spec->rel2abs($fasta_in); +--- a/src/task_perfectfrombam.pl ++++ b/src/task_perfectfrombam.pl +@@ -57,12 +57,12 @@ + my $min_perfect_map_qual = $ARGV[5]; + my $min_align_score = $ARGV[6]; + my $bam2perfect = File::Spec->catfile($scriptdir, 'bam2perfect'); +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip'); +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix'); ++my $bgzip = 'bgzip'; ++my $tabix = 'tabix'; + my $ERROR_PREFIX = '[REAPR perfectfrombam]'; + my $perfect_bam = "$out_prefix.tmp.perfect.bam"; + my $repetitive_bam = "$out_prefix.tmp.repetitive.bam"; +-my $samtools = File::Spec->catfile($scriptdir, 'samtools'); ++my $samtools = 'samtools'; + my %seq_lengths; + my %used_seqs; + my $hist_file = "$out_prefix.hist"; +--- a/src/task_perfectmap.pl ++++ b/src/task_perfectmap.pl +@@ -38,14 +38,14 @@ + my $reads_2 = $ARGV[2]; + my $fragsize = $ARGV[3]; + my $preout = $ARGV[4]; +-my $findknownsnps = File::Spec->catfile($scriptdir, 'findknownsnps'); ++my $findknownsnps = 'findknownsnps'; + my $ERROR_PREFIX = '[REAPR perfect_map]'; + my $raw_coverage_file = "$preout.tmp.cov.txt"; + my $tmp_bin = "$preout.tmp.bin"; + my $tmp_bin_single_match = "$tmp_bin\_single_match.fastq"; +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix'); +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip'); +-my $samtools = File::Spec->catfile($scriptdir, 'samtools'); ++my $tabix = 'tabix'; ++my $bgzip = 'bgzip'; ++my $samtools = 'samtools'; + my $all_bases_outfile = "$preout.perfect_cov.gz"; + my $hist_outfile = "$preout.hist"; + my @coverage = (0) x 101; +--- a/src/task_plots.pl ++++ b/src/task_plots.pl +@@ -50,9 +50,9 @@ + } + + +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix'); +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip'); +-my $samtools = File::Spec->catfile($scriptdir, 'samtools'); ++my $tabix = 'tabix'; ++my $bgzip = 'bgzip'; ++my $samtools = 'samtools'; + my @plot_list = ('frag_cov', 'frag_cov_cor', 'read_cov', 'read_ratio_f', 'read_ratio_r', 'clip', 'FCD_err'); + my @file_list; + my $fa_out = "$outprefix.ref.fa"; +--- a/src/task_pipeline.pl ++++ b/src/task_pipeline.pl +@@ -9,7 +9,7 @@ + + my ($scriptname, $scriptdir) = fileparse($0); + my $reapr_dir = abs_path(File::Spec->catfile($scriptdir, File::Spec->updir())); +-my $reapr = File::Spec->catfile($reapr_dir, 'reapr'); ++my $reapr = 'reapr'; + + my %options = (fcdcut => 0); + +--- a/src/task_seqrename.pl ++++ b/src/task_seqrename.pl +@@ -7,7 +7,7 @@ + use Getopt::Long; + + my ($scriptname, $scriptdir) = fileparse($0); +-my $samtools = File::Spec->catfile($scriptdir, 'samtools'); ++my $samtools = 'samtools'; + my %options; + my $usage = qq/<rename file> <in.bam> <out.bam> + +--- a/src/task_smaltmap.pl ++++ b/src/task_smaltmap.pl +@@ -77,8 +77,8 @@ + my $reads_2 = $ARGV[2]; + my $final_bam = $ARGV[3]; + my $ERROR_PREFIX = '[REAPR smaltmap]'; +-my $samtools = File::Spec->catfile($scriptdir, 'samtools'); +-my $smalt = File::Spec->catfile($scriptdir, 'smalt'); ++my $samtools = 'samtools'; ++my $smalt = 'smalt'; + my $tmp_prefix = "$final_bam.tmp.$$.smaltmap"; + my $smalt_index = "$tmp_prefix.smalt_index"; + my $smalt_sample = "$tmp_prefix.smalt_sample"; diff --git a/sci-biology/reapr/reapr-1.0.18.ebuild b/sci-biology/reapr/reapr-1.0.18.ebuild index 312219abb..893af8b96 100644 --- a/sci-biology/reapr/reapr-1.0.18.ebuild +++ b/sci-biology/reapr/reapr-1.0.18.ebuild @@ -2,7 +2,9 @@ # Distributed under the terms of the GNU General Public License v2 # $Id$ -EAPI=5 +EAPI=6 + +inherit eutils DESCRIPTION="Verify and correct genome assembly scaffolds using paired-end reads" HOMEPAGE="http://www.sanger.ac.uk/science/tools/reapr" @@ -11,7 +13,7 @@ SRC_URI="ftp://ftp.sanger.ac.uk/pub/resources/software/reapr/Reapr_${PV}.tar.gz LICENSE="GPL-3" SLOT="0" -KEYWORDS="" # does not link against -lbamtools +KEYWORDS="" IUSE="" # tested smalt versions 0.6.4 to 0.7.0.1 only @@ -28,11 +30,15 @@ RDEPEND="${DEPEND}" S="${WORKDIR}"/Reapr_"${PV}" +# we use temporarily patches from https://anonscm.debian.org/cgit/debian-med/reapr.git/tree/debian/patches + src_prepare(){ + default + for f in "${FILESDIR}"/*.patch; do epatch $f || die; done sed -e 's#^CC = g++#CXX ?= g++#' -i src/Makefile || die sed -e 's#$(CC)#$(CXX)#' -i src/Makefile || die sed -e 's#-O3##' -i src/Makefile || die - sed -e 's#^CFLAGS =#CXXFLAGS += -I../third_party/bamtools/src -L../third_party/bamtools/src#' -i src/Makefile || die + sed -e 's#^CFLAGS =#CXXFLAGS += -I../third_party/tabix -L../third_party/tabix -I../third_party/bamtools/src -L../third_party/bamtools/src#' -i src/Makefile || die #sed -e 's#-lbamtools#../third_party/bamtools/src/libbamtools.so#' -i src/Makefile || die sed -e 's#-ltabix#../third_party/tabix/libtabix.a#' -i src/Makefile || die sed -e 's#CFLAGS#CXXFLAGS#' -i src/Makefile || die |