[Biojava-l] Question about MassCalc

Mike Jones mjones@mpi.com
Tue, 10 Jul 2001 17:05:45 -0400


I removed the default constructor. It really shouldn't be there. I think the user
should explicitly state the isotope type. I also fixed a bug in the Protease
class that was causing me difficulties parsing org/biojava/bio/proteomics/ProteaseManager.xml.
I don't know how it could have parsed correctly before I fixed it. I must have commited
a wrong version at some point.

I also put in a fix for MassCalc that was throwing a different null pointer exception
when an unusual amino acid was present that did not have an entry in the ResiduesProperties.xml
file. I tried adding a fake entry and I still got a null. SO for now I am just catching it and ignoring it.
I will figure it out later.

Finally I created a test class called demos/prot/TestDigestIO.java. It should show
basic usage of the proteomics package.

Mike


Keith James wrote:

> >>>>> "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
> _______________________________________________
> Biojava-l mailing list  -  Biojava-l@biojava.org
> http://biojava.org/mailman/listinfo/biojava-l