diff --git a/src/app/store/Alignment.ts b/src/app/store/Alignment.ts index bb7c0911..a6fca656 100644 --- a/src/app/store/Alignment.ts +++ b/src/app/store/Alignment.ts @@ -326,9 +326,12 @@ class Alignment extends InputFile { 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 ) { diff --git a/src/app/store/alignmentStore.test.ts b/src/app/store/alignmentStore.test.ts index a25d7ead..d9f5c1ac 100644 --- a/src/app/store/alignmentStore.test.ts +++ b/src/app/store/alignmentStore.test.ts @@ -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' );