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: http://verahill.blogspot.com.au/2013/07/480-ms-data-part-ii-plotting-and.html


1. Exporting data from wsearch32
To install wsearch32 under wine, see here: http://verahill.blogspot.com.au/2013/01/321-wsearch32-in-wine.html

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)

Done.

2. Using formula finder in Matthew Monroe's Molecular Weight Calculator
To install the molecular weight calculator in wine, see here: http://verahill.blogspot.com.au/2012/09/matt-monroes-molecular-weight.html

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:
 Methanol:
 Nitrate:
 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:




10 July 2013

473. Programming a Metrohm Titrino -- not a how-to, just a ramble

Many, many years ago I learned basic programming using BASIC (the version that came with PC DOS 5, I think). I even wrote the odd game, but it was all pretty awful. A few years later I learned Turbo Pascal, which was a fantastic experience compared to Basic. It felt all sciency and grown up, and it was my first experience with a real IDE. I even ended up buying a TP book, and became somewhat proficient. This must've been when I was around 18-19.I then stopped programming completely.

At around 30 years of age I decided it was time to get serious about programming again -- I was doing mass spectrometry and needed a simple program that could generate a series of solutions to the identity of a mass/charge ratio given a range of elements. I probably had a quick look at C and C++, but ended up getting a Python book and have been happy Python programmer ever since.

The problem is that I've never been a /good/ python programmer -- and in all these years I've never fully understood the use for (or, in all fairness, use OF) OOP. And at the moment it seems to be holding me back -- all the examples that I find of the use the threading module as well as writing GUIs (using e.g. wxPython) involve using classes. And I just don't understand them well enough to sort out what I need done.

Anyway, long story short: I've written a basic program for communicating with a Metrohm Titrino 736 GP via RS 232. It's found here: https://sourceforge.net/projects/pytitrino/

Currently:
* the code is a mess (see above)
* it works fine for doing monotonic and dynamic end point titrations (MET and DET)
* it saves data to a file, but does so silently (i.e. when you run you won't get any feedback that things are working properly...)
* it uses the thread (not threading) module
* I've managed to pass parameters back and forth between the thread and the main loop using Queue

There are probably much better solutions. One day I hope to be able to stick a GUI on top of it, but the more I look at it I get the impression that one writes the GUI first, then the engine...not that I'd know.

Anyway. That's what I've been up to. Anyone with a bit of programming experience, whom is in possession of an old-school Titrino (i.e. using RS 232) and wants to save $1.5k in software licenses may be interested in taking the sources and turning them into something useful.


03 July 2013

472. Briefly: Iranian PhD students in Australia

I'm not going to leave much in the way of a comment, but this doesn't seem to have been publicised enough. Searching the web quickly didn't bring this up at all, and it's a shame since it's important, in particular if you are an Iranian national thinking about doing a PhD in Australia.

About a week ago the faculty in the chemistry department at my university were informed that heavy restrictions in terms of access to instrumentation has been put in place for students from North Korea, Syria and Iran via Federal legislation.


While I don't think there are any students from North Korea or Syria around, there are several Iranian students at different stages of their PhD. In fact, I would say around 50% of our applicants are from India, 25% are from Pakistan and 20 % are from Iran (in terms of accepted students the ratio is very different)


In practical terms, this means that Iranian students in the department are not allowed to use:
FT-IR
UV-Vis
NMR
Mass spectrometers
Raman
dosimeters
OES/AAS
etc.

All of which are standard instruments which most chemists would find necessary to do research. In addition, they can hardly be considered as being cutting edge, trade secrets or anything like that -- commercial NMR instruments have been around since the 1950s, infrared an UV/Visible spectroscopy go much further back. Mass spectrometry is a standard tool which, although many of the current designs only go back to the 1980s (e.g. ESI), is so conceptually simple and innocuous, that (to me) restrictions on it doesn't make sense. And so on.

In addition, supervisors of Iranian students have been asked to draw up a risk management plan to prevent student access to the above instruments, which is a particular problem given that they are used in teaching as well, and are available on a walk-in basis to undergraduate students doing projects in research labs.

Currently, any supervisor who has an Iranian student needing to use any of the instruments above will need to assign another student to do these measurements for the Iranian national.

While this doesn't formally preclude Iranians from coming to Australia to do a PhD, we have been advised that we should reject any applicants at this point. This may change once the university has figured out exactly where they must draw the line in terms of restricting access to Iranians to different facilities, but for now it's a blanket ban.

My personal opinion is that while you'd be led by the media to think of anyone from North Korea, Syria and Iran as potential spies, these are real people too. Many Iranians would either be completely disinterested in politics, or actively antipathetic to their regime. And the best thing about democracies -- we shouldn't have any issues with them supporting their government either. So I don't really agree with this as a security measure to prevent nuclear proliferation, which must surely be the stated goal.

And if the idea is to put in place sanctions to promote regime change, then why limit the type of instrumentation that students can access? Or are we trying to punish the children of the leadership in Iran? Then why not limit the sanctions to those specifically? Top students tend to come from all socioeconomic classes.

The timing is also very odd, given the recent election of a moderate.

And why Iran and not Belarus, China, Zimbabwe etc.?

Again, I don't like putting opinion pieces on this blog (other than as minor parts/rants of posts with actual content) but I think this should be publicized more.