final static private String PATH_TO_MAFFT_OPTION = "mafft";
final static private String DO_NOT_NORMALIZE_FOR_EFF_LENGTH_OPTION = "nn";
final static private String PRG_NAME = "msa_compactor";
- final static private String PRG_DESC = "multiple sequnce aligment compactor";
+ final static private String PRG_DESC = "multiple sequence aligment compactor";
final static private String PRG_VERSION = "0.01";
- final static private String PRG_DATE = "140314";
+ final static private String PRG_DATE = "140316";
final static private String E_MAIL = "phylosoft@gmail.com";
final static private String WWW = "https://sites.google.com/site/cmzmasek/home/software/forester";
if ( cla.isOptionSet( DO_NOT_NORMALIZE_FOR_EFF_LENGTH_OPTION ) ) {
norm = false;
}
- // else if ( cla.isOptionSet( STEP_OPTION ) && cla.isOptionSet( WINDOW_OPTION ) ) {
- // step = cla.getOptionValueAsInt( STEP_OPTION );
- // window = cla.getOptionValueAsInt( WINDOW_OPTION );
- // }
- // else {
- // printHelp();
- // System.exit( 0 );
- // }
if ( realign ) {
if ( ForesterUtil.isEmpty( path_to_mafft ) ) {
path_to_mafft = MsaCompactor.guessPathToMafft();
mc = MsaCompactor.removeWorstOffenders( msa, worst_remove, step, realign, norm, path_to_mafft, out );
}
else if ( av > 0 ) {
- mc = MsaCompactor.reduceGapAverage( msa, av, step, realign, 50, path_to_mafft, out );
+ 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, out );
+ 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" );
}
catch ( final Exception e ) {
e.printStackTrace();
System.out.println();
System.out.println( " -" + REMOVE_WORST_OFFENDERS_OPTION
+ "=<integer> number of worst offender sequences to remove" );
- System.out.println( " -" + LENGTH_OPTION + "=<integer> length" );
- System.out.println( " -" + AV_GAPINESS_OPTION + "=<decimal> gap %" );
- System.out.println( " -" + STEP_OPTION + "=<decimal> step" );
+ System.out.println( " -" + LENGTH_OPTION + "=<integer> target MSA length" );
+ System.out.println( " -" + AV_GAPINESS_OPTION + "=<decimal> target gap-ratio (0.0-1.0)" );
+ System.out.println( " -" + STEP_OPTION + "=<integer> step (for output and re-aligning)" );
System.out.println( " -" + REALIGN_OPTION + " to realign using MAFFT" + mafft_comment );
System.out.println();
System.out.println();