Skip to content

Commit

Permalink
Merge pull request #1178 from griffithlab/fix-fusion-form-validation
Browse files Browse the repository at this point in the history
When revising a fusion variant, allow for optional exon coordinates
  • Loading branch information
acoffman authored Jan 15, 2025
2 parents 94ceabc + c69f347 commit f7beda9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ function formFieldConfig(
{
key: 'referenceBuild',
type: 'reference-build-select',
props: {
required: true,
expressions: {
'props.required': (field) =>
Boolean(field.model.fivePrimeTranscript) ||
Boolean(field.model.threePrimeTranscript),
},
},
{
Expand All @@ -107,7 +109,11 @@ function formFieldConfig(
label: 'Ensembl Version',
description:
'Enter a valid Ensembl database version (e.g. 75)',
required: true,
},
expressions: {
'props.required': (field) =>
Boolean(field.model.fivePrimeTranscript) ||
Boolean(field.model.threePrimeTranscript),
},
},
],
Expand All @@ -125,11 +131,14 @@ function formFieldConfig(
type: 'base-input',
props: {
label: "5' Transcript",
required: !fivePrimeDisabled,
disabled: fivePrimeDisabled,
tooltip:
"Specify a transcript ID, including version number (e.g. ENST00000348159.4) for the 5' exon you have selected",
},
expressions: {
'props.required': (field) =>
Boolean(field.model.fivePrimeExonEnd),
},
validators: {
isTranscriptId: {
expression: isEnsemblTranscript,
Expand All @@ -149,11 +158,14 @@ function formFieldConfig(
},
props: {
label: "5' End Exon",
required: !fivePrimeDisabled,
disabled: fivePrimeDisabled,
tooltip:
'The exon number counted from the 5’ end of the transcript.',
},
expressions: {
'props.required': (field) =>
Boolean(field.model.fivePrimeTranscript),
},
},
{
key: 'fivePrimeOffset',
Expand Down Expand Up @@ -205,7 +217,6 @@ function formFieldConfig(
key: 'threePrimeTranscript',
type: 'base-input',
props: {
required: !threePrimeDisabled,
disabled: threePrimeDisabled,
label: "3' Transcript",
tooltip:
Expand All @@ -218,6 +229,10 @@ function formFieldConfig(
"3' Transcript must be a valid, human, versioned, Ensembl transcript ID",
},
},
expressions: {
'props.required': (field) =>
Boolean(field.model.threePrimeExonStart),
},
},
{
key: 'threePrimeExonStart',
Expand All @@ -232,9 +247,12 @@ function formFieldConfig(
label: "3' Start Exon",
tooltip:
'The exon number counted from the 3’ end of the transcript.',
required: !threePrimeDisabled,
disabled: threePrimeDisabled,
},
expressions: {
'props.required': (field) =>
Boolean(field.model.threePrimeTranscript),
},
},
{
key: 'threePrimeOffset',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ def resolve(fields:, id:, organization_id: nil, comment: nil)
updated_variant.single_variant_molecular_profile_id = variant.single_variant_molecular_profile_id
updated_variant.feature = variant.feature
updated_variant.fusion = variant.feature.feature_instance
updated_variant.name = updated_variant.generate_name
if variant.name == 'Fusion'
updated_variant.name = 'Fusion'
else
updated_variant.name = updated_variant.generate_name
end
updated_variant.vicc_compliant_name = updated_variant.generate_vicc_name

variant_revisions_obj = Activities::RevisedObjectPair.new(existing_obj: variant, updated_obj: updated_variant)
Expand Down

0 comments on commit f7beda9

Please sign in to comment.