HUPO-PSI / mzTab

mzTab Reporting MS-based Proteomics and Metabolomics Results
https://hupo-psi.github.io/mzTab
39 stars 17 forks source link

jmzTab CLI jar assumes argument file paths are relative #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. java -cp mzTabCLI.jar uk.ac.ebi.pride.jmztab.MZTabCommandLine -convert 
inFile=/some/absolute/path/input.mzid format=MZIDENTML -outFile 
/some/absolute/path/output.mzTab

What is the expected output? What do you see instead?

Expected = Successful conversion from mzid to mztab.
Actual =
Exception in thread "main" java.lang.IllegalStateException: XML File to index 
does not exist: /current/working/path/./some/absolute/path/input.mzid

Apparently, the command-line converter attempts to resolve the argument file 
path relative to the current working directory.  Not only does this break the 
use case of absolute paths, but it should not even be necessary in Java.  It 
should be sufficient to just literally pass the String argument value from the 
command line to a File constructor, and then test for existence and readability 
of the input file.

Original issue reported on code.google.com by jjcarv...@gmail.com on 28 Oct 2014 at 6:09

GoogleCodeExporter commented 9 years ago
Thank you for helping us. I will take of the issue.

Regards,

Noe

Original comment by noedelta on 3 Nov 2014 at 10:40

GoogleCodeExporter commented 9 years ago
Hi Noe and Jeremy:
 For me the best option is to remove the -inDir and -outDir. I think it will be better to have only -inFile (file to be converted) and -outFile (file to export, if is not provided then use the Screen). Then, we should be able to use bash scripts to handle all the use cases.

Regards 
Yasset

Original comment by ypriverol on 3 Nov 2014 at 11:04

GoogleCodeExporter commented 9 years ago
Hi Yasset,

Thank you for this suggestion.  However, I'm not sure how removing the "-inDir" 
and "-outDir" parameters would solve this problem.  I am not using those 
parameters at all in the sample command line that I provided above.

It seems like the internal implementation of the "-convert inFile=X" and 
"-outFile" parameters needs to be changed, to allow for absolute paths to be 
passed as arguments.  Like I mentioned above, it should be as simple as just 
extracting these arguments from the command line and passing them directly to a 
Java File constructor.

Jeremy

Original comment by jjcarv...@gmail.com on 17 Nov 2014 at 10:24

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r586.

So before the call was similar to

java -jar mzTabCLI.jar -inDir temp -check inFile=SILAC_CQI.mzTab

With the new changes should be

java -jar mzTabCLI.jar -check inFile=temp/SILAC_CQI.mzTab

Original comment by noedelta on 17 Dec 2014 at 10:57