Pages

Friday 4 March 2016

Merging Datasets into a matrix for analysis

I have n samples/datasets, each which is giving me variables and their associated values.
In the case of mass spec data, this is a (string) formula and the (float) relative abundance of that formula.

For each sample, there may be a thousand or more formula.

Across all the samples, there will be formula common to some or all samples, and formula unique to some samples.

Examples shown at end of post.

Are there any easy ways to merge all of these into a single table which is then easily imported into R or Python for analysis?

(Sidenote: I wrote a script to do this with masses and intensities, its not particularly efficient or easily modified to work on strings).

Help!


Thanks :)

Example:
From four CSVs with a structure like this:


To one data table with a structure like this:


Sample ID C10H20O2 C11H22O2 C10H20O3 C11H22O3
Sample1 0 15 26 3
Sample2 19 88 29 0
Sample3 54 0 66 0
Sample4 30 32 0 0

Friday 12 February 2016

Absolute Integrals from TopSpin

Problem:

I have a large number of samples which I have performed the same NMR experiments on.

One of the experiments (expno 12) produces a simple 1D 13C NMR spectrum with 2 peaks. 
These peaks are shifted ever so slightly between different spectra (due to concentration effects).

I can batch process them (phase, baseline), including peak picking, and defining an integration region mathematically that defines the same percentage of the lorentzian curve for both peaks.

However, I cannot get an output from TopSpin (automatically, batch process) which reports the absolute integrals of that spectrum. 

The integrals.txt file records only the relative integral, which is not useful to me (as I will be comparing a number of samples over a period of time and dont wish to have to re-integrate every sample every time). 

The mutli_integ au program looked promising, but is based on a series of expnos within the same sample file. I have the same expno across different samples. Additionally, it also only seems to report the relative integral (but relative across the set). 

The intser method also will not work as it redefines the intrng for each spectrum to be the same - which is not effective as my peaks shift.

Any ideas?

(TopSpin 3.2 pl7 and 3.5 pl4)


Monday 26 October 2015

SPECTRE

---SPOILERS---


Probably



SPECTRE

Quo Vadis, James?
Some initial thoughts...


It's a bold decision to retcon in the 24th installment in the worlds' most popular movie franchise/longest running/fricken' Bond.

It's why the movie is so good.
Yet, it's why the movie is a disaster.


First things first, the key thoughts:

The plot was kinda obvious; Blofeld was blatantly obvious; is this another reboot, a continuation of the Skyfall reboot, or a continuation of the Casino Royale reboot? It seems to be all at once; Not enough Monica Belluci; Fantastic cinematography; Did Mendes seriously rip the plot from Goldmember? (Yes, Austin Powers); Where next? 

The movie was beautiful (but we knew it would be after Skyfall).
The acting was incredible. Some of the best performances in 53 years of Bond.
Sam Smiths song works with the film (which we knew it would after Skyfall).

But the plot? The homages? I'm left kinda numb to throwbacks when every other line or scene is clearly appropriating something from an earlier work. The clinic in the Alps is OHMSS. The unloaded gun is Casino Royale. Blofeld is The Classics. The train is a fairly familiar trope by now (but see From Russia With Love). The desert expanses are Quantum. Blofeld being Bonds brother is Austin Powers. The cat and the scar. The brain drill is the torture chair in The World Is Not Enough and the laser/circular saw in Goldfinger. (Was the Royles the same from Goldfinger too?).

And whats with the Doctor Who-esque/fan fiction style of never letting something die?
Take the DB5. That car was never featured as much in the classics as people think. It was in CR and Skyfall, before it's destruction.
And then Q rebuilt it? OK...

I just saw the film, and I don't know what to think. I loved it, but it also felt really empty. If it's a reboot or reimagining of the classics, then OHMSS-2 is coming up, and I know how that ends. And if so, why? But if not, why this film?

And why tie everything in Craig's tenure up into one supermassive evil group that he has now seemingly ended? This movie sets up a series of Bond vs Blofeld films (or a trilogy), and yet ends with Bond capturing Blofeld alive, and not executing him (despite the fact he is the "author of all [Bond's] pain"). Bond has killed in cold blood for less. Blofeld is now captured, and escapes? Or worse yet, doesn't? We don't need to see another set of Bond vs Blofeld, much like we dont need to see any more Doctor vs Daleks...

But that shit sells.



-------

tl;dr
The film is entertaining, just don't think about it too much.

85 popcorns