Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/app/store/Alignment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,12 @@ class Alignment extends InputFile<AlignmentOwner> {
this.modeltestLoading = false;
// For raxml-ng
let model = raxmlNG.split( '+' )[0];
// Two models have different names in modeltest-ng and raxml-ng
// Some models have different names in modeltest-ng and raxml-ng
model = model.replace( 'TrN', 'TN93' );
model = model.replace( 'TPM1', 'K81' );
// modeltest-ng TIMn estimates frequencies (raxml-ng TIMnuf); TIMnef uses equal ones (raxml-ng TIMn)
model = model.replace( /^TIM(\d)$/, 'TIM$1uf' );
model = model.replace( /^TIM(\d)ef$/, 'TIM$1' );
this.substitutionModel.setValue( model );
const frequencies = raxmlNG.match( /\+F[O|E]?/ );
if ( frequencies ) {
Expand Down
5 changes: 5 additions & 0 deletions src/app/store/alignmentStore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,11 @@ describe( 'Alignment setModelFromString', () => {
expect( alignment.substitutionModel.value ).toBe( 'K81' );
} );

it( 'maps the TIM models by their frequencies', () => {
expect( apply( { raxml: 'GTRGAMMA', extraFlag: '', raxmlNG: 'TIM2ef+G4' } ).alignment.substitutionModel.value ).toBe( 'TIM2' );
expect( apply( { raxml: 'GTRGAMMAX', extraFlag: '', raxmlNG: 'TIM3+G4' } ).alignment.substitutionModel.value ).toBe( 'TIM3uf' );
} );

it( 'reads the raxml flags F, X, invariant sites and rate', () => {
const f = apply( { raxml: 'GTRGAMMAIF', extraFlag: '', raxmlNG: 'GTR' } );
expect( f.run.baseFrequencies.value ).toBe( 'F' );
Expand Down
Loading