import org.forester.msa.ResampleableMsa;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyMethods;
-import org.forester.sequence.Sequence;
+import org.forester.sequence.MolecularSequence;
import org.forester.tools.ConfidenceAssessor;
import org.forester.util.ForesterUtil;
private Msa _msa;
private final MainFrameApplication _mf;
private final PhylogeneticInferenceOptions _options;
- private final List<Sequence> _seqs;
+ private final List<MolecularSequence> _seqs;
private final boolean DEBUG = true;
public final static String MSA_FILE_SUFFIX = ".aln";
public final static String PWD_FILE_SUFFIX = ".pwd";
- public PhylogeneticInferrer( final List<Sequence> seqs,
+ public PhylogeneticInferrer( final List<MolecularSequence> seqs,
final PhylogeneticInferenceOptions options,
final MainFrameApplication mf ) {
_msa = null;
}
final NeighborJoiningF nj = NeighborJoiningF.createInstance( false, 5 );
final Phylogeny phy = nj.execute( m );
+ PhylogenyMethods.addMolecularSeqsToTree( phy, msa );
PhylogenyMethods.extractFastaInformation( phy );
return phy;
}
+ _options.getMsaPrg() + "\" and the following parameters:\n\""
+ _options.getMsaPrgParameters() + "\"\nError: "
+ e.getLocalizedMessage(),
- "Failed to Calculate MSA",
- JOptionPane.ERROR_MESSAGE );
+ "Failed to Calculate MSA",
+ JOptionPane.ERROR_MESSAGE );
if ( DEBUG ) {
e.printStackTrace();
}
+ _options.getMsaPrg() + "\" and the following parameters:\n\""
+ _options.getMsaPrgParameters() + "\"\nError: "
+ e.getLocalizedMessage(),
- "Unexpected Exception During MSA Calculation",
- JOptionPane.ERROR_MESSAGE );
+ "Unexpected Exception During MSA Calculation",
+ JOptionPane.ERROR_MESSAGE );
if ( DEBUG ) {
e.printStackTrace();
}
"Could not create multiple sequence alignment with "
+ _options.getMsaPrg() + "\nand the following parameters:\n\""
+ _options.getMsaPrgParameters() + "\"",
- "Failed to Calculate MSA",
- JOptionPane.ERROR_MESSAGE );
+ "Failed to Calculate MSA",
+ JOptionPane.ERROR_MESSAGE );
return;
}
if ( DEBUG ) {
"Less than two sequences longer than "
+ _options.getMsaProcessingMinAllowedLength()
+ " residues left after MSA processing",
- "MSA Processing Settings Too Stringent",
- JOptionPane.ERROR_MESSAGE );
+ "MSA Processing Settings Too Stringent",
+ JOptionPane.ERROR_MESSAGE );
return;
}
}
if ( _options.isPerformBootstrapResampling() && ( n > 0 ) ) {
final ResampleableMsa resampleable_msa = new ResampleableMsa( ( BasicMsa ) _msa );
final int[][] resampled_column_positions = BootstrapResampler.createResampledColumnPositions( _msa
- .getLength(), n, seed );
+ .getLength(), n, seed );
final Phylogeny[] eval_phys = new Phylogeny[ n ];
for( int i = 0; i < n; ++i ) {
resampleable_msa.resample( resampled_column_positions[ i ] );
}
}
- private Msa runMAFFT( final List<Sequence> seqs, final List<String> opts ) throws IOException, InterruptedException {
+ private Msa runMAFFT( final List<MolecularSequence> seqs, final List<String> opts ) throws IOException,
+ InterruptedException {
Msa msa = null;
final MsaInferrer mafft = Mafft.createInstance( _mf.getInferenceManager().getPathToLocalMafft()
- .getCanonicalPath() );
+ .getCanonicalPath() );
try {
msa = mafft.infer( seqs, opts );
}
if ( !ForesterUtil.isEmpty( _options.getIntermediateFilesBase() ) ) {
try {
final BufferedWriter msa_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase()
- + MSA_FILE_SUFFIX ) );
+ + MSA_FILE_SUFFIX ) );
_msa.write( msa_writer, MSA_FORMAT.PHYLIP );
msa_writer.close();
final BufferedWriter pwd_writer = new BufferedWriter( new FileWriter( _options.getIntermediateFilesBase()
- + PWD_FILE_SUFFIX ) );
+ + PWD_FILE_SUFFIX ) );
m.write( pwd_writer );
pwd_writer.close();
}