in progress
[jalview.git] / forester / java / src / org / forester / surfacing / SurfacingUtil.java
index a22bdad..ab83ebf 100644 (file)
@@ -58,6 +58,7 @@ import org.forester.evoinference.matrix.character.CharacterStateMatrix;
 import org.forester.evoinference.matrix.character.CharacterStateMatrix.BinaryStates;
 import org.forester.evoinference.matrix.character.CharacterStateMatrix.Format;
 import org.forester.evoinference.matrix.character.CharacterStateMatrix.GainLossStates;
+import org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix;
 import org.forester.evoinference.matrix.distance.DistanceMatrix;
 import org.forester.go.GoId;
 import org.forester.go.GoNameSpace;
@@ -373,7 +374,7 @@ public final class SurfacingUtil {
                 }
                 for( int i = 0; i < nodes.size() - 1; ++i ) {
                     for( int j = i + 1; j < nodes.size(); ++j ) {
-                        final PhylogenyNode lca = PhylogenyMethods.getInstance().obtainLCA( nodes.get( i ),
+                        final PhylogenyNode lca = PhylogenyMethods.obtainLCA( nodes.get( i ),
                                                                                             nodes.get( j ) );
                         String rank = "unknown";
                         if ( lca.getNodeData().isHasTaxonomy()
@@ -642,7 +643,7 @@ public final class SurfacingUtil {
     public static Phylogeny createNjTreeBasedOnMatrixToFile( final File nj_tree_outfile, final DistanceMatrix distance ) {
         checkForOutputFileWriteability( nj_tree_outfile );
         final NeighborJoining nj = NeighborJoining.createInstance();
-        final Phylogeny phylogeny = nj.execute( distance );
+        final Phylogeny phylogeny = nj.execute( ( BasicSymmetricalDistanceMatrix ) distance );
         phylogeny.setName( nj_tree_outfile.getName() );
         writePhylogenyToFile( phylogeny, nj_tree_outfile.toString() );
         return phylogeny;
@@ -1191,16 +1192,30 @@ public final class SurfacingUtil {
                         || protein.getSpecies().getSpeciesId().equalsIgnoreCase( limit_to_species ) ) {
                     final List<Domain> domains = protein.getProteinDomains( domain_id );
                     if ( domains.size() > 0 ) {
-                        final DescriptiveStatistics stats = new BasicDescriptiveStatistics();
-                        for( final Domain domain : domains ) {
-                            stats.addValue( domain.getPerSequenceEvalue() );
-                        }
                         out.write( protein.getSpecies().getSpeciesId() );
                         out.write( separator );
                         out.write( protein.getProteinId().getId() );
                         out.write( separator );
-                        out.write( "[" + FORMATTER.format( stats.median() ) + "]" );
+                        out.write( domain_id.toString() );
+                        out.write( separator );
+                        for( final Domain domain : domains ) {
+                            out.write( "/" );
+                            out.write( domain.getFrom() + "-" + domain.getTo() );
+                        }
+                        out.write( "/" );
                         out.write( separator );
+                        out.write( "{" );
+                        boolean first = true;
+                        for( final Domain domain : protein.getProteinDomains() ) {
+                            if ( first ) {
+                                first = false;
+                            }
+                            else {
+                                out.write( "," );
+                            }
+                            out.write( domain.getDomainId().toString() );
+                        }
+                        out.write( "}" );
                         if ( !( ForesterUtil.isEmpty( protein.getDescription() ) || protein.getDescription()
                                 .equals( SurfacingConstants.NONE ) ) ) {
                             out.write( protein.getDescription() );