Skip to content

Commit

Permalink
Changes to fit new Mutation Assessor data model
Browse files Browse the repository at this point in the history
  • Loading branch information
leexgh committed Oct 2, 2024
1 parent a076bf2 commit 8ab1fcb
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 164 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ class FunctionalPrediction extends React.Component<IFunctionalPredictionProps> {
genomeNexusData: VariantAnnotation | undefined
): IFunctionalImpactData {
const mutationAssessor =
genomeNexusData &&
genomeNexusData.mutation_assessor &&
genomeNexusData.mutation_assessor.annotation;
genomeNexusData && genomeNexusData.mutation_assessor;
const siftScore =
genomeNexusData &&
genomeNexusData.transcript_consequences &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,20 @@ export default class MutationAssessor extends React.Component<
IMutationAssessorProps,
{}
> {
private static MUTATION_ASSESSOR_URL: string =
'http://mutationassessor.org/r3/';
// Change to new url when available
// New url will need to be added in tooltip, discrption, "Please refer to the score range here." and "Go to Mutation Assessor"
// private static MUTATION_ASSESSOR_URL: string = 'http://mutationassessor.org/r3/';

private static mutationAssessorText() {
return (
<div style={{ width: 450, height: 110 }}>
<a
href={MutationAssessor.MUTATION_ASSESSOR_URL}
target="_blank"
rel="noopener noreferrer"
>
Mutation Assessor
</a>{' '}
predicts the functional impact of amino-acid substitutions in
proteins, such as mutations discovered in cancer or missense
polymorphisms. The functional impact is assessed based on
evolutionary conservation of the affected amino acid in protein
homologs. The method has been validated on a large set (60k) of
disease associated (OMIM) and polymorphic variants.
Mutation Assessor predicts the functional impact of amino-acid
substitutions in proteins, such as mutations discovered in
cancer or missense polymorphisms. The functional impact is
assessed based on evolutionary conservation of the affected
amino acid in protein homologs. The method has been validated on
a large set of disease associated and polymorphic variants
(ClinVar).
</div>
);
}
Expand Down Expand Up @@ -143,24 +138,6 @@ export default class MutationAssessor extends React.Component<
);
}

// This is mostly to make the legacy MA links work
private static maLink(link: string | undefined) {
let url = null;

// ignore invalid links ("", "NA", "Not Available")
if (link) {
// getma.org is the legacy link, need to replace it with the actual value
url = link.replace('getma.org', 'mutationassessor.org/r3');

// prepend "http://" if needed
if (url.indexOf('http://') !== 0) {
url = `http://${url}`;
}
}

return url;
}

constructor(props: IMutationAssessorProps) {
super(props);

Expand All @@ -179,38 +156,24 @@ export default class MutationAssessor extends React.Component<

if (
this.props.mutationAssessor &&
this.props.mutationAssessor.functionalImpact != null &&
this.props.mutationAssessor.functionalImpact !== ''
this.props.mutationAssessor.functionalImpactPrediction != null &&
this.props.mutationAssessor.functionalImpactPrediction !== ''
) {
const maData = this.props.mutationAssessor;
maContent = <span>{maData.functionalImpact}</span>;
maContent = <span>{maData.functionalImpactPrediction}</span>;
} else {
maContent = <span>N/A</span>;
}

return (
<div className={featureTableStyle['feature-table-layout']}>
<div className={featureTableStyle['data-source']}>
{this.mutationAssessorTooltip(
<a
href={MutationAssessor.MUTATION_ASSESSOR_URL}
target="_blank"
rel="noopener noreferrer"
>
{dataSource}
</a>
)}
{this.mutationAssessorTooltip(<>{dataSource}</>)}
</div>
<div>
{this.mutationAssessorTooltip(
<span className={featureTableStyle['data-with-link']}>
<a
href={MutationAssessor.MUTATION_ASSESSOR_URL}
target="_blank"
rel="noopener noreferrer"
>
{maContent}
</a>
{maContent}
</span>
)}
</div>
Expand All @@ -221,12 +184,7 @@ export default class MutationAssessor extends React.Component<
private mutationAssessorData() {
if (this.props.mutationAssessor) {
const maData = this.props.mutationAssessor;
const xVarLink = MutationAssessor.maLink(
`http://mutationassessor.org/r3/?cm=var&p=${maData.uniprotId}&var=${maData.variant}`
);
const msaLink = MutationAssessor.maLink(maData.msaLink);
const pdbLink = MutationAssessor.maLink(maData.pdbLink);
const impact = maData.functionalImpact ? (
const impact = maData.functionalImpactPrediction ? (
<div>
<table className={tooltipStyles['ma-tooltip-table']}>
{(maData.functionalImpactScore ||
Expand All @@ -245,86 +203,12 @@ export default class MutationAssessor extends React.Component<
</tbody>
)}
</table>
<span>
Please refer to the score range{' '}
<a
href="http://mutationassessor.org/r3/"
target="_blank"
rel="noopener noreferrer"
>
here
</a>
.
</span>
</div>
) : null;

const xVar =
xVarLink &&
maData.uniprotId.length !== 0 &&
maData.variant.length !== 0 ? (
<div className={tooltipStyles['mutation-assessor-link']}>
<a
href={xVarLink}
target="_blank"
rel="noopener noreferrer"
>
<img
height="15"
width="19"
src={mutationAssessorLogo}
className={
tooltipStyles['mutation-assessor-main-img']
}
alt="Mutation Assessor"
/>
Go to Mutation Assessor
</a>
</div>
) : null;

const msa =
msaLink && maData.msaLink.length !== 0 ? (
<div className={tooltipStyles['mutation-assessor-link']}>
<a
href={msaLink}
target="_blank"
rel="noopener noreferrer"
>
<span
className={`${tooltipStyles['ma-icon']} ${tooltipStyles['ma-msa-icon']}`}
>
msa
</span>
Multiple Sequence Alignment
</a>
</div>
) : null;

const pdb =
pdbLink && maData.pdbLink.length !== 0 ? (
<div className={tooltipStyles['mutation-assessor-link']}>
<a
href={pdbLink}
target="_blank"
rel="noopener noreferrer"
>
<span
className={`${tooltipStyles['ma-icon']} ${tooltipStyles['ma-3d-icon']}`}
>
3D
</span>
Mutation Assessor 3D View
</a>
</div>
) : null;

return (
<div>
{impact}
{msa}
{pdb}
{xVar}
<br />
</div>
);
Expand Down
20 changes: 10 additions & 10 deletions src/shared/components/annotation/genomeNexus/MutationAssessor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export default class MutationAssessor extends React.Component<
IMutationAssessorProps,
{}
> {
static MUTATION_ASSESSOR_URL: string = 'http://mutationassessor.org/r3/';
// Replace to new url when publication available
// static MUTATION_ASSESSOR_URL: string = 'http://mutationassessor.org/r3/';

constructor(props: IMutationAssessorProps) {
super(props);
Expand All @@ -31,7 +32,7 @@ export default class MutationAssessor extends React.Component<
mutationAssessorData: MutationAssessorData | undefined
): string {
if (mutationAssessorData) {
return `impact: ${mutationAssessorData.functionalImpact}, score: ${mutationAssessorData.functionalImpactScore}`;
return `impact: ${mutationAssessorData.functionalImpactPrediction}, score: ${mutationAssessorData.functionalImpactScore}`;
} else {
return 'NA';
}
Expand All @@ -44,15 +45,15 @@ export default class MutationAssessor extends React.Component<

if (
this.props.mutationAssessor &&
this.props.mutationAssessor.functionalImpact !== null
this.props.mutationAssessor.functionalImpactPrediction !== null
) {
const maData = this.props.mutationAssessor;
maContent = (
<span
className={classNames(
annotationStyles['annotation-item-text'],
(mutationAssessorColumn as any)[
`ma-${maData.functionalImpact}`
`ma-${maData.functionalImpactPrediction}`
]
)}
>
Expand Down Expand Up @@ -80,15 +81,14 @@ export default class MutationAssessor extends React.Component<
private tooltipContent() {
if (this.props.mutationAssessor) {
const maData = this.props.mutationAssessor;
const impact = maData.functionalImpact ? (
const impact = maData.functionalImpactPrediction ? (
<div>
<table className={tooltipStyles['ma-tooltip-table']}>
<tr>
<td>Source</td>
<td>
<a href="http://mutationassessor.org/r3">
MutationAssessor
</a>
{/* Add link when pubilcation is available */}
MutationAssessor
</td>
</tr>
<tr>
Expand All @@ -97,11 +97,11 @@ export default class MutationAssessor extends React.Component<
<span
className={
(mutationAssessorColumn as any)[
`ma-${maData.functionalImpact}`
`ma-${maData.functionalImpactPrediction}`
]
}
>
{maData.functionalImpact}
{maData.functionalImpactPrediction}
</span>
</td>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,13 @@ class FunctionalImpactColumnTooltip extends React.Component<
public static mutationAssessorText() {
return (
<div style={{ width: 450, height: 100 }}>
<a
href={MutationAssessor.MUTATION_ASSESSOR_URL}
target="_blank"
>
Mutation Assessor
</a>{' '}
predicts the functional impact of amino-acid substitutions in
proteins, such as mutations discovered in cancer or missense
polymorphisms. The functional impact is assessed based on
evolutionary conservation of the affected amino acid in protein
homologs. The method has been validated on a large set (60k) of
disease associated (OMIM) and polymorphic variants.
Mutation Assessor predicts the functional impact of amino-acid
substitutions in proteins, such as mutations discovered in
cancer or missense polymorphisms. The functional impact is
assessed based on evolutionary conservation of the affected
amino acid in protein homologs. The method has been validated on
a large set of disease associated and polymorphic variants
(ClinVar).
</div>
);
}
Expand Down Expand Up @@ -531,13 +526,7 @@ export default class FunctionalImpactColumnFormatter {
public static getMutationAssessorData(
mutationAssessorDataCache: VariantAnnotation | null
): MutationAssessorData | undefined {
if (!mutationAssessorDataCache) {
return undefined;
} else {
return mutationAssessorDataCache.mutation_assessor
? mutationAssessorDataCache.mutation_assessor.annotation
: undefined;
}
return mutationAssessorDataCache?.mutation_assessor;
}

public static renderFunction(
Expand Down

0 comments on commit 8ab1fcb

Please sign in to comment.