Wednesday, 24 May 2017

Getting CDR3 nucleotide sequence out of Decombinator

I was recently asked whether CDR3translator (the CDR3 extraction component of the Decombinator suite of T-cell receptor analysis scripts) has an option to output the CDR3 nucleotide, rather than amino acid sequence.

There currently is not, and I don't think there's much call to institute it as a in built feature, but I knocked together a bodge for them and it's an easy one line change so I'm posting it here in case anyone else has use of it:


This just exploits the way that the script currently finds CDR3s: it reconstructs the whole V/J nucleotide sequence from the five part Decombinator index (storing it in the 'nt' variable), translates this into its amino acid sequence ('aa') and then looks for the conserved motifs at the appropriate positions ('start_cdr3' and 'end_cdr3').

If you multiply each of these by 3 then you get the correct positions to extract the CDR3 nucleotide sequence, running from the conserved V-gene cysteine to the J-gene phenylalanine. If you want the GXG portion of the FGXG motif then you’ll need to add '+12' before the final closing square bracket.

Wednesday, 1 March 2017

Extracting antigen-specific TCRs from vdjdb on the command line

My previous lab and I recently published a review on the techniques and possibilities of analysing TCR repertoire data produced from high-throughput sequencing.

By and large I'm exceedingly happy with it - apart from a couple of missed references and one very unfortunate mix up regarding the accessibility, I'm very pleased with how it came out (and hope it will prove useful!).

One thing that I'm particularly pleased that we included (in spite of the lack of published descriptions yet) is the pair of manually curated TCR databases that have recently emerged: VDJdb and McPAS-TCR, in which you can find a small (but growing) host of TCRs of known specificity and/or disease association. We thought it was important to get these out there as soon as possible, as this is a rapidly changing field which is currently sorely needing for such efforts at standardisation and resource development.

With that in mind, I've been playing around with both of these, and thought I'd share some of the bare bones of the bash code I've been using to pull out sequences related to epitopes I'm interested in. Here is my quick vignette using VDJdb to pull out HIV-reactive TCR sequences - and even then just the fields of the database I'm interested in - using basically just default terminal commands.

Saturday, 25 February 2017

Download specific DNA sequences from hg19 using Python

I've been working on a little side-project recently that involved needing to grab lots of different human DNA sequences based on their position, which lead me to discover the wonderful UCSC DAS server (from this informative Biostars thread).

Seeing as the rest of the project was written in Python, I knocked together a quick function to do just that. It's all nice and easy: just give it the chromosome number/letter*, and a numerical start and stop position, and the function returns the hg19 DNA sequence in that range.

I'm also trying to make a bit more use of GitHub (including knocking together a place for my publications), so I thought this was the perfect thing to make a gist from:

* Currently this function won't be able to grab anything from the unassigned chromosome contigs - just chromosomes 1-22, X, Y and mitochondrial (M) sequences.

Saturday, 28 January 2017

DNA in different cells, preventing autolysis and foetal cells in vaccine production


Continuing on the theme from my last post, here's a selection of my answers to recent questions that I saw on Reddit which I thought were interesting.

Is every cell [in our body] carrying the same DNA?

"The standard answer is usually yes, apart from...
• Mutations are the most obvious differences between cells, which usually comes up when this question gets asked. This happens in non- and pre-cancerous cells, but as genetic instability is a common property of cancer it tends to be much worse in cancer cells. It's also worth remembering that doesn't just mean the wrong base of DNA at a position, but can include insertions, deletions and duplications, not just of a base or two but potentially up to whole or huge chunks of chromosomes, even fusion between different chromosomes (which can make fusion proteins with novel functions). This is why you sometimes see aneuploidy (an atypical number of chromosomes) in some cancer cells.
• Gametes (i.e. sperm and egg cells, and their precursors). These germline cells aren't always grouped in when people ask this question, but they are definitely 'in our body' so I am! Not only are these cells haploid (only containing one copy of each chromosome) but during meiosis (the kind of cell division that produces them) the chromosomes undergo recombination, so the pairs of each chromosome will swap bits; this means that the gametes you produce won't have the same versions of the chromosomes that you inherited from your parents, but something in between. This helps keep our gene pool diversified.
• My particular favourite, as it's what I work on - adaptive immune cells. There are potentially infinite different kinds of viruses, bacteria and fungi etc which could infect us and do us harm, which we need to protect ourselves against. This is pretty hard to do with a finite, static genome, as the pathogens could quickly evolve around it. What we evolved is a branch of immunity - our adaptive immunity - which anticipates this huge diversity of infectious agents and responds in kind, by pre-emptively shuffling bits of DNA around to make millions of different receptors, to try to recognise as many different (non-self) things as possible. This happens in developing B-cells and T-cells, which is used to make B-cell receptors (which when released in a soluble form become antibodies) and T-cell receptors (BCRs and TCRs). This is acheived through a process called VDJ recombination, named after the segments of DNA which get recombined together to form a new gene. This provides the basis for how our immune systems learn - if you get infected with something that a particular TCR can bind say, that T-cell will divide and differentiate, which means that the next time you get infected with it those T-cells are already in place, waiting to go and fight it off.
• Microchimerism. In biology a chimera is an organism that contains cells from more than one zygote (fertilised egg). This happens in labs lot for various reasons (which is why you get mice like the one on the right, made up of cells from black-furred and white-furred mice zygotes), but it also happens naturally at some rate (with only a few cells making it microchimerism). The most common example we know of (at least for us placental mammals) is foetal chimerism, where cells from a developing foetus pass through the placenta and establish themselves - sometimes permanently - in the mother (which may help prevent her immune system rejecting the foetus). There are case reports where cells can go the other way (so say cells from the mother can be detected in the circulation of her child), although I think this mostly occurs when one or other seems to have some genetic condition. There also of course exist actual human chimeras - anyone who's ever had an organ or bone marrow transplant will have a large number of cells in which the DNA will be very different (although hopefully not at the MHC alleles, which mediate rejection), as it all came from the donor."

Why aren't cytoplasmic granules of natural killer cells degraded by the potent enzymes that they contain?
"There's a number of different mechanisms by which cytotoxicity is controlled. There's also some disagreement, and a lot we still don't know (which is always a good sign that someone's asking a good question!).
In terms of perforin specifically, there's two factors that come to mind that are probably the best answers to question. Note that they also all largely apply to cytotoxic T-cells as well as NK cells, as they use the same basic cytolytic machinery:
• Perforin requires calcium to form pores and insert to membranes, at concentrations that are typically only found outside (and not inside) cells. This means that the perforin should only work once its been secreted across an immune synapse.
• It also requires a pH above ~6, in order to adopt the correct conformation. Stored lytic granules are pretty acidic, which helps maintain the contents inactive (unless they are release and the acid is diluted out)
These points are covered pretty well in this detailed review, if you're interested. There are a number of other possibilities - like there may exist certain chaperones or regulatory proteins which help keep the perforin inactive, or that cleavable post-translational modifications may help keep in an inactive form. That latter one was quite notable, although it seems opinion has moved towards the glycosylation actually helping guide perforin along through the ER quickly during synthesis, to stop it lingering in calcium-rich/pH neutral compartments where it might do some damage."

[How is the HepA vaccine ethical when it uses MRC-5 cells?]
(NB: I think that this was probably just an anti-vaxxer account trying to colour people's views against vaccines given that it's the sole post from this user in a sub that gets high traffic from anti-vaccine proponents, but it is a valid question that a quick google doesn't produce many good answers for, so I thought it was worth addressing.)
"I'm presuming the ethical problem you're having is that some people have here is that the vaccine production involves MRC-5 cells, which are derived from an abortus foetus?
First off it's worth correcting one thing - the vaccine won't actually contain MRC-5 cells - it just uses the cells to grow the virus, which will then be inactivated to make the vaccine. Remember that viruses cannot grow on their own, they need to use cells to do so, so it's impossible to make an inactivated viral vaccine without cells. (It's also mostly impossible to make protein-subunit vaccines without cells, although you can use non-mammalian cells like bacteria or yeast in that case.)
However if your issue is with the fact that foetal cells were used at all, that's slightly trickier, and your interpretation of the facts may change depending on your viewpoint.
My view point is that early stage embryos are not sentient, and certainly not sapient, and aren't really 'people' as such (there's actually some great discussion on this in a thread that came up earlier in /r/biology today, which deals with this topic very well). MRC-5 cells came from a 14-week old foetus that was aborted for psychiatric reasons, well before the demonstrably concious stage of development.
Another way to look at it is like organ donation. If a baby died (for whatever reason), would you think it was unethical to transplant any organs from that child to others to save their lives? Despite a tragic thing happening, one, two, maybe even three other lives might have been saved or prolonged. If that's acceptable to you, consider that the foetus cells have basically been donated, more than forty years now, to an effort to protect millions of people from a horrible disease. Over 188 million doses of Hep A vaccines have been given; as just under 1% of infected people would be expected to die, a rough estimate would be that Hep A vaccination has probably saved at least 17 million lives (and prevented a great deal of non-fatal yet horrible disease).
(In fairness I'm not sure how many of those doses used MRC-5 derived vaccines, but then these cells are also used in the production of vaccines for other diseases too.)
From a different perspective, even if you don't accept the evidence that foetuses aren't sentient, even if you don't care and think that humanity begins at conception, even if you don't buy the organ/tissue donation analogy, there's a final pragmatic argument: we have the cells, and they work. If we want to stop people contracting, suffering or dying from preventable diseases, we need to use the tools that we have available. Hep A is a nasty disease, and we have a highly safe and effective vaccine - to my mind, advising people to not get the vaccine (in the absence of an equally good alternative) would be a much more unethical alternative."

Thursday, 12 January 2017

Can gut bacteria cause bad breath?

I know that I've been a bit remiss on the blogging lately, for all the usual reasons (busy at work, holidays, writing papers, general life admin etc). However I've noticed that instead I've been answering more technical and scientific questions on Reddit - it scratches the same itch as when I blog, but it's a shorter format that takes less effort, and someone else has thought up the question so I get the pleasure of consider something that I didn't think up in the first place.

I think I might occasionally repost some of the answers I posted there, to here, if only because I sometimes want to refer back to answers I gave and this blog moves (a lot) slower than Reddit.

Today, I just answered the question: can bacteria in the small intestine cause breath to stink?

To which I answered:

"In the case of people with "healthy" gastrointestinal tracts, these sphincters are one of the ways by which we keep the proper direction of flow (of food, which later becomes faeces along with all the associated gases), which in turn (usually) keeps bacteria where they're supposed to be.
The fact that the food that leaves the stomach (in a kind of watery paste called chyme) is still very acidic means it's still relatively inhospitable for bacteria, and has had less time for bacteria to enter/grow, which is why the small intestine ordinarily has much less bacteria (fewer species and fewer cells) than the large intestine (which is where the digesting stuff actually becomes faeces). Peristalsis (the movement of your intenstines that pushes everything along) drives the flow, making sure faeces and flatulence goes out the right hole. This movement is why you can still sometimes fart even when constipated (unless you're really impacted).
All these mechanisms keep the 'lower gases' coming out of the mouth - which is why in the vast majority of cases of bad breath originates from bacteria in the mouth. However IBS and constipation are obviously cases where all the digestive stuff isn't working like normal.
People with severe IBS and/or constipation can sometimes get so backed up (past the valve that you mentioned) that the small intestine gets way more bacteria then normal - this is called small intestine bacterial overgrowth (SIBO). In this situation, gases produced by bacteria in the small intestine can work their way up and out through the mouth (presumably bubbling up through the stomach as its sphincters open and close to let food through/burps out), including hydrogen sulphide, which is one of the classic halitosis related molecules. Checking someone's breath for volatile compounds produced by bacteria is actually one of the major ways by which doctors diagnose this condition.
I should say, I am not a gastroenterologist so I don't know whether these volatiles are frequently present at levels detectable to the human nose, which isn't something that seems to get measured a lot in the scientific literature, however I did find a couple of non-peer-reviewed reports like this that say bad breath can be a symptom of SIBO. In fact, some people even think that SIBO might be a/the cause of IBS (because if you treat it, you can reduce IBS symptoms in some people), but this is contentious and still being worked on.
So to answer your general question - it's plausible, although without testing it's impossible for anyone to say whether it's actually the case for you. Generally maintaining good oral hygiene is the best recipe to prevent bad breath, but in some cases there might be deeper medical issues, so it might be worth seeking the advice of a gastroenterologist."