Thursday, 29 September 2016

Installing Trinity on Mac OS X

One of the inevitable joys of bioinformatic life is the installation of a variety of esoteric softwares on a variety of system. As I've just moved to a new position in a new institution, I get to go through this rigmarole again.

This time around I have an extra layer of faffery, as I am now for the first time using a Mac (having been on Ubuntu for the last ten years, and Windows in the distant recollections from before that). While the machine is gorgeous and responsive, I am still in the interminable murky phase where I don't know the intricacies and easy ways of doing things yet (and am still battling muscle memory for keyboard shortcuts!), which means that I'm back down the learning curve a little.

Anyway, as I've just discovered an incredibly easy way to install a very useful tool, I thought I'd share it.

I was installing the excellent RNA assembler Trinity on my iMac running OS X (El Capitan), or at least trying to, according to its website. However, despite attempts at using different (and newer) compilers, I kept running into this error, presumably reflecting my attempts at using alternative compilers failing:

clang: error: unsupported option '-fopenmp' trinity mac

Happily it turns out that Trinity is supported by the fantastic third party package manager homebrew, which I had coincidentally just installed anyway (you don't bundle wget in, what the heck Apple?).

Homebrew is easily installed following the details on their website, and then installing Trinity was as simple as this:

brew cask install java
brew install homebrew/science/trinity

Not only was this dead simple, but it automatically installed a number of other programs (as dependencies of Trinity) that were on my list to install anyway (e.g. trimmomatic and bamtools). It also installs everything directly to /usr/local/bin/, so there's no mucking about with your PATH required. Lovely.

NB: Whilst looking around for hints as to how to solve this problem, I did find this thread on SeqAnswers which suggests that you might need to take a little extra care when running Trinity on Mac systems as opposed to Linux. Something to bear in mind.

Friday, 26 August 2016

Count how many MiSeq reads derived from each surface of the flowcell

I recently had call to perform one of those tasks that I think others might, yet not be entirely sure how to go about it.

Specifically, in troubleshooting a MiSeq run's poor yield, I wanted to see whether there were significantly more reads derived from one of the flow cell surfaces (top or bottom) relative to the other. The reason I did this was my FWHM (full cluster width at half maximum, a measure of the focus during imaging) was noticeably higher for that surface.

I mean, I have no idea if ~3 is that much worse than ~2.8-2.9, but there's no harm in checking right?
This is very easily achieved as all of the information required to work it out is contained within the FASTQ reads themselves, in tile section of the identifier line of each each.

Therefore with a quick bit of basic bash we can find out exactly how many reads derived from each surface.

# Get all index reads (as the shortest) in one file
zcat *I1*z > I1.fq

# Extract the identifier lines with sed
 # and grep for those with a '1' at the right position
 # This indicated they derived from the top surface
sed '2~4d;3~4d;4~4d' I1.fq | grep ^.............................1 -c

# Do the same for '2', i.e. the bottom surface
sed '2~4d;3~4d;4~4d' I1.fq | grep ^.............................2 -c

And there you have it. Simple, quick and effective.

(As it turned out I have almost equal numbers derived from both surfaces, so it wasn't to blame in my case, but this might be useful for other situations!)

Thursday, 25 August 2016

One laboratory, en suite sauna

In lieu of an actual proper scientific blogpost this week, here I recount a recent lab horror story that struck me. With thanks to my labmates sending me the freezer traces:
Sunday evening. Kicking back at home, something vaguely distracting on the telly. Doing the chores, which on this occasion included last minute packing in preparation for storing our belongings before leaving the country. Everything was all on track for a nice quiet and productive night in. Until a phone vibrates.
20:08, G: “Hello team. Freezer temp has alarmed at -59 just now. Anyone using it? Anyone around in lab?
Hmm that's a bother. Hopefully someone's just pulling a long weekend shift, maybe came in to bank a long point in a time course and was just being a bit slow to close the freezer after. If that's the case then they'll close it and this will blow over. Let's just wait a while and see who's there...anyone?
20:15, D: “The other freezer in that room is reading -62, might just be hot in there
Oh bugger, now they're both going. Luckily these alerts also go to a lab manager, he's a good guy, always on the ball, he'll sort it.
Except nope, no reply. Wait, is that it levelling out?
Hope indeed!
21:04, G: “sorry to report, there was no plateau - i think we have to do something tonight
Double bugger, because guess who lives closest?
21:19, me: “I am nearby
21:20, me: “If emergency action is called for
In I go, let's see how bad it is on the ground... And it's sweltering. No AC. No air movement. A small room with six giant -80s, all shrieking in concert if not in sync.
The blue ribbon rises as the sweat rolls down...
Running around, begging security for help, ringing managers, moaning on Whatsapp, come on come on, let's check the thermometer again...
It would have kept rising except here I propped open the fire door from the freezer room into the neighbouring lab, corridor, and convinced security to come and open the fire door to outside for a moment, giving a few blessed minutes of relief.
It doesn't last. The fire alarm decides to join the chorus, and thus the external door must close.
We need to move this cursed muggy miasma of stale heat, but where to go, and how to get there? Enter our trusty friend, the humble wedge. Let's prop open another door into the lab next door, knocking the smug grin off its air-conditioned face.
The good news starts to filter in.
Down to 39.5ºC on the thermometer; still fit for a steam room, but going in the right direction – we just need to speed this up. Let's go lab rustling!
Now we've got some circulation. It's still hot as heck, like standing in front of a giant hairdrier, but at least it's moving.
And there was much rejoicing
22:58, D: “Second Alert cancelled, you are a hero Jamie
23:06, T: “Jamie = hero 🏆
23:08, G: “Good thing he's not leaving for Boston or something...
23:09, G2: “Brilliant! Thanks Jamie!
23:09, Me: “Room is 38 now, so I think I can go home
Lauded in the Whatsapp group, my name will be rejoiced throughout the lab, and I get to go home to continue packing my belongings. All in a day's work, for The Postdoc That Lives Nearest The Lab!