Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug fix: case no meta data from mutational signatures endpoint #4692

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

TJMKuijpers
Copy link
Contributor

Added an additional check when fetchAllMutationalSignatureCountMetaData does return an empty array.
In this case, the stable ID (which should always be defined) is used the create the mutational signature label.

@TJMKuijpers
Copy link
Contributor Author

@inodb I will test it with the pancan study locally before making this ready for review (just to be sure)

Comment on lines 56 to 72
export function formatLegendTopAxisPoints(data: IMutationalCounts[]) {
/*export function formatLegendTopAxisPoints(data: IMutationalCounts[]) {
const constant_value = _.max(data.map(item => item.value)) || 0;
const groupedData = _.groupBy(getColorsForSignatures(data), g => g.group);
return getColorsForSignatures(data).map(entry => ({
x: entry.mutationalSignatureLabel,
y: constant_value + constant_value * 0.1,
color: entry.colorValue,
}));
}
}*/

export function transformMutationalSignatureData(dataset: IMutationalCounts[]) {
/*export function transformMutationalSignatureData(dataset: IMutationalCounts[]) {
const transformedDataSet = dataset.map((obj: IMutationalCounts) => {
const transformedDataSet = dataset.map((obj: IMutationalCounts) => {
let referenceTransformed = -Math.abs(obj.value);
return { ...obj, referenceTransformed };
});
return transformedDataSet;
});
}
}*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what were these used for previously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatLegendTopAxisPoints is not needed anymore since this behavior is captured in the @computed formatLegendTopAxisPoints. The second function transformMutationalSignatureData is to show the reference counts but we will not show them in this chart. (I have a separate branch with the reference signature so the function is not lost)

Updated alternative name for missing labels

Update PatientViewPageUtils.tsx

updated label placement

removed unused functions

Prettier fix local
@TJMKuijpers TJMKuijpers force-pushed the mutational-signature-bug-fix branch from 52b5948 to 5aaf030 Compare August 11, 2023 09:50
@TJMKuijpers TJMKuijpers marked this pull request as ready for review August 11, 2023 11:15
@inodb inodb added the bug label Aug 11, 2023
@inodb inodb changed the title bug fix: case no meta data from endpoint bug fix: case no meta data from mutational signatures endpoint Aug 11, 2023
@inodb inodb merged commit 523dd09 into cBioPortal:master Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants