Topic: Bash script to move and rename Analysis.mzML two fold up - Multi open


We have a Bruker autoflex, which save in "fid".
We user Bruker CompassXport 3.0 to convert the data:
How to convert Bruker 'fid' format to an open format, which can be read by other programs.
The IUPAC standard is new file format "mzML", which is converted with "mode 2"
Copy you experiment with subfolders to C:\fid_convert_temp
Subfolders should contain "fid" files

Open command prompt, and write:
> compassxport.exe -multi C:\fid_convert_temp -raw 1 -mode 2

Each "fid" is now converted to a "Analysis.mzML" file in each subfolder.

Transferring to USB
Note, it is MUCH faster to make a .zip file and then copy it to USB E:\

The following problem was to multiple open spectre from several "shots" on the same spot on the target plate.
The files was organized like:
So one had to go into each folder and open the spectra.

I made a "mzML_move" script in my bin folder.
When executed, it will search each subfolder for "*.mzML", and move it two folders up,
and rename the "Analysis.mzML" file to: SPOT_SHOT.mzML

Now you can i mMass select all the files for one spot with "open" in mMass, and select them all.
And when opened, they get the file name.
And theb you find peaks, and use the "Save all" to ".msd" format for all them.
Really a time saver.

>touch ~/bin/mzML_move
>chmod +x ~/bin/mzML_move
>gedit ~/bin/mzML_move
find $PWD -iname "*$filetype" -type f | while read filename; do
BASEN=`basename ${filename}`
DIRN=`dirname ${filename}`
arr=$(echo $DIRN | tr '/' "\n"); arr=($arr)
arrni=`echo ${#arr[@]}`
spot=`echo ${arr[$arrni-3]}`
shot=`echo ${arr[$arrni-2]}`
#echo $spot
#echo $shot
#echo ${filename} ${DIRN}/../../${spot}${shot}${filetype}
cp ${filename} ${DIRN}/../../${spot}_${shot}${filetype}