[med-svn] [Git][med-team/psortb][upstream] New upstream version 3.0.6+dfsg

Andreas Tille gitlab at salsa.debian.org
Wed Sep 26 21:07:21 BST 2018


Andreas Tille pushed to branch upstream at Debian Med / psortb


Commits:
9497b2a1 by Andreas Tille at 2018-09-26T19:53:00Z
New upstream version 3.0.6+dfsg
- - - - -


1 changed file:

- psort/bin/psort


Changes:

=====================================
psort/bin/psort
=====================================
@@ -1,13 +1,15 @@
 #! /usr/bin/perl
 
+use IO::String;
+use Getopt::Long;
+#use Data::Dumper;
+
+use lib '../lib';
 use Bio::Tools::PSort::Report::Formatter;
 use Bio::Tools::PSort;
 use Bio::SeqIO;
 use Bio::Tools::PSort::Constants qw(:all);
 
-use Getopt::Long;
-use Data::Dumper;
-
 use strict;
 
 our $ENV;
@@ -59,8 +61,8 @@ MAIN: {
   my $psort_analysis = 'psort';
   my $psort_output = 'bayes';
 
-  my $root = '/usr/local/psortb-3.0';
-  my $blastdir = '/usr/local/bio/blast';
+  my $root = '/usr/local/psortb3';
+  my $blastdir = '/usr/local/pkg/blast-2.2.26//bin';
   my $pftools = '/usr/local/bin/';
   my $pfscan_module = 'Profile';
 
@@ -361,11 +363,10 @@ MAIN: {
 						      ['CWSVM_a', sub {1},
 						       ['Signal_a']
 						      ]]]]]]]]]);  # add a bracket back later
-   } else {
-	die "We should never be here.\n";
+    } else {
+      die "We should never be here.\n";
     }
 
-
   } else {
     # Create a new PSort object.
     print(STDERR "* Using \"$server\" as remote PSort server\n")
@@ -378,18 +379,19 @@ MAIN: {
 
   # Figure out whether or not we're getting the sequences from a file or from
   # STDIN and open up a Bio::SeqIO on it.
+  my $seqfh;
   if($fname) {
     if((-f $fname) && (-r $fname)) {
       print(STDERR "* Reading sequences from file \"$fname\"\n") if($verbose);
-      open(SEQS, $fname) || die("Error: open $fname: $!\n");
-      $sio = new Bio::SeqIO(-fh => \*SEQS, -format => $format);
+      $seqfh = make_seq_input_uppercase($fname);
     } else {
       die("Error: file \"$fname\" doesn't exist or isn't readable\n");
     }
   } else {
     print(STDERR "* Reading sequences from STDIN\n") if($verbose);
-    $sio = new Bio::SeqIO(-fh => \*STDIN, -format => $format);
+    $seqfh = make_seq_input_uppercase();
   }
+  $sio = new Bio::SeqIO(-fh => $seqfh, -format => $format);
 
   # Ready for prime time - go forth and PSort.
   my $format = new Bio::Tools::PSort::Report::Formatter();
@@ -404,3 +406,35 @@ MAIN: {
   }
   print($format->format($output, {-cutoff => $cutoff, -gram => $gram, -mcutoff => $divergent, -psort => $psort, -skiplocalizations => \@skippedlocalizations}, @reps));
 }
+
+sub make_seq_input_uppercase {
+
+    my $fname = shift;
+
+    my $seqinput;
+    if (defined $fname) {
+      open(SEQS, $fname) || die("Error: open $fname: $!\n");
+      #$seqinput = <SEQS>;
+      $seqinput = do { local $/; <SEQS> };
+    } 
+    else {
+      $seqinput = <>;
+    }
+
+    # hack to convert sequences (not headers) to uppercase (lowercase 
+    # seems to bring back no psortb results)
+    my @seqs2uc = split(">", $seqinput);
+    shift(@seqs2uc); # remove blank first element (after doing split on > where > is the first character)
+
+    my $uc_seqs;
+    foreach my $header_seq (@seqs2uc) {
+      my ($h1, $s1) = split(/[\n\r]+/, $header_seq, 2);
+      if ($s1 =~ /[a-z]/) {
+        $s1 = uc($s1);
+      }
+      $uc_seqs .= ">$h1\n$s1";
+    }
+    
+    my $seqfh = new IO::String($uc_seqs);
+    return($seqfh);
+}



View it on GitLab: https://salsa.debian.org/med-team/psortb/commit/9497b2a1db6dbb5e1d7acb873c6323c82b4858d9

-- 
View it on GitLab: https://salsa.debian.org/med-team/psortb/commit/9497b2a1db6dbb5e1d7acb873c6323c82b4858d9
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20180926/c0177389/attachment-0001.html>


More information about the debian-med-commit mailing list