rpeckner-broad / Specter

Specter: linear deconvolution for targeted analysis of data-independent acquisition mass spectrometry proteomics
17 stars 12 forks source link

Allow Specification of mzML Files' Directory #7

Closed DarioS closed 6 years ago

DarioS commented 6 years ago

The current interface allows one mzML file and one spectral library as input per execution. This means that the spectral library is imported once for each mzML file. Could there be an option to specify a directory of mzML files to be processed with a spectral library, thus avoiding the repeated importation of the library (e.g. I have 230 SCIEX SWATH files to process using a single spectral library) ?

rpeckner-broad commented 6 years ago

I've added a module MakePythonSpectralLib.py to the repo. Running it as MakePythonSpectralLib.py <blibName.blib> will produce a pickled Python dictionary with the name blibName_PythonLibrary that can be imported far more quickly than the blib. Note that you should still pass <blibName> to Specter.sh, without the .blib or _PythonLibrary extensions (it will recognize the _PythonLibrary version and import that instead of the blib). You can then run Specter.sh in a bash for loop over the files in your directory, i.e.

#!/bin/bash
for filename in /my/mzml/directory/*.mzML; do
    ./Specter.sh ... 
done

with the various arguments you want to specify.