diff --git a/pom.xml b/pom.xml index 9290b021..992bda95 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ ubc.pavlab rdp - 1.1.3 + 1.1.4 org.springframework.boot diff --git a/src/main/java/ubc/pavlab/rdp/util/Gene2GoParser.java b/src/main/java/ubc/pavlab/rdp/util/Gene2GoParser.java index fb2fe7a1..5a1aa638 100644 --- a/src/main/java/ubc/pavlab/rdp/util/Gene2GoParser.java +++ b/src/main/java/ubc/pavlab/rdp/util/Gene2GoParser.java @@ -95,15 +95,22 @@ private static void populateAnnotations( InputStream input, Collection ac br.lines().map( line -> line.split( "\t" ) ).filter( values -> fastMap.containsKey( Integer.valueOf( values[0] ) ) ).forEach( values -> { GeneOntologyTerm term = goService.getTerm( values[2] ); + + if ( term == null ) { + log.warn( "Problem finding data for term (" + values[2] + ")" ); + return; + } + Gene gene = geneService.load( Integer.valueOf( values[1] ) ); - try { - term.getDirectGenes().add( gene ); - gene.getTerms().add( term ); - } catch (NullPointerException nullE) { - log.warn( "Problem finding data for gene (" + values[1] + ") and term (" + values[2] + ")" ); + if ( gene == null ) { + log.warn( "Problem finding data for gene (" + values[1] + ")" ); + return; } + term.getDirectGenes().add( gene ); + gene.getTerms().add( term ); + } ); } catch (IOException e) { throw new ParseException( e.getMessage(), 0 ); diff --git a/src/main/resources/ehcache.xml b/src/main/resources/ehcache.xml index 1c3d38e8..c0b024e1 100644 --- a/src/main/resources/ehcache.xml +++ b/src/main/resources/ehcache.xml @@ -73,7 +73,7 @@