inprogress
[jalview.git] / forester / ruby / evoruby / lib / evo / tool / hmmscan_summary.rb
index 913be50..55ba7a4 100644 (file)
@@ -67,7 +67,7 @@ module Evoruby
       end
 
       if ( cla.is_option_set?( HELP_OPTION_1 ) ||
-            cla.is_option_set?( HELP_OPTION_2 ) )
+           cla.is_option_set?( HELP_OPTION_2 ) )
         print_help
         exit( 0 )
       end
@@ -118,7 +118,7 @@ module Evoruby
         end
       end
 
-      
+
 
       fs_e_value_threshold = -1.0
       if ( cla.is_option_set?( FS_E_VALUE_THRESHOLD_OPTION ) )
@@ -151,7 +151,7 @@ module Evoruby
       end
 
       species = "HUMAN"
-       if ( cla.is_option_set?( SPECIES_OPTION ) )
+      if ( cla.is_option_set?( SPECIES_OPTION ) )
         begin
           species = cla.get_option_value( SPECIES_OPTION )
         rescue ArgumentError => e
@@ -279,21 +279,21 @@ module Evoruby
         env_to    = r.env_to
 
         if ( ( i_e_value_threshold < 0.0 ) || ( i_e_value <= i_e_value_threshold ) ) &&
-            ( !ignore_dufs || ( model !~ /^DUF\d+/ ) )
+           ( !ignore_dufs || ( model !~ /^DUF\d+/ ) )
           count_model( model )
           outfile.print( query +
-              column_delimiter )
+             column_delimiter )
           if ( get_descriptions )
             outfile.print( desc +
-                column_delimiter )
+               column_delimiter )
           end
           outfile.print( model +
-              column_delimiter +
-              env_from.to_s +
-              column_delimiter +
-              env_to.to_s +
-              column_delimiter +
-              i_e_value.to_s )
+             column_delimiter +
+             env_from.to_s +
+             column_delimiter +
+             env_to.to_s +
+             column_delimiter +
+             i_e_value.to_s )
           outfile.print( Constants::LINE_DELIMITER )
         end
 
@@ -304,7 +304,8 @@ module Evoruby
                 fs_e_value_threshold,
                 hmm_for_protein_output,
                 i_e_value_threshold,
-                true )
+                false,
+                species )
             end
             hmmscan_results_per_protein.clear
           end
@@ -319,12 +320,14 @@ module Evoruby
           end
         end
       end
+
       if !hmm_for_protein_output.empty? && !hmmscan_results_per_protein.empty?
         process_hmmscan_results_per_protein( hmmscan_results_per_protein,
           fs_e_value_threshold,
           hmm_for_protein_output,
           i_e_value_threshold,
-          true )
+          false,
+          species )
       end
 
       outfile.flush()
@@ -355,7 +358,8 @@ module Evoruby
         fs_e_value_threshold,
         hmm_for_protein_output,
         i_e_value_threshold,
-        uniprotkb )
+        uniprotkb,
+        species )
 
       dc = 0
       # filter according to i-Evalue threshold
@@ -363,12 +367,15 @@ module Evoruby
       hmmscan_results_per_protein_filtered = []
 
       hmmscan_results_per_protein.each do | r |
+
+
+
         if r.model == hmm_for_protein_output
-          if r.fs_e_value > fs_e_value_threshold
+          if i_e_value_threshold >= 0.0 && r.fs_e_value > fs_e_value_threshold
             return
           end
         end
-        if r.i_e_value <= i_e_value_threshold
+        if i_e_value_threshold < 0 || r.i_e_value <= i_e_value_threshold
           hmmscan_results_per_protein_filtered << r
           if r.model == hmm_for_protein_output
             dc += 1
@@ -401,12 +408,13 @@ module Evoruby
         s << r.model + " "
       end
       s << "\t"
-      e = UniprotKB::get_entry_by_id( process_id( own.query ) )
 
-      if e != nil
-        s << uniprot_annotation( e )
-        s << "\uniprot_annotationt"
-      end
+      #e = UniprotKB::get_entry_by_id( process_id( own.query ) )
+
+      #if e != nil
+      #  s << uniprot_annotation( e )
+      # # s << "\uniprot_annotationt"
+      #end
 
       overview = make_overview( hmmscan_results_per_protein_filtered, hmm_for_protein_output )