Hacking Global Health London 2016

A few months ago I’ve participated in a Hackaton organized by Open Data Science on data from the Healthy Growth, Birth, Development knowledge integration (HBGDki) initiative by the Bill and Melinda Gates foundation.

The aim of this initiative is to collect data on child growth and development from several sources, to study which factors influence child growth and how to better intervene when there are risks. Currently the data comes from manual annotation of several publications, but future plans include launching a global effort to collect data systematically, and actually one of the objectives of the hackaton was to guide the planning of this effort.

I had a lot of fun during the hackaton and learned a lot. For me personally was an opportunity to learn more about the caret R package, which is a must-known library for doing machine learning in R. My plan for the hackaton was actually to do a trajectory clustering to see if there were different trajectories of growth of the baby during pregnancy, but unfortunately the analysis didn’t return very interesting results 🙂

See my github repo for some jupyter notebooks, and the slides on slideshare for more info.

Published a “Post Publication Review” on Publons

A while ago I posted in this blog an analysis on fitness genes, illustrating an use of the Bioconductor data packages and based on a recently published paper (Are fitness genes more conserved across species?).

This week I have been contacted by the team of Publons and asked to paste the same analysis on their platform as a “Post Publication Review”. Of course I’ve accepted: Post Publication Review of High-Resolution CRISPR Screens Reveal Fitness Genes and Genotype-Specific Cancer Liabilities

Publons is a social network for peer reviewer, where you can list of papers you reviewed, get credit for it, and even post new reviews on published papers. I personally like the idea of Publons very much, because I think that reviewing papers is an important part of science, which unfortunately doesn’t get the recognition it deserves.

Hiding cows in the genome (a.k.a. an introduction to bash programming)

Preparing the materials for a workshop on bash programming is very difficult, because you never know which level of skill to expect from the people attending it.

Click on the image to access the slideshow.

Most of the times the class will be a mix of absolute beginners and expert Unix users, and it is not easy to prepare a presentation that will interest both. If the materials are too advanced, the beginners will get frustrated and stop paying attention. If the materials are too simple, expert users will get bored soon and get distracted, and start working on their own things and checking facebook.

In an attempt to avoid these issues, I’ve decided to go for a trick that hopefully would get the attention of even the most advanced bash guru, which is: hiding cows in the genome.

More precisely, for a workshop at the Programming for Evolutionary Biology conference held this year in Belgrade, I designed the exercises in a way that the instructions for the next step can be retrieved using the correct bash commands. Students start with a file of randomly generated text, and they have to use grep and other unix tools to proceed to the next exercise. If the exercise is done correctly, they also see a cow.

I think it worked decently, because the students liked the idea and finding cows in the fasta and bed files was fun.

The workshop’s materials are below. (if the iframe doesn’t work, click here). If you are a teacher and organize workshops on bash programming, here I am officially challenging you to include something similar in your next presentation 🙂

[iframe src=”https://nbviewer.jupyter.org/format/slides/github/dalloliogm/belgrade_unix_intro/blob/master/PEB%20Bash%20Workshop.ipynb#” width=”100%” same_height_as=”window” scrolling=”yes”]

Data Annotation Packages in BioConductor

Bioconductor does not only contain analysis packages, but also a good suite of data packages, frozen from the most important data sources for bioinformatics (e.g. EBI, NCBI, UCSC, etc..).

These data packages are useful because because they allow to access certain biological relevant data quickly and without having to manually download them from the web. They are used internally by several analysis packages (e.g. to calculate ontology enrichment, get gene coordinates, etc..), and in a way they improve the reproducibility of your analysis, because by updating them within R you will access to the same version of the data frozen as for anybody else using them.

This slideshow provides a quick summary of all the data annotation packages available, how to use them and how this part of bioconductor is evolving.

Click on the screenshot to access the slideshow.
Click on the screenshot or here to access the slideshow.

I’ve prepared the slideshow for the second workshop at the Programming for Evolutionary Biology in Belgrade I’ve presented this year. It is probably less glamorous than the Bash slideshow, as there are no hidden cows, however it may be more useful, specially if you use Bioconductor regularly.

Disclaimer: I am not a bioconductor developer, but just an user. So apologies if I wrote anything wrong 🙂

Interviewed by LabWorm for NCG

Our group has been interviewed by LabWorm regarding our recent publication on Network of Cancer Genes 5.0.

I absolutely love the “artist impression” they made of our team:

The NCG team sketched by LabWorm. Thanos Mourikis, me, and Omer An.

LabWorm is a collaborative platform for sharing tools and links related to bioinformatics. They have a very modern and interactive user interface, and they are very active in adding new links and involving people in the platform.

Over my too many years of experience in the bioinformatics field, I saw many attempts at creating collections of bioinformatics tools. Unfortunately many of these failed because of lack of interest or lack of maintenance. However LabWorm seems to be doing things right for the moment, as they really work hard to engage people in their community, and they even publish some blog interviews to researchers.

The bioinformatics community really need a effective way to share tools and links, and I really hope that LabWorm will be successful in their attempt.

Are fitness genes more conserved across species? my 30-minutes attempt

A recently published paper by Hart et al presented a genome-wide CRISPR screening to identify fitness genes (a superset of essential genes) in five cell lines. The paper is quite impressive and shows the potentiality of CRISPR to generate large scale knockouts and to characterize the importance and function of genes in different conditions.

In the discussion the authors propose that fitness genes are more likely to be more conserved across species. However they do not follow-up on this hypothesis, probably for lack of space. They can’t be blamed as they already present a lot of results in the paper.

Distribution of conservation scores in the phastcons.100way.UCSC.hg19 track. Are essential genes more conserved than other genes?
Distribution of conservation scores in the human genome. Are essential genes more conserved than other genes?

This post presents a follow-up analysis on the hypothesis that fitness genes are more conserved than non-essential genes. I’ll take the original data from the paper, get the conservation scores from bioconductor data packages, and do a Wilcoxon test to compare the two distribution. The full code is available as a github repository, and please feel free to contribute if you want to do some free R/Bioconductor analysis.

Continue reading

Tutorial on working with Genomics data with bioConductor – part I

BioConductor includes many powerful packages for working with genomics data. You can do pretty much everything, from downloading gene coordinates and sequences of any model species, to converting gene ids and symbol, and to accessing ENCODE data and anything in UCSC, Ensembl, and other resources. However these packages are not always well known,  and the initial learning curve is a steep, specially for R beginners.

This series of tutorials will describe how to get gene coordinates from bioconductor, intersect these with some interesting dataset from ENCODE, and do an enrichment analysis with DOSE. It will be fun 🙂

Libraries required for this tutorial

For this tutorial we will use only Human data. Most of the packages needed for working with human genomics can be installed with a single command:

The Homo.sapiens package is a container that includes the most important packages for working with human data. In particular it contains two data packages:

  • TxDb.Hsapiens.UCSC.hg19.knownGene is a TxDb object containing the coordinates of all the genes, transcripts, and exons in the human genome
  • org.Hs.eg.db is what you need to convert all gene ids – from entrez to ensembl, to GO, and so on.

The data in these packages is updated periodically (I think every 6 months), and is pretty stable, meaning that anybody using the same packages and version should be able to reproduce the same results. An alternative to using these data packages is biomaRt, but I prefer the data packages as they can be used without internet connection.

The package AnnotationHub is used to retrieve data from multiple sources and will be described later. The BSgenome package is for retrieving the human genome sequence: we will not use it in the tutorial but I included it for completeness.

Note that I also loaded the dplyr package for this tutorial. Although dplyr is not needed for working with genomics data, I consider it one of the most useful packages in R, and this tutorial will make heavy use of it. I apologize if this tutorial is not easy to follow to people not familiar with dplyr.

Retrieving gene and transcript coordinates

The TxDb object can be used to retrieve coordinates of genes, transcripts, and exons in the human genome. For example, we can access all human transcript with the transcript() function:

See help(transcripts) for other functions that can be applied to a TxDb object. For example, genes() retrieve coordinates of genes, while exons() and promoters() work similarly.

In the example above I also specified a “columns” parameter, in order to show the gene id as well. You can use this column to get the coordinates of a specific set of genes. For example, the following will retrieve the coordinates of the genes corresponding to entrez ids 1234, 231, and 421:

Converting Entrez IDs to symbols and other IDs

One of the most tricky part in bioinformatics is converting gene ids to symbols and other ids. Many errors can be made in this process, and is therefore very important to have a consistent way to convert gene ids.

Luckily, we can use the org.Hs.eg.db for easily converting many ids. This package should already have been loaded with library(Homo.sapiens). To see all the possible conversion tables (bimaps) available, we can either to library(help=org.Hs.eg.db) or simply write “org.Hs.eg” and then hit tab on the R command line .

One of my favorite bimaps is the one to convert gene symbols to entrez. As you may know, for historical reasons the same gene can have more than one symbol. This usually complicates things a lot, and a safe procedure is to always convert symbols to entrez before starting any analysis. The ALIAS2EG bimap is there for this type of conversion:

When you convert symbols to id, it is important to remember that not only the same gene can have more than one symbol, but also the same symbol can match multiple entrez ids. For example, here is the code to get which symbols match more than one entrez id in the human species:

Note: the “%>%” symbol and the count, arrange functions come from the dplyr package.

The only safe thing to do in these cases is to identify the duplicated symbols and either discard them or manually curate them. Let’s imagine that a fellow researchers asked us to retrieve information for the genes ACT, DOLPP1 and MGAT3. We can use the bimap to identify the genes that map to multiple entrez id, and then go back to our colleague and ask him to tell us which are the correct ids.

In these examples I converted the bimap to a dataframe and then did an intersection. However the “bioConductor” way to use these bimaps is through the select function:

One big problem with these bioconductor packages is that they clash with many dplyr functions. For example, the select function gets overwritten if you load dplyr after Homo.sapiens, and the only option to avoid headaches is to explicitly refer to the function as AnnotationDbi::select. These conflicts in the namespace can cause a lot of confusion in R, because they let to weird error messages that are completely unrelated to the real problem.

In any case, the advantage of the select function is that it allows to retrieve more id types at the same type. For example here I retrieved both entrez id and ensembl ids, and if you type columns(org.Hs.eg.db) you will be able to see many other possible output columns.

Next parts of the tutorial

I was originally planning to write one big tutorial in the same post, but now I see that it would be much more readable if I split it into multiple posts.

Please let me know if you have any comment regarding this first tutorial, and I will try to improve it and take the feedback into account for the next parts.