Skip to content

Commit 79f019b

Browse files
authored
Feat/support hgvsg (#530)
* normalize hgvsg using genome nexus * address PR comments * update pom
1 parent 0ba33c6 commit 79f019b

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@
304304
<dependency>
305305
<groupId>com.github.genome-nexus</groupId>
306306
<artifactId>genome-nexus-java-api-client</artifactId>
307-
<version>0709b8232b</version>
307+
<version>c8ba14d555</version>
308308
</dependency>
309309
<dependency>
310310
<groupId>com.github.oncokb</groupId>

src/main/java/org/mskcc/oncokb/curation/service/MainService.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,22 @@ public AlterationAnnotationStatus annotateAlteration(ReferenceGenome referenceGe
127127
referenceGenome,
128128
alterationWithEntityStatus.getEntity().getAlteration()
129129
);
130-
Optional<String> proteinChangeOptional = Optional.ofNullable(variantAnnotation)
131-
.map(VariantAnnotation::getAnnotationSummary)
132-
.map(VariantAnnotationSummary::getTranscriptConsequenceSummary)
133-
.map(TranscriptConsequenceSummary::getHgvspShort)
134-
.map(hgvsp -> hgvsp.replace("p.", ""));
135-
if (proteinChangeOptional.isPresent()) {
136-
alterationWithEntityStatus.getEntity().setProteinChange(proteinChangeOptional.orElseThrow());
130+
131+
String hgvsg = variantAnnotation.getHgvsg();
132+
if (StringUtils.isEmpty(hgvsg)) {
133+
throw new ApiException(variantAnnotation.getErrorMessage());
137134
}
135+
alterationWithEntityStatus.getEntity().setAlteration(hgvsg);
138136
} catch (ApiException e) {
139-
alterationWithStatus.setMessage("Failed to be annotated by GenomeNexus.");
137+
String message = "Failed to be annotated by GenomeNexus";
138+
if (!e.getMessage().isEmpty()) {
139+
message += ": " + e.getMessage();
140+
}
141+
alterationWithStatus.setMessage(message);
142+
143+
alterationWithStatus.setEntity(alterationWithEntityStatus.getEntity());
140144
alterationWithStatus.setType(EntityStatusType.WARNING);
145+
return alterationWithStatus;
141146
}
142147
}
143148

src/main/webapp/app/shared/modal/AddMutationModal.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,8 @@ function AddMutationModal({
674674
}
675675

676676
function getTabContent(alterationData: AlterationData, alterationIndex: number, excludingIndex?: number) {
677-
const excludingSection = !_.isNil(excludingIndex) ? <></> : getExcludingSection(alterationData, alterationIndex);
677+
const excludingSection =
678+
!_.isNil(excludingIndex) || alterationData.type === 'GENOMIC_CHANGE' ? <></> : getExcludingSection(alterationData, alterationIndex);
678679

679680
let content: JSX.Element;
680681
switch (alterationData.type) {
@@ -816,12 +817,6 @@ function AddMutationModal({
816817
placeholder="Input name"
817818
onChange={newValue => handleFieldChange(newValue, 'name', alterationIndex, excludingIndex)}
818819
/>
819-
<AddMutationModalField
820-
label="Protein Change"
821-
value={alterationData.proteinChange!}
822-
placeholder="Input protein change"
823-
onChange={newValue => handleFieldChange(newValue, 'proteinChange', alterationIndex, excludingIndex)}
824-
/>
825820
</div>
826821
);
827822
}

0 commit comments

Comments
 (0)