Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return help message when exception is thrown #41

Open
rccc opened this issue Jun 26, 2020 · 2 comments
Open

Return help message when exception is thrown #41

rccc opened this issue Jun 26, 2020 · 2 comments

Comments

@rccc
Copy link

rccc commented Jun 26, 2020

java -jar /home/eric/dev/gains/app/bin/MetFrag2.4.5-CL.jar app/MetFrag/1/12-154-parameters.txt

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 20
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at de.ipbhalle.metfraglib.parameter.Constants.getIonisationChargeByNominalMassDifference(Constants.java:302)
	at de.ipbhalle.metfraglib.parameter.SettingsChecker.checkIonModeSettings(SettingsChecker.java:154)
	at de.ipbhalle.metfraglib.parameter.SettingsChecker.check(SettingsChecker.java:15)
	at de.ipbhalle.metfrag.commandline.CommandLineTool.main(CommandLineTool.java:89)

This exception is not clear, cannot guess where the error come from ( csv db file, ms2Peak file, parameters file ?).

I think the PrecursorIonMode parameter may be wrong (value is 191 in this case).

I tried this example on the web version and it return results.

@sneumann
Copy link
Member

sneumann commented Jun 27, 2020 via email

@rccc
Copy link
Author

rccc commented Jul 7, 2020

@sneumann : Many thanks for response.

Here are two parameters files and their results :

PeakListPath = /home/me/dev/mytool/app/MetFrag/1/22-197-ms2.csv
MetFragDatabaseType = LocalCSV
LocalDatabasePath = /home/me/dev/mytool/app/MetFrag/1/22-db.csv
NeutralPrecursorMass = 266.055165377
FragmentPeakMatchAbsoluteMassDeviation = 0
FragmentPeakMatchRelativeMassDeviation = 2
PrecursorIonMode = 43
IsPositiveIonMode = True
MetFragScoreTypes = FragmenterScore
MetFragScoreWeights = 1.0
MetFragCandidateWriter = ExtendedFragmentsXLS
SampleName = 22-metfrag_result
MaximumTreeDepth = 2
MetFragPreProcessingCandidateFilter = UnconnectedCompoundFilter
MetFragPostProcessingCandidateFilter = InChIKeyFilter
NumberThreads = 8
ResultsPath = /home/me/dev/mytool/app/MetFrag/1/result

Exception trace :

java -jar /home/me/dev/mytool/app/bin/MetFrag2.4.5-CL.jar /home/me/dev/mytool/app/MetFrag/1/22-197-parameters.txt

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 20
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at de.ipbhalle.metfraglib.parameter.Constants.getIonisationChargeByNominalMassDifference(Constants.java:302)
	at de.ipbhalle.metfraglib.parameter.SettingsChecker.checkIonModeSettings(SettingsChecker.java:154)
	at de.ipbhalle.metfraglib.parameter.SettingsChecker.check(SettingsChecker.java:15)
	at de.ipbhalle.metfrag.commandline.CommandLineTool.main(CommandLineTool.java:89)

A second parameter file :

PeakListPath = /home/me/dev/mytool/app/MetFrag/1/78-875-ms2.csv
MetFragDatabaseType = LocalCSV
LocalDatabasePath = /home/me/dev/mytool/app/MetFrag/1/78-db.csv
NeutralPrecursorMass = 324.0835227
FragmentPeakMatchAbsoluteMassDeviation = 0
FragmentPeakMatchRelativeMassDeviation = 2
PrecursorIonMode = 123
IsPositiveIonMode = False
MetFragScoreTypes = FragmenterScore
MetFragScoreWeights = 1.0
MetFragCandidateWriter = ExtendedFragmentsXLS
SampleName = 78-metfrag_result
MaximumTreeDepth = 2
MetFragPreProcessingCandidateFilter = UnconnectedCompoundFilter
MetFragPostProcessingCandidateFilter = InChIKeyFilter
NumberThreads = 8
ResultsPath = /home/me/dev/mytool/app/MetFrag/1/result

The exception trace :

java -jar /home/me/dev/mytool/app/bin/MetFrag2.4.5-CL.jar /home/me/dev/mytool/app/MetFrag/1/78-875-parameters.txt

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 20
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at de.ipbhalle.metfraglib.parameter.Constants.getIonisationChargeByNominalMassDifference(Constants.java:302)
	at de.ipbhalle.metfraglib.parameter.SettingsChecker.checkIonModeSettings(SettingsChecker.java:154)
	at de.ipbhalle.metfraglib.parameter.SettingsChecker.check(SettingsChecker.java:15)
	at de.ipbhalle.metfrag.commandline.CommandLineTool.main(CommandLineTool.java:89)

Regards
Eric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants