File tree Expand file tree Collapse file tree 5 files changed +13
-15
lines changed
component/src/main/java/org/cbioportal/genome_nexus/component/annotation
persistence/src/main/java/org/cbioportal/genome_nexus/persistence/internal
test/java/org/cbioportal/genome_nexus/web Expand file tree Collapse file tree 5 files changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -30,14 +30,13 @@ public String resolve(TranscriptConsequence transcriptConsequence)
3030 }
3131
3232 String symbol = transcriptConsequence .getGeneSymbol ();
33- if (symbol == null || symbol .trim (). isEmpty ()) {
33+ if (symbol == null || symbol .isEmpty ()) {
3434 return null ;
3535 }
3636
3737 String hgncId = transcriptConsequence .getHgncId ();
38- if (hgncId != null && !hgncId .trim ().isEmpty ()) {
39- String mapped = ensemblRepository .getOfficialHugoSymbol (symbol , hgncId );
40- return mapped ;
38+ if (hgncId != null && !hgncId .isEmpty ()) {
39+ return ensemblRepository .getOfficialHugoSymbol (symbol , hgncId );
4140 }
4241 return ensemblRepository .getOfficialHugoSymbol (symbol );
4342 }
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public Index buildIndex(VariantAnnotation variantAnnotation)
3232 {
3333 Index index = new Index ();
3434 index .setVariant (this .resolveVariant (variantAnnotation ));
35- List <String > hugoSymbols ;
35+ List <String > hugoSymbols ;
3636 if (Boolean .TRUE .equals (this .replaceOldGeneSymbol )) {
3737 hugoSymbols = this .hugoGeneSymbolResolver .resolveAllHugoGeneSymbols (variantAnnotation );
3838 } else {
@@ -74,7 +74,7 @@ private List<String> resolveAllOriginalGeneSymbols(VariantAnnotation variantAnno
7474 Set <String > hugoSymbolSet = new HashSet <>();
7575
7676 for (TranscriptConsequence tc : variantAnnotation .getTranscriptConsequences ()) {
77- if (tc .getGeneSymbol () != null && !tc .getGeneSymbol ().trim (). isEmpty ()) {
77+ if (tc .getGeneSymbol () != null && !tc .getGeneSymbol ().isEmpty ()) {
7878 hugoSymbolSet .add (tc .getGeneSymbol ());
7979 }
8080 }
Original file line number Diff line number Diff line change @@ -215,21 +215,21 @@ public String findEntrezGeneIdByHugoSymbol(String hugoSymbol) {
215215
216216 @ Override
217217 public List <String > findEntrezGeneIdByHugoSymbol (String hugoSymbol , Boolean searchInAliases ) {
218- List <String > results = new ArrayList <>();
219- String direct = hugoSymbolToEntrezGeneIdMap .get (hugoSymbol );
220- if (direct != null && !results .contains (direct )) {
221- results .add (direct );
218+ List <String > entrezGeneIds = new ArrayList <>();
219+ String entrezGeneId = hugoSymbolToEntrezGeneIdMap .get (hugoSymbol );
220+ if (entrezGeneId != null && !entrezGeneIds .contains (entrezGeneId )) {
221+ entrezGeneIds .add (entrezGeneId );
222222 }
223223
224224 if (Boolean .TRUE .equals (searchInAliases )) {
225225 List <String > aliasMatches = geneAliasToEntrezGeneIdMap .get (hugoSymbol );
226226 if (aliasMatches != null ) {
227227 for (String id : aliasMatches ) {
228- if (id != null && !results .contains (id )) results .add (id );
228+ if (id != null && !entrezGeneIds .contains (id )) entrezGeneIds .add (id );
229229 }
230230 }
231231 }
232- return results ;
232+ return entrezGeneIds ;
233233 }
234234
235235 @ Override
Original file line number Diff line number Diff line change @@ -74,4 +74,4 @@ prioritize_cancer_gene_transcripts=true
7474cache.enabled=true
7575
7676# replace old HGNC gene symbol to the latest HGNC gene symbol in annotationSummary - transcriptConsequenceSummary
77- replace_old_hgnc_gene_symbol=true
77+ replace_old_hgnc_gene_symbol=true
Original file line number Diff line number Diff line change 11package org .cbioportal .genome_nexus .web ;
22
33import org .cbioportal .genome_nexus .model .NucleotideContext ;
4+ import static org .junit .Assert .assertEquals ;
45import org .junit .Test ;
56import org .junit .runner .RunWith ;
67import org .springframework .boot .test .context .SpringBootTest ;
78import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
89import org .springframework .web .client .RestTemplate ;
910
10- import static org .junit .Assert .assertEquals ;
11-
1211@ RunWith (SpringJUnit4ClassRunner .class )
1312@ SpringBootTest (
1413 webEnvironment = SpringBootTest .WebEnvironment .DEFINED_PORT ,
You can’t perform that action at this time.
0 commit comments