compomics / reporter

Protein quantification based on reporter ions
http://compomics.github.io/projects/reporter.html
4 stars 2 forks source link

Error when exporting paths.txt #17

Closed jcanderan closed 3 years ago

jcanderan commented 3 years ago

Hello,

If I try to use eu.isas.peptideshaker.cmd.PathSettingsCLI to export paths.txt, I get the following error:

An error occurred when saving the path preference to /dir/Reporter-0.9.1/lib/resources/conf/paths.txt.

Here is the relevant log info:

java.lang.RuntimeException: java.io.FileNotFoundException: /dir/Reporter-0.9.1/lib/resources/conf/paths.txt (No such file or directory)
        at com.compomics.util.io.flat.SimpleFileWriter.<init>(SimpleFileWriter.java:59)
        at eu.isas.peptideshaker.preferences.PeptideShakerPathParameters.writeConfigurationToFile(PeptideShakerPathParameters.java:391)
        at eu.isas.peptideshaker.cmd.PathSettingsCLI.setPathSettings(PathSettingsCLI.java:114)
        at eu.isas.peptideshaker.cmd.PathSettingsCLI.call(PathSettingsCLI.java:47)
        at eu.isas.peptideshaker.cmd.PathSettingsCLI.main(PathSettingsCLI.java:200)
Caused by: java.io.FileNotFoundException: /dir/Reporter-0.9.1/lib/resources/conf/paths.txt (No such file or directory)
        at java.base/java.io.FileOutputStream.open0(Native Method)
        at java.base/java.io.FileOutputStream.open(FileOutputStream.java:291)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:234)
        at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:184)
        at java.base/java.io.FileWriter.<init>(FileWriter.java:96)
        at com.compomics.util.io.flat.SimpleFileWriter.<init>(SimpleFileWriter.java:53)
        ... 4 more

I notice that Peptideshaker saves to resources/conf/paths.txt whereas Reporter is trying to save to lib/resources/conf/paths.txt so perhaps that is part of the issue (no conf dir in lib/resources?). The Reporter log is also going into lib/resources/ rather than just resources.

Thanks!

hbarsnes commented 3 years ago

Can you share the complete command line you are trying to execute?

Note also that you always have to provide complete paths when using them as input to our command lines.

jcanderan commented 3 years ago

You can duplicate the error with as little as doing:

java -cp Reporter-0.9.1.jar eu.isas.peptideshaker.cmd.PathSettingsCLI -temp_folder /test

(as long as /test exists)

However, if I manually go to Reporter-0.9.1/lib/resources/ and mkdir conf, then it works

So the problem is either the missing conf dir or the fact that it points to lib/resources rather than just resources as with Peptideshaker

hbarsnes commented 3 years ago

I think that if you change eu.isas.peptideshaker.cmd.PathSettingsCLI to eu.isas.reporter.cli.PathSettingsCLI it should work. At least the following command line works fine for me:

java -cp Reporter-0.9.1.jar eu.isas.reporter.cli.PathSettingsCLI -temp_folder C:\Users\Harald\Desktop\temp

(As long as the folder already exits.)

jcanderan commented 3 years ago

Thanks. That's works -- sort of:

If I do something like:

java -cp Reporter-0.9.1.jar eu.isas.reporter.cli.PathSettingsCLI -temp_folder /data/temp

The command is successful (although there's no indication of this as with peptideshaker). However, if you look at paths.txt:

reporter_exports=/data/temp
ory=resources
peptideshaker_user_preferences=/home/jamie/.peptideshaker
peptideshaker_exports=/home/jamie/.peptideshaker
unzip=default
cms=default
utilities_user_preferences=/data/temp
ptm_configuration=/data/temp
enzyme_configuration=/data/temp
gene_mapping=/data/temp/gene_mapping
pride_annotation=/data/temp/pride
identification_parameters=/data/temp/identification_parameters_4

Now if you try to run reporter, you'll get an error about the "ory=" entry.

java -cp Reporter-0.9.1.jar eu.isas.reporter.cli.ReporterCLI
An error occurred when setting path configuration. Default paths will be used.

I realize that's not the full command for Reporter but it's enough to trigger the error.

Here is the log entry for the error:

java.lang.IllegalArgumentException: Path ory not recognized
        at com.compomics.software.settings.UtilitiesPathParameters.loadPathParameterFromLine(UtilitiesPathParameters.java:168)
        at eu.isas.peptideshaker.preferences.PeptideShakerPathParameters.loadPathParametersFromLine(PeptideShakerPathParameters.java:202)
        at eu.isas.reporter.preferences.ReporterPathPreferences.loadPathPreferenceFromLine(ReporterPathPreferences.java:150)
        at eu.isas.reporter.preferences.ReporterPathPreferences.loadPathPreferencesFromFile(ReporterPathPreferences.java:122)
        at eu.isas.reporter.cli.PathSettingsCLI.setPathSettings(PathSettingsCLI.java:128)
        at eu.isas.reporter.cli.PathSettingsCLI.extractAndUpdatePathOptions(PathSettingsCLI.java:271)
        at eu.isas.reporter.cli.ReporterCLI.main(ReporterCLI.java:822)

Note that the offending part "ory=" can change as I have also seen "nces="

hbarsnes commented 3 years ago

Ah, yes, you are correct. I've just released a new version or Reporter (v0.9.2) that should take care of that issue as well. If this is not the case, please let me know and I'll reopen the issue.

Oh, and I also added the information that the paths have been updated same as for PeptideShaker. Thanks for pointing this out. :)