Showing posts with label matt monroe. Show all posts
Showing posts with label matt monroe. Show all posts

12 July 2013

474. MS data, part I: Exporting data as csv from wsearch32, and generating MS assignments using Matt Monroe's molecular weight calculator

NOTE: I've heard rumours about problems with wsearch on Windows 7 Home, and on Windows 8. I've heard reports of it working on Windows 7 Professional. Curiously, it works just fine on linux under wine.

This post is written with two particular students in mind. I could put this in a pdf and email it, but why not share with the wider world since other people may encounter the same issues?

See here for part II:

1. Exporting data from wsearch32
To install wsearch32 under wine, see here:

In order to export data from wsearch so that you can plot it in e.g. gnuplot, octave, origin or excel, do the following:

Open a spectrum (chromatogram) and pick a slice, then click on the M/I icon in the bottom right:

 Pick Save As

 And save as e.g. csv (comma separated file)


2. Using formula finder in Matthew Monroe's Molecular Weight Calculator
To install the molecular weight calculator in wine, see here:

Open the molecular weight calculator and go to edit abbreviations.

 Add an abbreviation for MeO. We'll call it Methx, and it has a charge of -1:
 Hit OK to save the changes.

 Go to formula finder:

We'll be looking for Ga, NO3, MeOH, O, H, MeO. Then click on Formula Finder Options:
 Limit the charge to 1:
 And search:

You can do fancier stuff, e.g. searching directly for the m/z and bound the search to min/max amounts of different elements:
 As shown here:

28 September 2012

248. Matt Monroe's Molecular Weight Calculator under Wine on Linux

I've downloaded the source code to Matt Monroe's molecular weight calculator in the past, and having replaced wsearch32 (+wine) with OpenChrom I figured I'd go online, download it and see what Mono can do for me. I had a vague recollection that the source code was only freely available online for a short while, and as it turns out I couldn't find it this time.

Anyway, not finding the source code I decided to update my Molecular Weight calculator from version 6.46 to 6.49 which (finally) allows you to set the charge of an ion WITHOUT having the mass of a H+ added for each charge. It's not difficult to compensate for, but it's always confusing to new students.

1. Install Wine and winetricks, add dlls
You can either install wine from the repos (old version)
sudo apt-get install wine-bin

Or you can download a newer, unstable version from

Or you can compile your own:

The mono step was a right headache and would fail unless I nuked everything winetricks and wine knew about each other/

To get winetricks and set everything up:

sudo apt-get install cabextract
sudo mv winetricks /usr/local/bin/
sudo chmod +x /usr/local/bin/winetricks
wine msiexec /i wine-mono-0.0.4.msi
You're now asked whether to download and install mono...sigh...more often that not this has failed in the past.
winetricks vcrun6sp6
Download the file from the browser window that just opened
cd ~/.cache/winetricks/vcrun6sp6 
mv ~/Downloads/Vs6sp6.exe .
winetricks vcrun6sp6
winetricks corefonts
winetricks riched30
wine uninstaller --remove '{E45D8920-A758-4088-B6C6-31DBB276992E}'
winetricks dotnet20
cd ~/.cache/winetricks/dotnet20/
mv ~/Downloads/dotnetfx.exe .
winetricks dotnet20
Ignore this error. Installation will take a while after that. Have patience. Like 10 minutes kind of patience.
And finally:
winetricks wsh57

2. Download the molecular weight calculator and install
If you go to
you get redirected to here:

cd ~/tmp
mkdir molw
cd molw/
ls *.zip|xargs -I {} unzip {}

You'll get some warning about Revisionhistory.txt etc. being overwritten. That's fine.

Launch the install with
wine msiexec /i MolecularWeightCalculator.msi

If you try to launch the mol weight calculator at this point you'll get an error about a missing MwtWinDLL.dll:

So sort that out:

cd ~/tmp/molw/bin
regsvr32 MwtWinDll.dll
Successfully registered DLL MwtWinDll.dll
[If I tried to copy the dll to the wine structure first and register that copy I got:
DllRegisterServer not implemented in DLL C:\windows\system\MwtWinDll.dll]
If it seems weird to install wine-mono and then remove it as is done above, it's to get around a bug which causes dotnet20 installation to fail/

Anyway, you're pretty much done:
 wine ~/.wine/drive_c/Program\ Files/Molecular\ Weight\ Calculator/mwtwin.exe


Getting there was a bit of a trek, passing though a whole lot of different sets of dlls:
winetricks msflxgrd
winetricks vcrun2005
winetricks vb6run
winetricks mdac28
winetricks comctl32ocx
winetricks comctl32

The solution above should suffice though.

I even ended up installing mol weight calc on a windows box and using dependency walker, but not even that sorted it out -- googling for scrrun did it in the end.

In particular this last error was bloody annoying:
"Object doesn't support this action." What, saving?

"Error saving default options file. Use the /X switch at the command line to prevent this error."
But it was solved by doing winetricks wsh57