Skip to content

Commit

Permalink
Separate leading sentence when ME comes from relevant alteration
Browse files Browse the repository at this point in the history
Separate leading sentence when mutation effect comes from relevant alteration
  • Loading branch information
zhx828 committed Jul 30, 2024
1 parent 43fab0d commit 722c3b0
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MutationEffectDescription: React.FunctionComponent<{
// Add link to alteration page when the allele is unknown but multiple alternative alleles at the same position have mutation effects
const description = props.description || '';
const additionalMutationEffectSeparator =
'however, we have mutation effect descriptions for';
'we have mutation effect description';
if (description.includes(additionalMutationEffectSeparator)) {
const segments = description.split(additionalMutationEffectSeparator);
if (segments.length === 2) {
Expand Down Expand Up @@ -49,6 +49,23 @@ const MutationEffectDescription: React.FunctionComponent<{
}
}
}

// Separate leading sentence when mutation effect comes from relevant alteration
const relevantAltMutationEffectSeparator = ' is: ';
if (description.includes(relevantAltMutationEffectSeparator)) {
const segments = description.split(relevantAltMutationEffectSeparator);
if (segments.length === 2) {
return (
<div>
<p>
{segments[0]} {relevantAltMutationEffectSeparator}
</p>
<SummaryWithRefs content={segments[1]} type="linkout" />
</div>
);
}
}

// don't do anything but add reference links in the description
return <SummaryWithRefs content={props.description} type="linkout" />;
};
Expand Down

0 comments on commit 722c3b0

Please sign in to comment.