Saturday, November 2, 2013

Remote Desktop Connection from Ubuntu

I have been enjoying Ubuntu Linux now since 2008.  Like many, I didn't see it as a viable replacement for Windows as I still require the suite of MS Office programs in order to functionally collaborate with colleagues.  As of 2011, I acquired a netbook which came with Windows 7, but was far to puny to run this OS properly, let alone drive normal programs once it came up.  Before long, I ditched Windows from this machine in favor of Ubuntu (11.04 at the time, now using 13.10).  This isn't a super laptop, far from it, but it is nice to know there is an OS I can handle with my ultra portable, bombproof netbook.  The thing has a 32GB SSD, 2GB SDRAM, wifi, and a 8.9" screen.  I used the xrandr command to build a short script to modify the lame 1280x600 native resolution of the screen to a more comfortable 1368x768, and with Libre 4.1 and access to the offerings of Google Drive, I am more compatible than ever with my Windows/Mac-loving colleagues.  And still, I can't shake Windows as I have several machines I use at work.

Until an Ubuntu edition of MS Office is available (ever?), I probably will never get away from Windows, but today I found one more reason to need Windows even less.  I was bouncing from computer to computer today taking data from various places and consolidating everything in Google Drive spreadsheets.  Once collated, I will then need to send my data to my on-campus Windows image where certain statistical packages reside (JMP, SAS).  I was busy all day with lab work and lamenting that I was going to have to come back in tomorrow to do this work, or else stay very late.  If only I could run my stats from my couch...

This is when I discovered rdesktop, an easy to use client for connecting to a Windows Remote Desktop Connection from an Ubuntu computer.  From Ubuntu, it is easy to install (probably in the software center too):

sudo apt-get install rdesktop

It is a small application and installs quickly.  You are almost done...

From the terminal (doesn't come up in the dash), type

rdesktop servername

(for me, rdesktop vlab.nau.edu)

You should be at your familiar login screen.  For other NAU users, you will need to click the "other user" button and change your domain (eg NAU\username) for login.  However, the native rdesktop window is uncomfortably small, and for some reason, window resizing is not an option.  Fortunately you can use the -g option to set a specific resolution (say, -g 800X600) or a percentage of your screen size.  I like the percent option and found 90% to work best in most cases (with the scaling, a portion of your window can protrude into neighboring workspaces at >95%).  So, now I login as follows:

rdesktop vlab.nau.edu -g 90%

But that is too much to type, so I wrote a little one line script to fill in the details for me.  In my local scripts directory I did the following:

nano vlab

This puts me into the text editor nano and starts me editing the new file called vlab.

Add the following text to the text editor:

     #!/bin/bash

     rdesktop vlab.nau.edu -g 90%

Hit ctrlX to exit nano, saving as you go.

Change the permissions of the file:

sudo chmod a+x vlab

Test your script locally:

./vlab

If it works, copy the script to your bin directory so it will be called no matter your working directory:

sudo cp vlab /bin/

That's it.  Now I can go home and run my stats, and all I have to do to get the thing running is open a terminal and type:

vlab

Best of all, I can now access a Windows computer running remotely from my Ubuntu Linux netbook, giving me one less reason to need/desire Windows on my portable computer.  Of course someday I will graduate, but that also means I could purchase a competent desktop computer in the future, keep it at work (or at home if workplace firewalls are too cumbersome), and access all my Windows needs from elsewhere, and negate any need to maintain synced cloud accounts (Dropbox, Ubuntu One etc) for my workplace documents.

Happy remote desktoping, Ubuntuers!

Wednesday, May 1, 2013

Mystery of pH change when flying

I have a little story to relate here, and I would be interested to hear back from anyone who has an idea what is happening.

It all started last summer when our lab took on a project for another lab at a different institution.  The researcher shipped me their DNA in plates, plus primers and instructed me to perform multilocus genotyping on the roughly 600 samples.  Upon receipt, I ran a quick PCR check of a few samples for each locus, and everything looked beautiful so I tossed the project into the freezer intending to process everything in a week or two when I knew I would have time to devote some time directly to this job.  When I got back to the project, I ran the same quick PCR check just to be sure, and this time nothing really worked.  Perplexed, I repeated the exercise, thinking that perhaps I forgot to add something crucial, but again the same non-result.  I spent the next two weeks frantically troubleshooting this project, hesitant to contact the client since I had no idea what had happened to once perfectly good DNA that had only been opened once and had been placed in a freezer with no temperature fluctuations.

Did I contaminate the DNA with some degrading compound in the brief period I had it opened?  This seemed unlikely since I do this process all the time, using the same lab practices I used during these PCR checks.  Eventually I contacted the other lab and they sent me more DNA to work with.  When I received that shipment, I processed all of the samples immediately in fear that they also would degrade.  During this processing, I stumbled onto a bit of evidence about what may have happened.  In my PCR mix, I use phenol red as a colorant.  This is also a handy pH indicator which is a lovely dark red above about pH 8, but goes to an alarming yellow when the pH drops.  I was doing small PCR reactions (4uL in 384well plates), so I had 3uL mastermix in a plate to which I was adding 1uL DNA.  I added some DNA to a set of these reactions, and watched as they immediately changed from red to yellow.  Immediately I took a few microliters of a sample and streaked it across a pH strip -- pH 5!!  This prompted me to inquire to the other lab about the method used to extract the DNA and the buffer in which it was stored, etc.  Samples were all extracted by the popular Qiagen kit, but this was actually done at a third lab so they weren't sure of the storage buffer.  I was put in contact with the next lab, and they claimed the DNA was always eluted in Tris-Cl pH 9.0 (hey, my favorite buffer!!).  I insisted this couldn't be the case and wondered if they had accidentally used nanopure water from an RO source or something that might actually have such a low pH, but they stated otherwise, and there was no use arguing anymore.  I finished processing the samples and put the whole mess behind me, thinking it would always remain a nagging mystery.

In November I traveled to another lab to learn a technique for a new instrument we had received.  As a part of this exercise I brought some DNA with me that I had prepared for the process, but paranoid as I can be, I decided to bring all the pieces of my chemistry along in case anything went wrong.  These pieces included several plates containing PCR reactions containing phenol red.  Everything traveled with me in my luggage in an insulated container with samples a bit of dry ice.  I inspected the contents upon arrival, and all seemed in order, so I tossed them into the freezer.  The next day, I prepared to process these samples, retrieving them from the freezer and allowing them to thaw.  I was making some notes into my lab book and picked up a plate to check if it had yet thawed and was horrified to find everything had gone to yellow!

"Not again," I thought.

I frantically started looking for some Tris buffer to add to bring the pH back to where it should.  Surprisingly, the lab I was in had none on hand, so I headed down the hall, bothering anyone I found in a lab for a little Tris.  I located some within 10 minutes, took an aliquot into a falcon tube and headed back to my precious samples.  I grabbed the first plate, and just before I tore the foil seal off, I saw the wells had gone from yellow back to red.  What the hell??  Upon closer inspection, I saw this was only the case in a few of the wells that I happened to have opened briefly, and thus exposed to the atmosphere before resealing.  Curious, I tore the foil seal off, put a new seal on, vortexed, and spun my plate down.  Now all the wells were back to red.

So exposure to the atmosphere seemed to have solved my pH problem.  So what can pH do to DNA?  DNA is actually a pretty stable molecule (read up on the RNA world hypothesis for why it is so stable).  It is an acid and as such, is most stable in a slightly basic buffer solution (that's why we love Tris so much).  However, raise the pH too much, and the bases no longer pair (e.g. alkaline denaturation as in Illumina preps), or decrease the pH too much and other bad things start to happen.  Low pH, I have read, leads to depurination (loss of A or G bases) of your DNA strands, effectively fragmenting DNA into unusable bits (no longer than about 30 nucleotides).  How low does it need to be?  In theory, anything acidic will contribute to this effect, but the more acidic you get, the more rapidly this will occur.  If my chemistry background serves correctly, things will really start to change as you approach the pKa of DNA, which is somewhere around pH 5.0 -- right about where I had measured the pH of the DNA from the project last summer.  Storing DNA in water, rather than a buffered solution is known to be less ideal than the buffer, and this may be related to the natural dissolution of carbon dioxide as carbonic acid from the atmosphere into standing water, but the pH of such water is generally measured around pH 6.7 or so, not terribly acidic at all.

So what could be happening here?  When you place samples into a plate sealed with foil, there is slow evaporation/sublimation of your storage buffer over time, presumably due to slow air exchange through the adhesive layer holding you foil in place.  During an average airplane flight, despite the pressurization of the cabin, everything on the plane is at a markedly lower pressure than when the plane is on the ground.  The gaseous contents of the cabin aren't terribly different than what you find at sea level, otherwise there wouldn't be enough oxygen to remain conscious at 35,000 ft.  So, low partial pressure of gaseous components, and subtle permeability of your sealed plate.  This should actually release dissolved gases back into the atmosphere, and the loss of carbonic acid should actually raise the pH.  But that's not what I saw, and everything can be fixed by thawing, removing the seal briefly, and applying a new seal upon arrival at your destination.  So problem solved, but what was the problem in the first place?

Anyone??

Monday, March 18, 2013

Bead cleanups

This post, which discussed results published by Rohland and Reich (2012), has been removed at the request of Beckman Coulter legal counsel.

Friday, February 22, 2013

DNA precipitations

Haven't posted in a while, so this will be quick.

People ask me about their protocols on a pretty regular basis.  Even if they don't ask specifically, I often ask to see their workflow so I can tell if I am giving reasonable advice in the context of their whole experiment.  One of the most common things I encounter is the insistence on putting samples in the freezer to "help" with precipitating their precious DNA.  However, this idea should have been laid to rest almost 30 years ago now with the publication of "Ethanol Precipitation of DNA" in Focus (Fall 1985, Vol 7, No 4) by Zeugin and Hartley.

The key findings of this paper are that precipitation is less efficient at low temperatures than worm temperatures, length of incubation time has minimal effect except for very dilute samples, and centrifugation time is the most important factor in planning your precipitation.  The precipitations in this paper were NaOAc/Ethanol precipitations with the final NaOAc concentration being 0.3M (1/10 vol 3M NaOAc) and the final EtOH concentration being 75% (~2.5 vols EtOH).

The authors concluded that cold incubation is not beneficial to the precipitation of DNA and can even be counterproductive if your sample contains only a small quantity of DNA.  They speculate that decreased temperature will increase the viscosity of the solution and inhibit the motion of DNA through the ethanol solution during centrifugation.  I agree with this idea, but I would also speculate myself that by removing energy from the system, you simply slow down the kinetics of precipitation where free cations associate with the ribo-phosphate backbone while ethanol drives water molecules out of the double helix structure resulting in precipitation of DNA in a salt form.  Certainly during centrifugation such interactions will increase, so lately my thinking has been that centrifugation is the only thing that matters much during your precipitation.  This is also supported by their data where they looked at length of centrifugation time on precipitation.  Again, high concentration samples precipitated readily while low concentration samples needed more time, but most concentrations seemed to taper toward maximum recovery at 30 min, which unfortunately, was the longest centrifugation time they tested.

For me, this has resulted in the following being my standard precipitation conditions.  I prefer NaCl over NaOAc because I have some loose data indicating better recovery (not shown).  I continue to use NaOAc during EtOH precips of cycle sequencing reactions.

1) Add NaCl to 0.15M.  No need to be exact here.  Use a 5M NaCl stock and you won't need to add much so the volume compensation is unnecessary.  For instance, if you have a 300uL sample, calculate as follows:  (300uL*0.15M)/5M = 9uL.  So just add 9uL 5M NaCL and save yourself the headache.  It's not worth it!!

2) Add 2.5 vols EtOH.  Many protocols say add 2-2.5 vols EtOH.  I think this is problematic since if you use 2 vols, your final EtOH concentration will be only 66% whereas at 2.5 vols you achieve about 71%.  This may seem subtle, but my experience (admittedly anecdotal here) has taught me 2.5 is always better.

3) Mix sample well, and place directly into the centrifuge.  For samples with decent concentration, 30 min at maximum speed.  For low concentrations, longer is better, so maybe 30 min to 60 min (your choice).

4) Immediately after the centrifuge stops, remove the tubes and decant into the sink (plates can be GENTLY centrifuged inverted on a paper towel at low RPM, low acceleration/deceleration for ~10 sec to remove supernatant as per ABI sequencing protocol).  If you happen to be out of the room when your centrifuge stops, start it again for 5 min or so to ensure your DNA is well-adhered to the wall of your tube.

5) Add 70% EtOH.  For 1.5mL tubes I usually do 500uL, for 96 well plates, I usually add 50uL.  Spin again at max speed, but only 10-15 min is necessary now.

7) Decant again as in step 4.  Dry samples down in a vacuum centrifuge, or place on a heat block (~55C) for 10 min to evaporate any residual ethanol.  If you have left over EtOH and you try to run a gel, your sample will maddeningly just float away.  It can also inhibit downstream enzymatic steps.

8) Resuspend in your favorite solution.  Some people like water, but since the pH of "pure" water is often a bit acidic, depurination is a real threat to your sample.  Some people like TE, but even small amounts of EDTA can inhibit a PCR reaction.  For these reasons my go to solution is Tris-Cl pH 8.5, 10mM.

So, I hope someone finds this useful.  Happy precipitating!!