From 51371c35fd136439cd3c44d8772b85eaac4a87cc Mon Sep 17 00:00:00 2001 From: oplantalech Date: Wed, 14 Feb 2024 12:22:41 +0100 Subject: [PATCH] Ignore gene described in the CNA Discrete Long file if it cannot be found in the database --- .../mskcc/cbio/portal/scripts/ImportCnaDiscreteLongData.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/mskcc/cbio/portal/scripts/ImportCnaDiscreteLongData.java b/src/main/java/org/mskcc/cbio/portal/scripts/ImportCnaDiscreteLongData.java index af67c17a..f03e5b45 100644 --- a/src/main/java/org/mskcc/cbio/portal/scripts/ImportCnaDiscreteLongData.java +++ b/src/main/java/org/mskcc/cbio/portal/scripts/ImportCnaDiscreteLongData.java @@ -260,6 +260,11 @@ private CanonicalGene getGene( if (genes.size() > 1) { throw new IllegalStateException("Found multiple genes for Hugo symbol " + hugoSymbol + " while importing cna"); } + // Ignore gene if it cannot be found in the database + if (genes.size() < 1) { + ProgressMonitor.logWarning("Ignoring Hugo symbol " + hugoSymbol + "not found in the database"); + return null; + } return genes.get(0); } ProgressMonitor.logWarning("Entrez_Id " + entrez + " not found. Record will be skipped for this gene.");