-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconvert_to_mzML.sh
executable file
·43 lines (38 loc) · 1.49 KB
/
convert_to_mzML.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
SOURCE="/data/massspec/bbbznas01/wiff"
DEST="/data/massspec/mzML"
# SOURCE="/Users/jo/data/bbbznas01/wiff/"
# DEST="/Users/jo/data/mzML/"
#DEST="$SOURCE"
IMAGE="/shared/Software/singularity/containers/pwiz-skyline-i-agree-to-the-vendor-licenses_latest.sif"
## Note: $DEST can point to a folder where already converted and centroided
## mzML files are located. If a same-named file exists there, conversion of
## the wiff file is skipped. Note that the mzML file is still created IN THE
## SAME FOLDER as the wiff file.
## Simple script to convert Sciex wiff files to mzML files using proteowizard's
## msconvert utility (see the README for more information on installing
## msconvert - via docker).
find $SOURCE -type f -name "*.wiff"|while read fl; do
res_fl="${fl%.wiff}.mzML"
res_fl_dest=`echo $res_fl | sed "s|$SOURCE|$DEST|"`
if [ -f "$res_fl_dest" ]; then
echo "file $res_fl_dest exists, skipping"
else
dr=`dirname "$fl"`
TMPWINE=`mktemp -d /dev/shm/wineXXX`
singularity run \
--cleanenv \
-B $TMPWINE:/mywineprefix \
-B "$SOURCE:$SOURCE" \
$IMAGE \
mywine msconvert "$fl" -z -o "$dr" --outfile "$res_fl" \
--chromatogramFilter "index[0,1]"
sleep 2; rm -rf $TMPWINE
fi
done
echo "-=== All done ===-"
# docker run --rm -e WINEDEBUG=-all \
# -v "$SOURCE:$SOURCE" \
# chambm/pwiz-skyline-i-agree-to-the-vendor-licenses \
# wine msconvert "$fl" -z -o "$dr" --outfile "$res_fl" \
# --chromatogramFilter "index [0,1]"