[med-svn] [reapr] 05/11: introduce build-time tests

Sascha Steinbiss sascha at steinbiss.name
Thu Feb 25 11:12:26 UTC 2016


This is an automated email from the git hooks/post-receive script.

sascha-guest pushed a commit to branch master
in repository reapr.

commit 508c7b24d0a4b223dbd13ebf0920b8600a248610
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Thu Feb 25 10:50:04 2016 +0000

    introduce build-time tests
---
 debian/control                 | 12 +++++--
 debian/links                   |  6 ----
 debian/patches/use_shared_libs | 77 ++++++++++++++++++++++++++++++++----------
 debian/rules                   | 15 +++++---
 4 files changed, 80 insertions(+), 30 deletions(-)

diff --git a/debian/control b/debian/control
index 7226184..2d252f3 100644
--- a/debian/control
+++ b/debian/control
@@ -8,8 +8,15 @@ Build-Depends: debhelper (>= 9),
                libtabixpp-dev,
                libhts-dev (>= 1.3),
                zlib1g-dev,
-               ruby-ronn
-Standards-Version: 3.9.6
+               ruby-ronn,
+               samtools (>= 1.3),
+               bamtools,
+               smalt,
+               r-base,
+               snpomatic,
+               tabix,
+               libfile-copy-link-perl
+Standards-Version: 3.9.7
 Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/reapr.git
 Vcs-Git: https://anonscm.debian.org/git/debian-med/reapr.git
 Testsuite: autopkgtest
@@ -25,6 +32,7 @@ Depends: ${shlibs:Depends},
          r-base,
          snpomatic,
          tabix,
+         libtabixpp0,
          libfile-copy-link-perl
 Description: universal tool for genome assembly evaluation
  REAPR is a tool that evaluates the accuracy of a genome assembly using mapped
diff --git a/debian/links b/debian/links
index 7556858..36506a9 100644
--- a/debian/links
+++ b/debian/links
@@ -1,7 +1 @@
 /usr/lib/reapr/reapr.pl /usr/bin/reapr
-/usr/bin/findknownsnps /usr/lib/reapr/findknownsnps
-/usr/bin/tabix /usr/lib/reapr/tabix
-/usr/bin/bgzip /usr/lib/reapr/bgzip
-/usr/bin/smalt /usr/lib/reapr/smalt
-/usr/bin/samtools /usr/lib/reapr/samtools
-/usr/bin/bamtools /usr/lib/reapr/bamtools
diff --git a/debian/patches/use_shared_libs b/debian/patches/use_shared_libs
index 2090649..76e6df2 100644
--- a/debian/patches/use_shared_libs
+++ b/debian/patches/use_shared_libs
@@ -141,63 +141,80 @@ Description: Use_shared_libs
  $scriptdir = File::Spec->rel2abs($scriptdir);
 -my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix');
 -my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip');
-+my $tabix = File::Spec->catfile($scriptdir, 'tabix');
-+my $bgzip = File::Spec->catfile($scriptdir, '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,8 +52,8 @@
+@@ -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 $tabix = File::Spec->catfile($scriptdir, 'tabix');
-+my $bgzip = File::Spec->catfile($scriptdir, 'bgzip');
- my $samtools = File::Spec->catfile($scriptdir, 'samtools');
+-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,8 +57,8 @@
+@@ -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 = File::Spec->catfile($scriptdir, 'bgzip');
-+my $tabix = File::Spec->catfile($scriptdir, '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
-@@ -43,8 +43,8 @@
+@@ -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 $tabix = File::Spec->catfile($scriptdir, 'tabix');
-+my $bgzip = File::Spec->catfile($scriptdir, 'bgzip');
- my $samtools = File::Spec->catfile($scriptdir, 'samtools');
+-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,8 +50,8 @@
+@@ -50,9 +50,9 @@
  }
  
  
 -my $tabix = File::Spec->catfile($scriptdir, 'tabix/tabix');
 -my $bgzip = File::Spec->catfile($scriptdir, 'tabix/bgzip');
-+my $tabix = File::Spec->catfile($scriptdir, 'tabix');
-+my $bgzip = File::Spec->catfile($scriptdir, 'bgzip');
- my $samtools = File::Spec->catfile($scriptdir, 'samtools');
+-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 @@
@@ -205,7 +222,31 @@ Description: Use_shared_libs
  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 = '/usr/bin/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/debian/rules b/debian/rules
index cd67a89..0a5be53 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,18 +11,25 @@ override_dh_auto_build:
 
 override_dh_auto_install:
 	mkdir -p debian/reapr/usr/lib/reapr
-	cp src/reapr.pl debian/reapr/usr/lib/reapr/reapr.pl
+	install src/reapr.pl debian/reapr/usr/lib/reapr/reapr.pl
 	chmod -x src/*.cpp
-	find src -executable -exec cp {} debian/reapr/usr/lib/reapr \;
+	find src -executable -exec install {} debian/reapr/usr/lib/reapr \;
 	dh_auto_install --
 
 override_dh_installman:
 	mkdir -p $(mandir)
 	ronn $(debfolder)/man_src/*.ronn
-	cp $(debfolder)/man_src/*.? $(mandir)
+	install $(debfolder)/man_src/*.? $(mandir)
 	dh_installman --
 
 override_dh_auto_clean:
 	rm -rf $(debfolder)/man_src/*.html $(debfolder)/man_src/*.?
 	rm -rf $(mandir)
-	dh_auto_clean --
\ No newline at end of file
+	rm -rf $(debfolder)/test
+	dh_auto_clean --
+
+override_dh_auto_test:
+	mkdir $(debfolder)/test
+	ln -s $(CURDIR)/src/reapr.pl $(debfolder)/test/reapr
+	PATH=$(PATH):$(CURDIR)/src:$(debfolder)/test $(debfolder)/tests/test-example
+	rm -rf $(debfolder)/test

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/reapr.git



More information about the debian-med-commit mailing list