Package: microbiomeutil / 20101212+dfsg1-4

enable_tests_in_local_dir.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
Author: Andreas Tille <tille@debian.org>
Last-Update: Wed, 20 Jan 2016 09:10:18 +0100
Description: To run build time tests enable running the scripts
 from build path

--- a/NAST-iEr/run_NAST-iEr.pl
+++ b/NAST-iEr/run_NAST-iEr.pl
@@ -8,6 +8,13 @@ use Getopt::Long;
 #use FindBin;
 ##Hack needed because FindBin is braindead.
 BEGIN{ $FindBin::Bin = "/usr/lib/NAST-iEr" };
+if ( ! -d $FindBin::Bin ) {
+	if ( -d "../../NAST-iEr" ) {
+		$FindBin::Bin = "../../NAST-iEr" ;
+	} else {
+		die("Directory $FindBin::Bin does not exist.");
+	}
+}
 use lib ("$FindBin::Bin/PerlLib");
 use Fasta_reader;
 use CdbTools;
@@ -15,8 +22,21 @@ use Nuc_translator;
 
 
 my $db_FASTA = "/usr/share/microbiomeutil-data/RESOURCES/rRNA16S.gold.fasta";
+if ( ! -e $db_FASTA ) {
+	if ( -e "../../RESOURCES/rRNA16S.gold.fasta" ) {
+		$db_FASTA = "../../RESOURCES/rRNA16S.gold.fasta" ;
+	} else {
+		die("File $db_FASTA does not exist.");
+	}
+}
 my $db_NAST = "/usr/share/microbiomeutil-data/RESOURCES/rRNA16S.gold.NAST_ALIGNED.fasta";
-
+if ( ! -e $db_NAST ) {
+        if ( -e "../../RESOURCES/rRNA16S.gold.NAST_ALIGNED.fasta" ) {
+                $db_NAST = "../../RESOURCES/rRNA16S.gold.NAST_ALIGNED.fasta" ;
+        } else {
+                die("File $db_NAST does not exist.");
+        }
+}
 
 my $usage = <<_EOUSAGE_;
 
--- a/NAST-iEr/sample_data/runMe.sh
+++ b/NAST-iEr/sample_data/runMe.sh
@@ -12,9 +12,9 @@ echo "../NAST-iEr -b template_seqs.NAST
 
 echo "converting NAST mfasta to multi-alignment output highlighting differences"
 echo "../show_malign_no_gap.pl --IGNOREGAPS tmp.both.NAST > tmp.both.NAST.malign\n\n"
-../util/show_malign_no_gap.pl --IGNOREGAPS tmp.both.NAST > tmp.both.NAST.malign
+perl -I../PerlLib ../util/show_malign_no_gap.pl --IGNOREGAPS tmp.both.NAST > tmp.both.NAST.malign
 
 
 echo "Run via the megablast wrapper"
-../run_NAST-iEr.pl --query_FASTA query_seq.fasta > tmp.mb_select.NAST
+perl -I../PerlLib ../run_NAST-iEr.pl --query_FASTA query_seq.fasta > tmp.mb_select.NAST
 
--- a/ChimeraSlayer/sample_data/runMe.sh
+++ b/ChimeraSlayer/sample_data/runMe.sh
@@ -1,9 +1,9 @@
 #!/bin/sh
 
 # remove any preexisting outputs from an earlier run.
-rm chims.NAST.CPS*
-rm tmp.*
+rm -f chims.NAST.CPS*
+rm -f tmp.*
 
-../ChimeraSlayer.pl --query_NAST chims.NAST --printCSalignments --printFinalAlignments 
+perl -I../PerlLib ../ChimeraSlayer.pl --query_NAST chims.NAST --printCSalignments --printFinalAlignments 
 
 
--- a/ChimeraSlayer/ChimeraSlayer.pl
+++ b/ChimeraSlayer/ChimeraSlayer.pl
@@ -7,6 +7,13 @@ use Getopt::Long qw(:config no_ignore_ca
 #use FindBin;
 #Hack needed because FindBin is braindead.
 BEGIN{ $FindBin::Bin = "/usr/lib/ChimeraSlayer" };
+if ( ! -d $FindBin::Bin ) {
+	if ( -d "../../ChimeraSlayer" ) {
+		$FindBin::Bin = "../../ChimeraSlayer" ;
+	} else {
+		die("Directory $FindBin::Bin does not exist.");
+	}
+}
 
 use lib ("$FindBin::Bin/PerlLib");
 use Fasta_reader;
@@ -14,7 +21,21 @@ use CdbTools;
 use File::Basename;
 
 my $db_NAST = "/usr/share/microbiomeutil-data/RESOURCES/rRNA16S.gold.NAST_ALIGNED.fasta";
+if ( ! -e $db_NAST ) {
+	if ( -e "../../RESOURCES/rRNA16S.gold.NAST_ALIGNED.fasta" ) {
+		$db_NAST = "../../RESOURCES/rRNA16S.gold.NAST_ALIGNED.fasta" ;
+	} else {
+		die("File $db_NAST does not exist.");
+	}
+}
 my $db_FASTA = "/usr/share/microbiomeutil-data/RESOURCES/rRNA16S.gold.fasta";
+if ( ! -e $db_FASTA ) {
+	if ( -e "../../RESOURCES/rRNA16S.gold.fasta" ) {
+		$db_FASTA = "../../RESOURCES/rRNA16S.gold.fasta" ;
+	} else {
+		die("File $db_FASTA does not exist.");
+	}
+}
 
 
 my $usage = <<_EOUSAGE_;
--- a/ChimeraSlayer/util/CS_add_taxonomy.pl
+++ b/ChimeraSlayer/util/CS_add_taxonomy.pl
@@ -13,7 +13,15 @@ use Fasta_reader;
 my %acc_to_taxonomy;
 
 {
-	my $fasta_reader = new Fasta_reader("/usr/share/microbiomeutil-data/RESOURCES/rRNA16S.gold.fasta");
+	my $db_FASTA = "/usr/share/microbiomeutil-data/RESOURCES/rRNA16S.gold.fasta";
+	if ( ! -e $db_FASTA ) {
+		if ( -e "../../RESOURCES/rRNA16S.gold.fasta" ) {
+			$db_FASTA = "../../RESOURCES/rRNA16S.gold.fasta" ;
+		} else {
+			die("File $db_FASTA does not exist.");
+		}
+	}
+	my $fasta_reader = new Fasta_reader($db_FASTA);
 	while (my $seq_obj = $fasta_reader->next()) {
 		my $acc = $seq_obj->get_accession;
 		
--- a/ChimeraSlayer/ChimeraParentSelector/chimeraParentSelector.pl
+++ b/ChimeraSlayer/ChimeraParentSelector/chimeraParentSelector.pl
@@ -655,7 +655,7 @@ sub report_alignment_trace {
 			}
 			
 			#print(  (" " x 26) . join ("", @$error_profile_aref) . "\n");
-			printf("%-25s $align_region\n", substr("$alignment_counter $acc", 0, 25), $align_region);
+			printf("%-25s $align_region\n", substr("$alignment_counter $acc", 0, 25));
 		}
 		
 		print "\n";