Gentoo Archives: gentoo-commits

From: Martin Mokrejs <mmokrejs@×××××××××××××××.cz>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/reapr/files/, sci-biology/reapr/
Date: Thu, 31 Mar 2016 22:52:57
Message-Id: 1459464610.c2774f23f13407f20176e96d3c85d8918c8ca9c1.mmokrejs@gentoo
1 commit: c2774f23f13407f20176e96d3c85d8918c8ca9c1
2 Author: Martin Mokrejš <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
3 AuthorDate: Thu Mar 31 22:50:10 2016 +0000
4 Commit: Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
5 CommitDate: Thu Mar 31 22:50:10 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=c2774f23
7
8 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
9
10 Package-Manager: portage-2.2.28
11
12 sci-biology/reapr/files/fix_sort_samtools13.patch | 16 ++
13 sci-biology/reapr/files/use_shared_libs.patch | 252 ++++++++++++++++++++++
14 sci-biology/reapr/reapr-1.0.18.ebuild | 12 +-
15 3 files changed, 277 insertions(+), 3 deletions(-)
16
17 diff --git a/sci-biology/reapr/files/fix_sort_samtools13.patch b/sci-biology/reapr/files/fix_sort_samtools13.patch
18 new file mode 100644
19 index 0000000..f009223
20 --- /dev/null
21 +++ b/sci-biology/reapr/files/fix_sort_samtools13.patch
22 @@ -0,0 +1,16 @@
23 +Description: adapt samtools sort usage to 1.3 syntax
24 + Samtools 1.3 changed the syntax of the 'samtools sort' command, breaking
25 + REAPR's smaltmap command in the process.
26 + Discussed and forwarded to upstream in person, hence no URL.
27 +Author: Sascha Steinbiss <sascha@×××××××××.name>
28 +--- a/src/task_smaltmap.pl
29 ++++ b/src/task_smaltmap.pl
30 +@@ -155,7 +155,7 @@
31 + . " | $samtools view -S -T $assembly -b - > $raw_bam";
32 +
33 + # sort the bam by coordinate
34 +-push @commands, "$samtools sort $raw_bam $raw_bam.sort";
35 ++push @commands, "$samtools sort $raw_bam -O bam -o $raw_bam.sort.bam";
36 +
37 + # remove duplicates
38 + push @commands, "$samtools rmdup $raw_bam.sort.bam $rmdup_bam";
39
40 diff --git a/sci-biology/reapr/files/use_shared_libs.patch b/sci-biology/reapr/files/use_shared_libs.patch
41 new file mode 100644
42 index 0000000..b748c7e
43 --- /dev/null
44 +++ b/sci-biology/reapr/files/use_shared_libs.patch
45 @@ -0,0 +1,252 @@
46 +Description: Use_shared_libs
47 +--- a/src/Makefile
48 ++++ b/src/Makefile
49 +@@ -1,7 +1,6 @@
50 +-BAMTOOLS_ROOT = $(CURDIR)/bamtools
51 + CC = g++
52 +-CFLAGS = -Wl,-rpath,$(BAMTOOLS_ROOT)/lib -Wall -O3 -I $(BAMTOOLS_ROOT)/include -L $(BAMTOOLS_ROOT)/lib
53 +-TABIX = tabix/tabix.o -L./tabix -ltabix -lz
54 ++CFLAGS = -Wall -O3 -I /usr/include/bamtools -I /usr/include
55 ++TABIX = -ltabix -lhts -lz
56 + STATS_OBJS = trianglePlot.o coveragePlot.o fasta.o histogram.o utils.o
57 + SCORE_OBJS = errorWindow.o utils.o histogram.o
58 + BREAK_OBJS = fasta.o utils.o
59 +@@ -35,46 +34,46 @@
60 + $(CC) $(CFLAGS) -c histogram.cpp
61 +
62 + utils.o: utils.cpp
63 +- $(CC) $(CFLAGS) -lbamtools -c utils.cpp
64 ++ $(CC) $(CFLAGS) -c utils.cpp
65 +
66 + task_stats: task_stats.o $(STATS_OBJS)
67 +- $(CC) $(CFLAGS) task_stats.o $(STATS_OBJS) -lbamtools -o task_stats $(TABIX)
68 ++ $(CC) $(CFLAGS) task_stats.o $(STATS_OBJS) -lbamtools $(TABIX) -o task_stats
69 +
70 + task_stats.o: task_stats.cpp $(STATS_OBJS)
71 + $(CC) $(CFLAGS) -c task_stats.cpp
72 +
73 + task_score: task_score.o $(SCORE_OBJS)
74 +- $(CC) $(CFLAGS) task_score.o $(SCORE_OBJS) -lbamtools -o task_score $(TABIX)
75 ++ $(CC) -o task_score $(CFLAGS) task_score.o $(SCORE_OBJS) -lbamtools $(TABIX)
76 +
77 + task_score.o: task_score.cpp $(SCORE_OBJS)
78 + $(CC) $(CFLAGS) -c task_score.cpp
79 +
80 + task_break: task_break.o $(BREAK_OBJS)
81 +- $(CC) $(CFLAGS) task_break.o $(BREAK_OBJS) -lbamtools -o task_break $(TABIX)
82 ++ $(CC) $(CFLAGS) task_break.o $(BREAK_OBJS) -lbamtools $(TABIX) -o task_break
83 +
84 + task_break.o: task_break.cpp $(BREAK_OBJS)
85 + $(CC) $(CFLAGS) -c task_break.cpp
86 +
87 + bam2fragCov: bam2fragCov.o $(BAM2COV_OBJS)
88 +- $(CC) $(CFLAGS) bam2fragCov.o $(BAM2COV_OBJS) -lbamtools -o bam2fragCov $(TABIX)
89 ++ $(CC) $(CFLAGS) bam2fragCov.o $(BAM2COV_OBJS) $(TABIX) -lbamtools -o bam2fragCov
90 +
91 + bam2fragCov.o: bam2fragCov.cpp $(BAM2COV_OBJS)
92 + $(CC) $(CFLAGS) -c bam2fragCov.cpp
93 +
94 + bam2insert: bam2insert.o $(BAM2INSERT_OBJS)
95 +- $(CC) $(CFLAGS) bam2insert.o $(BAM2INSERT_OBJS) -lbamtools -o bam2insert $(TABIX)
96 ++ $(CC) $(CFLAGS) bam2insert.o $(BAM2INSERT_OBJS) $(TABIX) -lbamtools -o bam2insert
97 +
98 + bam2insert.o: bam2insert.cpp $(BAM2INSERT_OBJS)
99 + $(CC) $(CFLAGS) -c bam2insert.cpp
100 +
101 + bam2perfect: bam2perfect.o $(BAM2PERFECT_OBJS)
102 +- $(CC) $(CFLAGS) bam2perfect.o $(BAM2PERFECT_OBJS) -lbamtools -o bam2perfect $(TABIX)
103 ++ $(CC) $(CFLAGS) bam2perfect.o $(BAM2PERFECT_OBJS) $(TABIX) -lbamtools -o bam2perfect
104 +
105 + bam2perfect.o: bam2perfect.cpp $(BAM2PERFECT_OBJS)
106 + $(CC) $(CFLAGS) -c bam2perfect.cpp
107 +
108 + bam2fcdEstimate: bam2fcdEstimate.o $(BAM2FCDESTIMATE_OBJS)
109 +- $(CC) $(CFLAGS) bam2fcdEstimate.o $(BAM2FCDESTIMATE_OBJS) -lbamtools -o bam2fcdEstimate $(TABIX)
110 ++ $(CC) $(CFLAGS) bam2fcdEstimate.o $(TABIX) $(BAM2FCDESTIMATE_OBJS) -o bam2fcdEstimate
111 +
112 + bam2fcdEstimate.o: bam2fcdEstimate.cpp $(BAM2FCDESTIMATE_OBJS)
113 + $(CC) $(CFLAGS) -c bam2fcdEstimate.cpp
114 +@@ -110,13 +109,13 @@
115 + $(CC) $(CFLAGS) -c scaff2contig.cpp
116 +
117 + task_gapresize: task_gapresize.o $(GAPRESIZE_OBJS)
118 +- $(CC) $(CFLAGS) task_gapresize.o $(GAPRESIZE_OBJS) -lbamtools -o task_gapresize $(TABIX)
119 ++ $(CC) $(CFLAGS) task_gapresize.o $(TABIX) $(GAPRESIZE_OBJS) -o task_gapresize
120 +
121 + task_gapresize.o: task_gapresize.cpp $(GAPRESIZE_OBJS)
122 + $(CC) $(CFLAGS) -c task_gapresize.cpp
123 +
124 + task_fcdrate: task_fcdrate.o $(FCDRATE_OBJS)
125 +- $(CC) $(CFLAGS) task_fcdrate.o $(FCDRATE_OBJS) -lbamtools -o task_fcdrate $(TABIX)
126 ++ $(CC) $(CFLAGS) task_fcdrate.o $(TABIX) $(FCDRATE_OBJS) -o task_fcdrate
127 +
128 + task_fcdrate.o: task_fcdrate.cpp $(FCDRATE_OBJS)
129 + $(CC) $(CFLAGS) -c task_fcdrate.cpp
130 +--- a/src/task_break.cpp
131 ++++ b/src/task_break.cpp
132 +@@ -10,7 +10,6 @@
133 + #include <assert.h>
134 + #include "fasta.h"
135 + #include "utils.h"
136 +-#include "tabix/tabix.hpp"
137 +
138 + using namespace std;
139 +
140 +--- a/src/task_score.cpp
141 ++++ b/src/task_score.cpp
142 +@@ -18,7 +18,6 @@
143 + #include "histogram.h"
144 + #include "api/BamMultiReader.h"
145 + #include "api/BamReader.h"
146 +-#include "tabix/tabix.hpp"
147 +
148 + using namespace BamTools;
149 + using namespace std;
150 +--- a/src/task_stats.cpp
151 ++++ b/src/task_stats.cpp
152 +@@ -18,7 +18,6 @@
153 + #include "utils.h"
154 + #include "api/BamMultiReader.h"
155 + #include "api/BamReader.h"
156 +-#include "tabix/tabix.hpp"
157 +
158 + using namespace BamTools;
159 + using namespace std;
160 +--- a/src/utils.h
161 ++++ b/src/utils.h
162 +@@ -11,7 +11,7 @@
163 +
164 + #include "api/BamMultiReader.h"
165 + #include "api/BamReader.h"
166 +-#include "tabix/tabix.hpp"
167 ++#include "tabix.hpp"
168 +
169 + const short INNIE = 1;
170 + const short OUTTIE = 2;
171 +--- a/src/task_fcdrate.cpp
172 ++++ b/src/task_fcdrate.cpp
173 +@@ -9,7 +9,6 @@
174 +
175 + #include "utils.h"
176 + #include "histogram.h"
177 +-#include "tabix/tabix.hpp"
178 +
179 + using namespace std;
180 +
181 +--- a/src/reapr.pl
182 ++++ b/src/reapr.pl
183 +@@ -12,8 +12,8 @@
184 + $this_script = File::Spec->rel2abs($this_script);
185 + my ($scriptname, $scriptdir) = fileparse($this_script);
186 + $scriptdir = File::Spec->rel2abs($scriptdir);
187 +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix');
188 +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip');
189 ++my $tabix = 'tabix';
190 ++my $bgzip = 'bgzip';
191 + my $version = '1.0.18';
192 +
193 + if ($#ARGV == -1) {
194 +--- a/src/task_preprocess.pl
195 ++++ b/src/task_preprocess.pl
196 +@@ -52,9 +52,9 @@
197 + my $ideal_fcd_file = File::Spec->catfile($sample_dir, 'ideal_fcd.txt');
198 + my $lowess_prefix = File::Spec->catfile($sample_dir, 'gc_vs_cov.lowess');
199 + my $r_script = File::Spec->catfile($sample_dir, 'gc_vs_cov.R');
200 +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix');
201 +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip');
202 +-my $samtools = File::Spec->catfile($scriptdir, 'samtools');
203 ++my $tabix = 'tabix';
204 ++my $bgzip = 'bgzip';
205 ++my $samtools = 'samtools';
206 +
207 + # make directory and soft links to required files
208 + $fasta_in = File::Spec->rel2abs($fasta_in);
209 +--- a/src/task_perfectfrombam.pl
210 ++++ b/src/task_perfectfrombam.pl
211 +@@ -57,12 +57,12 @@
212 + my $min_perfect_map_qual = $ARGV[5];
213 + my $min_align_score = $ARGV[6];
214 + my $bam2perfect = File::Spec->catfile($scriptdir, 'bam2perfect');
215 +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip');
216 +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix');
217 ++my $bgzip = 'bgzip';
218 ++my $tabix = 'tabix';
219 + my $ERROR_PREFIX = '[REAPR perfectfrombam]';
220 + my $perfect_bam = "$out_prefix.tmp.perfect.bam";
221 + my $repetitive_bam = "$out_prefix.tmp.repetitive.bam";
222 +-my $samtools = File::Spec->catfile($scriptdir, 'samtools');
223 ++my $samtools = 'samtools';
224 + my %seq_lengths;
225 + my %used_seqs;
226 + my $hist_file = "$out_prefix.hist";
227 +--- a/src/task_perfectmap.pl
228 ++++ b/src/task_perfectmap.pl
229 +@@ -38,14 +38,14 @@
230 + my $reads_2 = $ARGV[2];
231 + my $fragsize = $ARGV[3];
232 + my $preout = $ARGV[4];
233 +-my $findknownsnps = File::Spec->catfile($scriptdir, 'findknownsnps');
234 ++my $findknownsnps = 'findknownsnps';
235 + my $ERROR_PREFIX = '[REAPR perfect_map]';
236 + my $raw_coverage_file = "$preout.tmp.cov.txt";
237 + my $tmp_bin = "$preout.tmp.bin";
238 + my $tmp_bin_single_match = "$tmp_bin\_single_match.fastq";
239 +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix');
240 +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip');
241 +-my $samtools = File::Spec->catfile($scriptdir, 'samtools');
242 ++my $tabix = 'tabix';
243 ++my $bgzip = 'bgzip';
244 ++my $samtools = 'samtools';
245 + my $all_bases_outfile = "$preout.perfect_cov.gz";
246 + my $hist_outfile = "$preout.hist";
247 + my @coverage = (0) x 101;
248 +--- a/src/task_plots.pl
249 ++++ b/src/task_plots.pl
250 +@@ -50,9 +50,9 @@
251 + }
252 +
253 +
254 +-my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix');
255 +-my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip');
256 +-my $samtools = File::Spec->catfile($scriptdir, 'samtools');
257 ++my $tabix = 'tabix';
258 ++my $bgzip = 'bgzip';
259 ++my $samtools = 'samtools';
260 + my @plot_list = ('frag_cov', 'frag_cov_cor', 'read_cov', 'read_ratio_f', 'read_ratio_r', 'clip', 'FCD_err');
261 + my @file_list;
262 + my $fa_out = "$outprefix.ref.fa";
263 +--- a/src/task_pipeline.pl
264 ++++ b/src/task_pipeline.pl
265 +@@ -9,7 +9,7 @@
266 +
267 + my ($scriptname, $scriptdir) = fileparse($0);
268 + my $reapr_dir = abs_path(File::Spec->catfile($scriptdir, File::Spec->updir()));
269 +-my $reapr = File::Spec->catfile($reapr_dir, 'reapr');
270 ++my $reapr = 'reapr';
271 +
272 + my %options = (fcdcut => 0);
273 +
274 +--- a/src/task_seqrename.pl
275 ++++ b/src/task_seqrename.pl
276 +@@ -7,7 +7,7 @@
277 + use Getopt::Long;
278 +
279 + my ($scriptname, $scriptdir) = fileparse($0);
280 +-my $samtools = File::Spec->catfile($scriptdir, 'samtools');
281 ++my $samtools = 'samtools';
282 + my %options;
283 + my $usage = qq/<rename file> <in.bam> <out.bam>
284 +
285 +--- a/src/task_smaltmap.pl
286 ++++ b/src/task_smaltmap.pl
287 +@@ -77,8 +77,8 @@
288 + my $reads_2 = $ARGV[2];
289 + my $final_bam = $ARGV[3];
290 + my $ERROR_PREFIX = '[REAPR smaltmap]';
291 +-my $samtools = File::Spec->catfile($scriptdir, 'samtools');
292 +-my $smalt = File::Spec->catfile($scriptdir, 'smalt');
293 ++my $samtools = 'samtools';
294 ++my $smalt = 'smalt';
295 + my $tmp_prefix = "$final_bam.tmp.$$.smaltmap";
296 + my $smalt_index = "$tmp_prefix.smalt_index";
297 + my $smalt_sample = "$tmp_prefix.smalt_sample";
298
299 diff --git a/sci-biology/reapr/reapr-1.0.18.ebuild b/sci-biology/reapr/reapr-1.0.18.ebuild
300 index 312219a..893af8b 100644
301 --- a/sci-biology/reapr/reapr-1.0.18.ebuild
302 +++ b/sci-biology/reapr/reapr-1.0.18.ebuild
303 @@ -2,7 +2,9 @@
304 # Distributed under the terms of the GNU General Public License v2
305 # $Id$
306
307 -EAPI=5
308 +EAPI=6
309 +
310 +inherit eutils
311
312 DESCRIPTION="Verify and correct genome assembly scaffolds using paired-end reads"
313 HOMEPAGE="http://www.sanger.ac.uk/science/tools/reapr"
314 @@ -11,7 +13,7 @@ SRC_URI="ftp://ftp.sanger.ac.uk/pub/resources/software/reapr/Reapr_${PV}.tar.gz
315
316 LICENSE="GPL-3"
317 SLOT="0"
318 -KEYWORDS="" # does not link against -lbamtools
319 +KEYWORDS=""
320 IUSE=""
321
322 # tested smalt versions 0.6.4 to 0.7.0.1 only
323 @@ -28,11 +30,15 @@ RDEPEND="${DEPEND}"
324
325 S="${WORKDIR}"/Reapr_"${PV}"
326
327 +# we use temporarily patches from https://anonscm.debian.org/cgit/debian-med/reapr.git/tree/debian/patches
328 +
329 src_prepare(){
330 + default
331 + for f in "${FILESDIR}"/*.patch; do epatch $f || die; done
332 sed -e 's#^CC = g++#CXX ?= g++#' -i src/Makefile || die
333 sed -e 's#$(CC)#$(CXX)#' -i src/Makefile || die
334 sed -e 's#-O3##' -i src/Makefile || die
335 - sed -e 's#^CFLAGS =#CXXFLAGS += -I../third_party/bamtools/src -L../third_party/bamtools/src#' -i src/Makefile || die
336 + 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
337 #sed -e 's#-lbamtools#../third_party/bamtools/src/libbamtools.so#' -i src/Makefile || die
338 sed -e 's#-ltabix#../third_party/tabix/libtabix.a#' -i src/Makefile || die
339 sed -e 's#CFLAGS#CXXFLAGS#' -i src/Makefile || die