Skip to content

Commit

Permalink
replace auto-select with maaslin only
Browse files Browse the repository at this point in the history
  • Loading branch information
asizemore committed Oct 10, 2023
1 parent 6f86d50 commit 1181883
Showing 1 changed file with 12 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ function DifferentialAbundanceConfigDescriptionComponent({
'comparator' in configuration
? findEntityAndVariable(configuration.comparator.variable)
: undefined;
const differentialAbundanceMethod =
'differentialAbundanceMethod' in configuration
? configuration.differentialAbundanceMethod
: undefined;

const updatedCollectionVariable = collections.find((collectionVar) =>
isEqual(
Expand Down Expand Up @@ -165,7 +161,9 @@ function DifferentialAbundanceConfigDescriptionComponent({
}

// Include available methods in this array.
const DIFFERENTIAL_ABUNDANCE_METHODS = ['DESeq', 'Maaslin'];
// 10/10/23 - decided to only release Maaslin for the first roll-out. DESeq is still available
// and we're poised to release it in the future.
const DIFFERENTIAL_ABUNDANCE_METHODS = ['Maaslin']; // + 'DESeq' in the future

export function DifferentialAbundanceConfiguration(
props: ComputationConfigProps
Expand All @@ -185,6 +183,11 @@ export function DifferentialAbundanceConfiguration(
const filters = analysisState.analysis?.descriptor.subset.descriptor;
const findEntityAndVariable = useFindEntityAndVariable(filters);

// Only releasing Maaslin for b66
if (configuration)
configuration.differentialAbundanceMethod =
DIFFERENTIAL_ABUNDANCE_METHODS[0];

// Include known collection variables in this array.
const collections = useCollectionVariables(studyMetadata.rootEntity);
if (collections.length === 0)
Expand All @@ -205,11 +208,10 @@ export function DifferentialAbundanceConfiguration(
const collectionVarItems = useMemo(() => {
return collections
.filter((collectionVar) => {
return collectionVar.normalizationMethod // i guess diy stuff doesnt have this prop?
? // !collectionVar.isProportion &&
// collectionVar.normalizationMethod === 'NULL' &&
!collectionVar.displayName?.includes('pathway')
: true;
return collectionVar.normalizationMethod
? collectionVar.normalizationMethod !== 'NULL' &&
!collectionVar.displayName?.includes('pathway')
: true; // DIY may not have the normalizationMethod annotations, but we still want those datasets to pass.
})
.map((collectionVar) => ({
value: {
Expand Down Expand Up @@ -293,31 +295,6 @@ export function DifferentialAbundanceConfiguration(
}
);

const differentialAbundanceMethod = useMemo(() => {
if (configuration && 'collectionVariable' in configuration) {
// First find the collection in our collections array so that we can access its annotations
const selectedCollection = collections.find(
(collection) =>
collection.entityId === configuration.collectionVariable.entityId &&
collection.id === configuration.collectionVariable.collectionId
);

// Now determine the appropriate method based on the collection's normalization method
const method =
selectedCollection?.normalizationMethod &&
selectedCollection.normalizationMethod === 'NULL'
? DIFFERENTIAL_ABUNDANCE_METHODS[0]
: DIFFERENTIAL_ABUNDANCE_METHODS[1];
changeConfigHandler('differentialAbundanceMethod', method);
return method;
}
}, [
selectedCollectionVar,
collections,
configuration?.collectionVariable,
changeConfigHandler,
]);

return (
<ComputationStepContainer
computationStepInfo={{
Expand Down

0 comments on commit 1181883

Please sign in to comment.