X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fapplication%2Fmsa_compactor.java;h=4230ce05b90766104a62613f7fc2e55db8a1b82a;hb=14375b2b2837d1ae5a2d0bb44f8aae9f1916281a;hp=765648fbbf1c61ef896a31be68095b251f7268f6;hpb=6479c35c4734850f517a6ef8de0fce500fdd6693;p=jalview.git diff --git a/forester/java/src/org/forester/application/msa_compactor.java b/forester/java/src/org/forester/application/msa_compactor.java index 765648f..4230ce0 100644 --- a/forester/java/src/org/forester/application/msa_compactor.java +++ b/forester/java/src/org/forester/application/msa_compactor.java @@ -9,7 +9,6 @@ import java.util.List; import org.forester.io.parsers.FastaParser; import org.forester.io.parsers.GeneralMsaParser; import org.forester.msa.Msa; -import org.forester.msa.Msa.MSA_FORMAT; import org.forester.msa.MsaInferrer; import org.forester.msa_compactor.MsaCompactor; import org.forester.util.CommandLineArguments; @@ -109,19 +108,24 @@ public class msa_compactor { } MsaCompactor mc = null; if ( worst_remove > 0 ) { - mc = MsaCompactor.removeWorstOffenders( msa, worst_remove, realign, norm, path_to_mafft ); + mc = MsaCompactor.removeWorstOffenders( msa, worst_remove, step, realign, norm, path_to_mafft, out ); } else if ( av > 0 ) { - mc = MsaCompactor.reduceGapAverage( msa, av, step, realign, out, 50, path_to_mafft ); + mc = MsaCompactor.reduceGapAverage( msa, av, step, realign, norm, path_to_mafft, out ); } else if ( length > 0 ) { - mc = MsaCompactor.reduceLength( msa, length, step, realign, path_to_mafft ); + if ( length >= msa.getLength() ) { + ForesterUtil.fatalError( PRG_NAME, "target MSA length (" + length + + ") is greater than or equal to MSA original length (" + msa.getLength() + ")" ); + } + // TODO if < shortest seq -> error + mc = MsaCompactor.reduceLength( msa, length, step, realign, norm, path_to_mafft, out ); } //System.out.println( MsaMethods.calcGapRatio( mc.getMsa() ) ); // for( final String id : mc.getRemovedSeqIds() ) { // System.out.println( id ); //} - mc.writeMsa( out, MSA_FORMAT.PHYLIP, ".aln" ); + //mc.writeMsa( out, MSA_FORMAT.PHYLIP, ".aln" ); } catch ( final Exception e ) { e.printStackTrace(); @@ -168,6 +172,9 @@ public class msa_compactor { System.out.println(); System.out.println( " -" + REMOVE_WORST_OFFENDERS_OPTION + "= number of worst offender sequences to remove" ); + System.out.println( " -" + LENGTH_OPTION + "= target MSA length" ); + System.out.println( " -" + AV_GAPINESS_OPTION + "= gap %" ); + System.out.println( " -" + STEP_OPTION + "= step" ); System.out.println( " -" + REALIGN_OPTION + " to realign using MAFFT" + mafft_comment ); System.out.println(); System.out.println();