compomics / compomics-utilities

Open source Java library for computational proteomics
http://compomics.github.io/projects/compomics-utilities.html
29 stars 17 forks source link

Null pointer exception Peptide Mapper in utilities 4.11.19 #25

Closed Thys3Potgieter closed 6 years ago

Thys3Potgieter commented 6 years ago

Hi Compomics Team! I have noticed a weird bug where peptide mapper sometimes failed.

I have narrowed it down to one tag and one sequece, it seems if the UniProt sequence contains an X in the region that PM tries to validate a segment mass of a given tag, an error occurs.

Error:

0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100% 0% 10%Start reading FASTA file Start indexing proteome

Indexing took 0.224223405 seconds and consumes 7.36E-4 MB java.lang.NullPointerException at com.compomics.util.experiment.identification.protein_inference.fm_index.FMIndex.getProteinMappingWithoutVariants(FMIndex.java:4155) at com.compomics.util.experiment.identification.protein_inference.fm_index.FMIndex.getProteinMapping(FMIndex.java:3827) at com.compomics.util.experiment.identification.protein_inference.fm_index.FMIndex.getProteinMapping(FMIndex.java:3801) at com.compomics.util.experiment.identification.protein_inference.executable.PeptideMapping.main(PeptideMapping.java:222) Error: an unexpected error happened.

Tag: 2626.29,AIIG,470.224

Sequence:

tr|A0A1C9NAQ8|A0A1C9NAQ8_9DIPT Cytochrome c oxidase subunit 1 (Fragment) OS=Mycetophilidae sp. BOLD-2016 GN=COI PE=3 SV=1 FIXGAWSGMVGTSLSMIIRAELGHPGALIGNDQIYNVIVTAHAFIMIFFMVMPIMIGGFG NWLVPLMLGAPDMAFPRMNNMSFWMLPPSLTLLLSSSLVEAGAGTGWTVYPPLSSTIAHA GASVDLAIFSLHLAGISSILGAVNFITTIINMRAPGITFDRMPLFVWSVLITAVLLLLSL PVLAGAITMLLTDR

(The X in the sequence is in the region of the N-terminal mass gap of the tag - annotated)

Thanks!

Thys

Thys3Potgieter commented 6 years ago

I checked if this happens with the other 3 ambiguity codes, it only happens with X

dominik-kopczynski commented 6 years ago

Hi Thys,

thank you very much for informing about the issue. I'll try to reproduce the bug and fix is ASAP.

Cheers, Dominik

dominik-kopczynski commented 6 years ago

Thys, have you used a parameter file with different mass tolerance and / or PTMs? I tried to reproduce the error, but with standard parameters PM doesn't find any hit and thus is not coming to that position in the code, where it crashes, neither in 4.11.19, nor in the freshest version.

Thys3Potgieter commented 6 years ago

identification.par.zip Thank you Dominik, I indeed did not run with default parameters. Please see attached file.

Kind regards, Thys

dominik-kopczynski commented 6 years ago

Hi Thys, good news. I finally found the error. PeptideMapper was confused, because in the first scanning phase it omits guessing masses to the Xs. Interestingly, the sequence FIXGAWSGMVGTSLSMIIRAELGHPG exactly 2626.29 with all variable PTMs and as said with mass(X) = 0. Accordingly, it couldn't find any valid X, because it searched for an AA with mass 0.001Da. I fixed the bug. It is currently in the 'new_backend' branch. How fast do you need the update?

Cheers, Dominik

andrewjmc commented 4 years ago

Hello Dominik,

Can you advise if this modification has made it into the master branch. My quick look suggests it didn't.

I wanted to test it out and downloaded the source for new_backend. It compiled successfully with maven but doesn't include the PeptideMapping function as far as I can tell.

Thys3Potgieter commented 2 years ago

Dear Dominik, please advise in which version this was released? Thanks!

hbarsnes commented 2 years ago

Dear Dominik, please advise in which version this was released? Thanks!

All of the above changes were merged into the master branch a long time ago. Seems like this happened 15-16 months ago. If the error is still there in the latest version, please open a new issue and refer to this old one there.

dominik-kopczynski commented 2 years ago

Thanks for the message. Every update is now available in the master branch of utilities. The location of PeptideMapper changed to the CLI directory. To test PeptideMapper, please do:

1) Either download the recent compiled version or pull the master branch. 2) Go in a console to the directory of the unzipped package folder or repository. 3) For the precompiled unzipped package, please type in: java -cp utilities-5.0.38.jar com.compomics.cli.peptide_mapper.Pe ptideMapperCLI -p exampleFiles/PeptideMapping/yeast.fasta exampleFiles/PeptideMapping/yeast-pep-1k.csv output.csv

For the git repository, please type in: java -cp target/utilities-5.0.38/utilities-5.0.38.jar com.compomics.cli.peptide_mapper.PeptideMapperCLI -p exampleFiles/PeptideMapping/yeast.fasta exampleFiles/PeptideMapping/yeast-pep-1k.csv output.csv

If an error still occurs when applying your data, please let me know. Thanks and Cheers.