AlanRace / imzMLConverter

Tool for converting mass spectrometry data to the imzML format.
15 stars 5 forks source link

Combining mzML into single imzML output with command line #16

Open fejacko opened 10 months ago

fejacko commented 10 months ago

I figured out how to convert a single mzML file to imzML, however I am having trouble converting many mzML files into one imzML with the --combine (or -c) flag.

I can get the conversion to happen with the --image-dimensions flag, but the outfile only ever has the last mzML file that was converted (and the "max count of pixels y" is only ever "1").

Whether I use a wildcard: java -jar jimzMLConverter-2.1.1.jar imzML path/to/files/*.mzML --image-dimensions 74 50 -o outfile

Or if I list multiple files: java -jar jimzMLConverter-2.1.1.jar imzML path/to/files/file1.mzML path/to/files/file2.mzML path/to/files/file3.mzML --image-dimensions 74 3 -o outfile

I'm not sure whether to add the -c flag or use it instead of the --image-dimensions flag, but either way it throws an Exception error and nothing is converted (when I try to use a wildcard or list mzML files):

Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1967)
        at com.alanmrace.jimzmlparser.parser.ImzMLHandler.parseimzML(ImzMLHandler.java:180)
        at com.alanmrace.jimzmlparser.parser.ImzMLHandler.parseimzML(ImzMLHandler.java:156)
        at com.alanmrace.jimzmlconverter.ImzMLToImzMLConverter.getImageSizes(ImzMLToImzMLConverter.java:83)
        at com.alanmrace.jimzmlconverter.ImzMLToImzMLConverter.setImageGrid(ImzMLToImzMLConverter.java:97)
        at com.alanmrace.jimzmlconverter.MainCommand.convert(MainCommand.java:493)
        at com.alanmrace.jimzmlconverter.MainCommand.main(MainCommand.java:186)

@AlanRace, any direction you can provide would be greatly appreciated!