ipb-halle / MetFragRelaunched

Relaunch of the initial MetFrag project.
http://ipb-halle.github.io/MetFrag/
18 stars 16 forks source link

Correct use of local Database in MetfragCL #16

Open chufz opened 5 years ago

chufz commented 5 years ago

Hello,

I am using Metfrag2.4.3-CL with java/8/74 on a centOS based system. since I am working on some metabolites, which are not available in PubChem, I want to implement a local Database. For that, I built up both a csv and psv file which was correctly working on the Web server version. The file is looking like in the example in the tutorial, e.g. for the first line:

MonoisotopicMass|InChI|Identifier|InChIKey2|InChIKey1|MolecularFormula 305.13675|InChI=1S/C15H19N3O4/c1-15(2,3)12(19)13(18-9-16-8-17-18)22-11-6-4-10(5-7-11)14(20)21/h4-9,12-13,19H,1-3H3,(H,20,21)|P_07_M2_M2|UHFFFAOYSA|BOEKJKNSKOAINE|C15H19N3O4

I tried with following parameter file to implement the local database

PeakListPath = <filepath> NeutralPrecursorMolecularFormula = C11H15N3O2 NeutralPrecursorMass = 221.115 SampleName = <samplename> MetFragDatabaseType = LocalPSV LocalDatabasePath = ~/DBmetfrag.psv FragmentPeakMatchAbsoluteMassDeviation = 0.001 FragmentPeakMatchRelativeMassDeviation = 10 PrecursorIonMode = 1 IsPositiveIonMode = True MetFragScoreTypes = FragmenterScore MetFragScoreWeights = 1.0 MetFragCandidateWriter = CSV ResultsPath= /home/huberc/180813_Pesticide_DDPos/Metfrag_parfiles MaximumTreeDepth = 2 MetFragPreProcessingCandidateFilter = UnconnectedCompoundFilter MetFragPostProcessingCandidateFilter = InChIKeyFilter FilterSuspectLists= ~/test.csv

`Nevertheless, I am getting following error message:

java.lang.ArrayIndexOutOfBoundsException: 2 at de.ipbhalle.metfraglib.database.LocalPSVDatabase.readCandidatesFromFile(LocalPSVDatabase.java:162) at de.ipbhalle.metfraglib.database.LocalPSVDatabase.getCandidateIdentifiers(LocalPSVDatabase.java:42) at de.ipbhalle.metfraglib.process.CombinedMetFragProcess.retrieveCompounds(CombinedMetFragProcess.java:77) at de.ipbhalle.metfrag.commandline.CommandLineTool.main(CommandLineTool.java:104) ERROR de.ipbhalle.metfrag.commandline.CommandLineTool - Error when retrieving compounds.`

schymane commented 5 years ago

Does your command line version work with a CSV file you download directly from the MetFragBeta web interface, rather than one you created? I.e. try retrieving a candidate set for C11H15N3O2 and download this file and use this as your local database instead and see if that works …

chufz commented 5 years ago

Hi, the downloaded .csv worked fine. It does have a different structure than the example files in https://msbi.ipb-halle.de/~cruttkie/databases/

I will implement the databases in this structure now. Thanks for help.