in progress
authorcmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 1 Aug 2012 18:09:33 +0000 (18:09 +0000)
committercmzmasek <cmzmasek@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 1 Aug 2012 18:09:33 +0000 (18:09 +0000)
forester/java/src/org/forester/application/surfacing.java
forester/java/src/org/forester/surfacing/DomainCountsDifferenceUtil.java
forester/java/src/org/forester/surfacing/SurfacingUtil.java

index f89d248..dd3f020 100644 (file)
@@ -235,8 +235,8 @@ public class surfacing {
     final static private String                               INPUT_SPECIES_TREE_OPTION                                                     = "species_tree";
     final static private String                               SEQ_EXTRACT_OPTION                                                            = "prot_extract";
     final static private char                                 SEPARATOR_FOR_INPUT_VALUES                                                    = '#';
-    final static private String                               PRG_VERSION                                                                   = "2.251";
-    final static private String                               PRG_DATE                                                                      = "2012.07.13";
+    final static private String                               PRG_VERSION                                                                   = "2.252";
+    final static private String                               PRG_DATE                                                                      = "2012.08.01";
     final static private String                               E_MAIL                                                                        = "czmasek@burnham.org";
     final static private String                               WWW                                                                           = "www.phylosoft.org/forester/applications/surfacing";
     final static private boolean                              IGNORE_DUFS_DEFAULT                                                           = true;
@@ -2327,10 +2327,11 @@ public class surfacing {
                                       protein_lists_per_species,
                                       domain_id_to_go_ids_map,
                                       go_id_to_term_map,
-                                      plus_minus_analysis_numbers );
+                                      plus_minus_analysis_numbers
+                                       );
         }
         if ( output_protein_lists_for_all_domains ) {
-            writeProteinListsForAllSpecies( out_dir, protein_lists_per_species, gwcd_list );
+            writeProteinListsForAllSpecies( out_dir, protein_lists_per_species, gwcd_list, 1.0 );
         }
         //        if ( ( intrees != null ) && ( intrees.length > 0 ) && ( inferred_trees != null ) && ( inferred_trees.size() > 0 ) ) {
         //            final StringBuilder parameters_sb = createParametersAsString( ignore_dufs,
@@ -2810,7 +2811,8 @@ public class surfacing {
 
     private static void writeProteinListsForAllSpecies( final File output_dir,
                                                         final SortedMap<Species, List<Protein>> protein_lists_per_species,
-                                                        final List<GenomeWideCombinableDomains> gwcd_list ) {
+                                                        final List<GenomeWideCombinableDomains> gwcd_list,
+                                                        final double domain_e_cutoff ) {
         final SortedSet<DomainId> all_domains = new TreeSet<DomainId>();
         for( final GenomeWideCombinableDomains gwcd : gwcd_list ) {
             all_domains.addAll( gwcd.getAllDomainIds() );
@@ -2824,7 +2826,8 @@ public class surfacing {
                                                    domain,
                                                    proteins_file_writer,
                                                    "\t",
-                                                   LIMIT_SPEC_FOR_PROT_EX );
+                                                   LIMIT_SPEC_FOR_PROT_EX,
+                                                    domain_e_cutoff );
                 proteins_file_writer.close();
             }
             catch ( final IOException e ) {
index fef82fa..c3691bf 100644 (file)
@@ -829,7 +829,8 @@ public final class DomainCountsDifferenceUtil {
                                            domain_id,
                                            proteins_file_writer,
                                            "\t",
-                                           surfacing.LIMIT_SPEC_FOR_PROT_EX );
+                                           surfacing.LIMIT_SPEC_FOR_PROT_EX,
+                                           -1 );
         proteins_file_writer.close();
         System.out.println( "Wrote proteins list to \"" + my_proteins_file + "\"" );
     }
index 1774cc6..4fa94f6 100644 (file)
@@ -1186,7 +1186,8 @@ public final class SurfacingUtil {
                                             final DomainId domain_id,
                                             final Writer out,
                                             final String separator,
-                                            final String limit_to_species ) throws IOException {
+                                            final String limit_to_species,
+                                            final double domain_e_cutoff ) throws IOException {
         for( final Species species : protein_lists_per_species.keySet() ) {
             for( final Protein protein : protein_lists_per_species.get( species ) ) {
                 if ( ForesterUtil.isEmpty( limit_to_species )
@@ -1200,19 +1201,29 @@ public final class SurfacingUtil {
                         out.write( domain_id.toString() );
                         out.write( separator );
                         for( final Domain domain : domains ) {
-                            out.write( "/" );
-                            out.write( domain.getFrom() + "-" + domain.getTo() );
+                            if ( domain_e_cutoff < 0 || domain.getPerDomainEvalue() <= domain_e_cutoff ) {
+                                 out.write( "/" );
+                                 out.write( domain.getFrom() + "-" + domain.getTo() );
+                            }
                         }
                         out.write( "/" );
                         out.write( separator );
                         
-                        Domain domain_ary[] = new Domain[ protein.getProteinDomains().size() ];
+                        final List<Domain> domain_list = new ArrayList<Domain>();
+                        
+                        for( final Domain domain : protein.getProteinDomains() ) {
+                            if ( domain_e_cutoff < 0 || domain.getPerDomainEvalue() <= domain_e_cutoff ) {
+                                domain_list.add( domain );
+                            }
+                        }
+                        
+                        Domain domain_ary[] = new Domain[ domain_list.size() ];
                         
-                        for( int i = 0; i < protein.getProteinDomains().size(); ++i ) {
-                            domain_ary[ i ] = protein.getProteinDomains().get( i );
+                        for( int i = 0; i < domain_list.size(); ++i ) {
+                            domain_ary[ i ] = domain_list.get( i );
                         }
                         
-                        Arrays.sort( domain_ary, new DomainComparator( false ) );
+                        Arrays.sort( domain_ary, new DomainComparator( true ) );
                        
                         out.write( "{" );
                         boolean first = true;
@@ -1225,10 +1236,8 @@ public final class SurfacingUtil {
                                 out.write( "," );
                             }
                             out.write( domain.getDomainId().toString() );
-                            out.write( ":" );
-                            out.write( domain.getFrom() );
-                            out.write( "-" );
-                            out.write( domain.getTo() );
+                            out.write( ":" + domain.getFrom() +  "-" + domain.getTo() );
+                            out.write( ":" + domain.getPerDomainEvalue() );
                         }
                         out.write( "}" );
                         if ( !( ForesterUtil.isEmpty( protein.getDescription() ) || protein.getDescription()