bio4j / bio4j-graphical-tools

GNU Affero General Public License v3.0
1 stars 0 forks source link

Issue with null pointer probably related to lack of use of withXXX methods #4

Closed pablopareja closed 9 years ago

pablopareja commented 10 years ago

Hi!

I'm getting the following exception:

java.lang.NullPointerException
        at com.bio4j.dataviz.GetJsonWithProteinsSharingGOandTaxonomy.main(GetJsonWithProteinsSharingGOandTaxonomy.java:121)
        at com.bio4j.dataviz.GetJsonWithProteinsSharingGOandTaxonomy.execute(GetJsonWithProteinsSharingGOandTaxonomy.java:45)
        at com.ohnosequences.util.ExecuteFromFile.main(ExecuteFromFile.java:66)
        at com.bio4j.dataviz.GenerateDataViz.main(GenerateDataViz.java:13)

The line of code where this exception is launched reads:

Optional<GoTerm<DefaultTitanGraph, TitanVertex, TitanKey, TitanEdge, TitanLabel>> goOptional = uniprotNCBITaxonomyGraph.uniprotGraph().uniprotGoGraph().goGraph().goTermIdIndex().getVertex(goId);

@eparejatobes I think that I may should be using the methods withXXX but I'm not sure how... :question:

pablopareja commented 10 years ago

I managed to move the error to another point but keep getting exceptions which are probably related to the same thing...

java.lang.NullPointerException
        at com.bio4j.model.go.vertices.GoTerm.goAnnotation_inV(GoTerm.java:162)
        at com.bio4j.dataviz.GetJsonWithProteinsSharingGOandTaxonomy.main(GetJsonWithProteinsSharingGOandTaxonomy.java:132)
        at com.bio4j.dataviz.GetJsonWithProteinsSharingGOandTaxonomy.execute(GetJsonWithProteinsSharingGOandTaxonomy.java:47)
        at com.ohnosequences.util.ExecuteFromFile.main(ExecuteFromFile.java:66)
        at com.bio4j.dataviz.GenerateDataViz.main(GenerateDataViz.java:13)

@eparejatobes any ideas for a workaround :question:

eparejatobes commented 10 years ago

How do you build the graph?

pablopareja commented 10 years ago

https://github.com/bio4j/bio4j-graphical-tools/blob/master/src/main/java/com/bio4j/dataviz/GetJsonWithProteinsSharingGOandTaxonomy.java#L115

eparejatobes commented 10 years ago

what was this in the end?

pablopareja commented 10 years ago

My last commits fixed the issue :smiley:

eparejatobes commented 10 years ago

Good!

pablopareja commented 9 years ago

This is already solved, closing the issue...