[Biojava-l] Question about MassCalc

Keith James kdj@sanger.ac.uk
10 Jul 2001 10:14:07 +0100


>>>>> "Sanjeev" == Sanjeev S Bajwa <sanjeev@sbh.com> writes:

    Sanjeev> Hello, I have recently downloaded BioJava, and I am
    Sanjeev> trying to use the getMass method the MassCalc class. I am
    Sanjeev> using the constructor and method that does not require
    Sanjeev> the isotopicType parameter. Every time I try to run the
    Sanjeev> program I wrote it gives me a runtime error: Exception in
    Sanjeev> thread "main" java.lang.NullPointerException at
    Sanjeev> org.biojava.bio.proteomics.MassCalc.getMass(MassCalc.java:202)
    Sanjeev> at Molec.main(Molec.java:43)

The problem is that MassCalc gets values from the HashMap
mSymbolPropertyHash which is only filled with values when the public
MassCalc(String isotopicType) constructor is used. It is left empty
when the default constructor is used.

The (previous?) behaviour was to use the ProteinTools class directly
to get the Map contents. See the private method getSymbolPropertyMap()
in MassCalc. However, this has been commented out. The null pointers
come from trying to retrieve values from an empty HashMap.

cvs indicates that this hasn't been touched since 19-Jan-01, so did it
ever work? I'm afraid I don't have time to work on this.

-- 

-= Keith James - kdj@sanger.ac.uk - http://www.sanger.ac.uk/Users/kdj =-
The Sanger Centre, Wellcome Trust Genome Campus, Hinxton, Cambs CB10 1SA