[med-svn] r18649 - in trunk/packages/barrnap/trunk/debian: . patches

Sascha Steinbiss sascha-guest at moszumanska.debian.org
Fri Jan 30 21:51:34 UTC 2015


Author: sascha-guest
Date: 2015-01-30 21:51:33 +0000 (Fri, 30 Jan 2015)
New Revision: 18649

Added:
   trunk/packages/barrnap/trunk/debian/patches/use_both_hmmsets
   trunk/packages/barrnap/trunk/debian/series
Modified:
   trunk/packages/barrnap/trunk/debian/control
   trunk/packages/barrnap/trunk/debian/patches/series
Log:
add patch to use nonfree HMMs if given


Modified: trunk/packages/barrnap/trunk/debian/control
===================================================================
--- trunk/packages/barrnap/trunk/debian/control	2015-01-30 21:20:49 UTC (rev 18648)
+++ trunk/packages/barrnap/trunk/debian/control	2015-01-30 21:51:33 UTC (rev 18649)
@@ -11,7 +11,9 @@
 Package: barrnap
 Architecture: all
 Section: science
-Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends}, hmmer (>= 3.1)
+Depends: ${perl:Depends}, ${shlibs:Depends}, ${misc:Depends},
+ libfile-temp-perl, hmmer (>= 3.1)
+Suggests: barrnap-silva-hmms
 Description: rapid ribosomal RNA prediction
  Barrnap (BAsic Rapid Ribosomal RNA Predictor) predicts the location of
  ribosomal RNA genes in genomes. It supports bacteria (5S,23S,16S), archaea

Modified: trunk/packages/barrnap/trunk/debian/patches/series
===================================================================
--- trunk/packages/barrnap/trunk/debian/patches/series	2015-01-30 21:20:49 UTC (rev 18648)
+++ trunk/packages/barrnap/trunk/debian/patches/series	2015-01-30 21:51:33 UTC (rev 18649)
@@ -1 +1,2 @@
 use_debian_dirs
+use_both_hmmsets

Added: trunk/packages/barrnap/trunk/debian/patches/use_both_hmmsets
===================================================================
--- trunk/packages/barrnap/trunk/debian/patches/use_both_hmmsets	                        (rev 0)
+++ trunk/packages/barrnap/trunk/debian/patches/use_both_hmmsets	2015-01-30 21:51:33 UTC (rev 18649)
@@ -0,0 +1,133 @@
+--- a/bin/barrnap
++++ b/bin/barrnap
+@@ -4,8 +4,9 @@
+ use Time::Piece;
+ use List::Util qw(max);
+ use FindBin;
++use File::Temp qw/ tempfile tempdir /;
+ 
+-# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
++# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+ # global variables
+ 
+ my $EXE = $FindBin::RealScript;
+@@ -29,13 +30,13 @@
+ );
+ my $MAXLEN = int( 1.2 * max(values %LENG) );
+ 
+-# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
++# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+ # command line options
+ 
+ my(@Options, $quiet, $kingdom, $threads, $evalue, $lencutoff, $reject, $incseq);
+ setOptions();
+ 
+-# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
++# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+ # check all is well
+ 
+ msg("This is $EXE $VERSION");
+@@ -64,23 +65,38 @@
+ my $hmmdb = "$DBDIR/$kdom.hmm";
+ err("Can't find database: $hmmdb") unless -r $hmmdb;
+ msg("Using database: $hmmdb");
++my $nonfreehmmdb = "$DBDIR/nonfree/$kdom.hmm";
+ 
+-# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
++# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+ # run the external command
+ 
+ my $fasta = shift @ARGV;
+ $fasta && -r $fasta or err("Usage: $EXE <file.fasta>");
+ 
++if (-e $nonfreehmmdb)  {
++  # prepare full pHMM file (with nonfree if it exists)
++  open ( HMMDB, "<", $hmmdb ) or die "Could not open file $hmmdb: $!";
++  open ( NONFREE, "<", $nonfreehmmdb );
++  my ($tmpfile, $tmpfilename) = tempfile();
++  while ( my $line = <HMMDB> ) {
++    print $tmpfile $line;
++  }
++  while ( my $line = <NONFREE> ) {
++    print $tmpfile $line;
++  }
++  $hmmdb = $tmpfilename
++}
++
+ msg("Scanning $fasta for $kdom rRNA genes... please wait");
+ my $cmd = "$NHMMER --cpu $threads -E $evalue --w_length $MAXLEN  -o /dev/null --tblout /dev/stdout \Q$hmmdb\E \Q$fasta\E";
+ msg("Command: $cmd");
+ my @hits = qx($cmd 2>&1);
+ 
+-# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
++# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+ # process the output
+ 
+ my @feat;
+-HIT: 
++HIT:
+ foreach (@hits) {
+   chomp;
+   err("nhmmer failed to run - $_") if m/fail|error|core dump|bus error/i;
+@@ -102,7 +118,7 @@
+   # check for incomplete alignments
+   my $note = '';
+   my $len = $end-$begin+1;
+-  
++
+   if ( $len < int($reject * $LENG{$gene}) ) {
+     msg("Rejecting short $len nt predicted $gene. Adjust via --reject option.");
+     next HIT;
+@@ -120,7 +136,7 @@
+   ];
+ }
+ 
+-# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 
++# . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
+ # output a sorted GFF3
+ 
+ sub gff_sort {
+@@ -168,13 +184,13 @@
+ 
+ sub show_citation {
+   print STDERR << "EOCITE";
+-  
++
+ If you use Barrnap in your work, please cite:
+ 
+     Seemann T (2013)
+     $EXE $VERSION : $DESC
+     $URL
+-    
++
+ Thank you.
+ 
+ EOCITE
+@@ -193,7 +209,7 @@
+     {OPT=>"help",    VAR=>\&usage,             DESC=>"This help"},
+     {OPT=>"version", VAR=>\&version,           DESC=>"Print version and exit"},
+     {OPT=>"citation",VAR=>\&show_citation,     DESC=>"Print citation for referencing $EXE"},
+-    {OPT=>"kingdom=s", VAR=>\$kingdom,  DEFAULT=>'bac', 
++    {OPT=>"kingdom=s", VAR=>\$kingdom,  DEFAULT=>'bac',
+        DESC=>"Kingdom: ".join(' ', values %KINGDOM) },
+     {OPT=>"quiet!",  VAR=>\$quiet, DEFAULT=>0, DESC=>"No screen output"},
+     {OPT=>"threads=i",  VAR=>\$threads, DEFAULT=>8,  DESC=>"Number of threads/cores/CPUs to use"},
+@@ -226,15 +242,15 @@
+       my $def = defined($_->{DEFAULT}) ? " (default '$_->{DEFAULT}')" : "";
+       $def = ($def ? ' (default OFF)' : '(default ON)') if $_->{OPT} =~ m/!$/;
+       my $opt = $_->{OPT};
+-      $opt =~ s/!$//; 
+-      $opt =~ s/=s$/ [X]/; 
++      $opt =~ s/!$//;
++      $opt =~ s/=s$/ [X]/;
+       $opt =~ s/=i$/ [N]/;
+       $opt =~ s/=f$/ [n.n]/;
+       printf STDERR "  --%-15s %s%s\n", $opt, $_->{DESC}, $def;
+     }
+     else {
+       print STDERR "$_\n";
+-    }      
++    }
+   }
+   exit(1);
+ }

Added: trunk/packages/barrnap/trunk/debian/series
===================================================================
--- trunk/packages/barrnap/trunk/debian/series	                        (rev 0)
+++ trunk/packages/barrnap/trunk/debian/series	2015-01-30 21:51:33 UTC (rev 18649)
@@ -0,0 +1,2 @@
+use_debian_dirs
+use_both_hmmsets




More information about the debian-med-commit mailing list