Monday, January 8, 2018

Get a bioinformatics education online for free

You can now get an entire bioinformatics education online for free. This is thanks to 1) the explosion in Massive Open Online Courses (MOOCs) and 2) academics making more and more of their work (especially books) open access, meaning they're available to anyone at no cost. MOOCs are a great option for students looking to supplement their education to make them more attractive to bioinformatics hiring managers. A biology major can use MOOCs to learn how to program and analyze data, while other STEM majors lacking biology credits can take MOOCs on molecular biology and next generation sequencing technologies. MOOCs are a great option for professionals looking for a career change or promotion since you can learn extra skills on your own time. MOOCs can even be an option for someone looking to get into a science as a hobby (bioinformatics is one of the few fields in the biomedical sciences where you can analyze the genetic code of cancer from home in your underwear). Courses start every few weeks, so there are ample opportunities to get started quickly if you're ready to get started. 

When it comes to online platforms, it's best to stick with ones partnered with or owned by a major university. Two of the most popular platforms are Coursera (Johns Hopkins) and edX (Harvard). Because these platforms are affiliated with top universities in the United States, it is not uncommon to have your course taught by a leading researcher in a particular topic. These platforms offer a range of bioinformatics-related courses from introductory biology and introductory programming to advanced concepts like deep learning and systems biology. Most of these courses have an audit option, which allows you to take them for free. However, the downside to auditing is that you might not be able to access certain course materials (Coursera), you won't be able to submit certain assignments or get grades for your work (Coursera), and you won't receive a certificate proving that you successfully completing the course (both Coursera and edX).

In addition to having standalone courses, Coursera and edX both feature paid specializations (edX calls them "XSeries"). Specializations are series of related courses designed to help you master a specific topic. On Coursera, many specializations build your knowledge on a topic and culminate in a final Capstone Project that you can put straight onto GitHub. If you read my guide on your first bioinformatics project, then you know the importance of having a project to showcase your talents to prospective employers. Completing a specialization earns you a Specialization Certificate, and these certificates should be used to enhance your resume/CV and to show potential employers that you are competent in a particular topic. Not only are they good CV padding, but paid specializations will give you a little skin in the game and make you more accountable to yourself (many who start free MOOCs never finish them).

There are literally thousands of courses on Coursera alone, so it can be hard to parse through them all to find the ones that are worth your time. Here, I give a handpicked list of courses that will give you the tools you need to get quickly up to speed in bioinformatics. This is by no means an exhaustive list since bioinformatics touches on so many different areas. Instead, I focus on core competencies and then suggest optional courses that you can take depending on your interests and the type of job you'd like to get. For my recommendations, I tend to favor specializations because they give you a more cohesive experience instead of feeling like a patchwork of disconnected information. I start off with introductory courses for building your knowledge of both biology and programming. If you are already comfortable with biology or have an undergraduate biology degree, then I would suggest focusing more on the programming and data analysis courses. It's better to know some biology and spend time perfecting your programming skills than it is to be an expert at biology who flounders at simple coding tasks. On the other hand, if you are a STEM major familiar with programming and data analysis, then it is probably worth your time learning biology to understand the context of the bioinformatics problems you will be working on. If you are coming from outside of STEM, then I really recommend going through all of the introductory courses. Getting a solid foundation is the basics is necessary for handling the advanced concepts to come. Next, I list intermediate courses. These are the bread and butter of bioinformatics and include a lot of the type of work you can expect as a bioinformatician. It's fair to say a lot of bioinformatics positions focus on gene expression pipelines and data analysis, so this is reflected in these intermediate course recommendations. Even if you aren't super familiar with more exotic types of data (I work almost exclusively with proteomics and metabolomics data), the education you receive in these intermediate courses will give you the ability to tackle most types of problems you come across. Then, I list advanced topics to further hone your skills. These courses tend to be on the more difficult side, but they are well worth the time investment to hone your skills. Finally, I end with a number of popular, freely available books. These make good companions to the courses or can even serve as good introductory texts if you prefer self-learning.

Introductory Courses

Biology

Essential Human Biology: Cells and Tissues
Perfect for someone with zero biology experience, this course will give you an introduction to the structure and function of human cells and tissues and lay a foundation for more advanced topics.

Introduction to Biology - The Secret of Life
Introductory level molecular biology course hosted by professor Eric Lander, one of the leaders of the Human Genome Project. The course content reflects the topics taught in the MIT introductory biology courses and many biology courses across the world.

DNA: Biology’s Genetic Code
Most bioinformatics projects (probably the vast majority) revolve around next generation sequencing technologies and genomics, so it's really important to get a solid foundation in this area. This course explores the basics of DNA structure, packaging, replication, and manipulation. 

Computer Science and Programming

Fundamentals of Computing Specialization (Option #1)
I list two computer science tracks here depending on your preferences. I love this specialization because of the emphasis on developing critical mathematical problem solving and algorithmic thinking. These skills are the bread and butter of a bioinformatician. 

The courses include:
  • An Introduction to Interactive Programming in Python (Part 1)
  • An Introduction to Interactive Programming in Python (Part 2)
  • Principles of Computing (Part 1) 
  • Principles of Computing (Part 2)
  • Algorithmic Thinking (Part 1)
  • Algorithmic Thinking (Part 2)
  • The Fundamentals of Computing Capstone Exam

Python for Everybody (Option #2)
This track will take you through 'fundamental programming concepts including data structures, networked application program interfaces, and databases, using the Python programming language'. This track places a bit more emphasis on practical application, so it might be a good option if you find yourself struggling with the first track (which is a bit more mathy/technical). 

The courses include:
  • Programming for Everybody (Getting Started with Python)
  • Python Data Structures
  • Using Python to Access Web Data
  • Using Databases with Python
  • Capstone: Retrieving, Processing, and Visualizing Data with Python

Optional

Introduction to the Biology of Cancer
There are a lot of cancer-related bioinformatics jobs in big pharma and at academic centers, so knowing a thing or two about cancer can help you land a job. This optional course introduces the molecular biology of cancer (oncogenes and tumor suppressor genes) as well as the biologic hallmarks of cancer. 

Epigenetic Control of Gene Expression
This optional course introduces you to epigenetics, the study of heritable changes in gene function that do not involve changes in the DNA sequence. This is a more specialized course and might not be applicable to everyone, but you can run into trouble landing a job that involves epigenetics or epigenomics without some background in this area.

Introduction to Computer Science aka CS50x
Learning to program is important, but learning to think like a computer scientist is equally as important. This is a good skill to develop for a bioinformatician since you will be called upon to solve complex problems at the intersection of computer science and biology. CS50x is an immensely popular course taught in person at Harvard that has been adapted for the edX platform. 

Intermediate Courses

Bioinformatics

Bioinformatics Specialization (Option #1)
You've got three really great tracks to pick from for your core bioinformatics competencies. These three tracks cover roughly the same topics, so you should look in to each to see which one piques your interest and is right for you. This first specialization comes from the creators of rosalind.info (a free bioinformatics practice site). The first course in this track, "Finding Hidden Messages in DNA (Bioinformatics I)", is listed as a Top 50 MOOC of All Time, and there are even two print textbooks (highly recommended) that go along with the course: Bioinformatics Algorithms Volume I and Volume II

The courses include:
  • Finding Hidden Messages in DNA (Bioinformatics I)
  • Genome Sequencing (Bioinformatics II)
  • Comparing Genes, Proteins, and Genomes (Bioinformatics III)
  • Molecular Evolution (Bioinformatics IV)
  • Genomic Data Science and Clustering (Bioinformatics V)
  • Finding Mutations in DNA and Proteins (Bioinformatics VI)
  • Bioinformatics Capstone: Big Data in Biology (Bioinformatics VII)

Genomic Data Science Specialization (Option #2)
Taught by renowned data scientist and biostatistician (Jeff Leek, Johns Hopkins ), this specialization will give you the skills you need to understand, analyze, and interpret data from next generation sequencing experiments. Features hands-on exercises with the command line, Python, R, Bioconductor, and Galaxy. 

The courses include:
  • Introduction to Genomic Technologies
  • Genomic Data Science with Galaxy
  • Python for Genomic Data Science
  • Algorithms for DNA Sequencing
  • Command Line Tools for Genomic Data Science
  • Bioconductor for Genomic Data Science
  • Statistics for Genomic Data Science
  • Genomic Data Science Capstone

Data Analysis for Life Sciences and Genomics Data Analysis (Option #3)
This track consists of two complementary XSeries. Both are taught by another renowned data scientist and biostatistician (Rafael Irizarry, Harvard). Data Analysis for Life Sciences '...is perfect for anyone in the life sciences who wants to learn how to analyze data. Problem sets will require coding in the R language to ensure learners fully grasp and master key concepts.' The second part of the track, Genomics Data Analysis, '...is an advanced series that will enable students to analyze and interpret data generated by modern genomics technology... is perfect for those who seek advanced training in high-throughput technology data.'

The courses include:
  • Statistics and R
  • Introduction to Linear Models and Matrix Algebra
  • Statistical Inference and Modeling for High-throughput Experiments
  • High-Dimensional Data Analysis
  • Introduction to Bioconductor: Annotation and Analysis of Genomes and Genomic Assays
  • High-performance Computing for Reproducible Genomics
  • Case Studies in Functional Genomics

Other Intermediate Courses

Data Structures and Algorithms Specialization
Knowing the right algorithm to use can mean the difference between a job that takes an hour or a week to run. This specialization has a combination of theory and practice, and you will implement nearly 100 algorithmic coding problems in your language of choice (instead of just taking a multiple choice quiz like many MOOCs). This specialization also features two big, real-world projects: Big Networks and Genome Assembly. The first involves analyzing different networks (e.g roads, social) and finding the shortest path. The second will cover assembly algorithms and assembling genomes from millions of short fragments of DNA.
  
The courses include:
  • Algorithmic Toolbox
  • Data Structures
  • Algorithms on Graphs
  • Algorithms on Strings
  • Advanced Algorithms and Complexity
  • Genome Assembly Programming Challenge

Optional

Big Data Specialization
As a bioinformatician, working with tens of thousands of sequenced genomes or millions of radiology images (e.g. CAT scans) means you'll need to know a thing or two about big data. This specialization will give you hands-on experience with the tools and systems you need. These courses take you through the basics of using Hadoop with MapReduce, Spark, Pig and Hive, and you will be shown how to ask the right questions about data, how to communicate like a data scientist, and how to perform exploration of large, complex datasets. 

The courses include:
  • Introduction to Big Data
  • Big Data Modeling and Management Systems
  • Big Data Integration and Processing
  • Machine Learning With Big Data
  • Graph Analytics for Big Data
  • Big Data - Capstone Project

Mathematical Biostatistics Boot Camp 1 & Mathematical Biostatistics Boot Camp 2
These courses will help if you are struggling with some of the statistical concepts you encounter in your training as a bioinformatician. They introduce 1) the fundamental probability and statistical concepts used in elementary data analysis and 2) fundamental concepts in data analysis and statistical inference. These courses are appropriate for '...undergraduate students with junior or senior college-level mathematical training including a working knowledge of calculus. A small amount of linear algebra and programming are useful for the class, but not required.'


Advanced Courses

Machine Learning and Deep Learning

Machine Learning (Option # 1)
This first option is actually a standalone course (in lieu of a specialization) because I like it so much. It is taught by one of the world's foremost experts in machine learning (Andrew Ng, Baidu Research/Stanford University). The fact that this course is available for anyone to take is mind blowing. I highly recommend it. You will be given an introduction to machine learning, data mining, and statistical pattern recognition. You'll learn both supervised and unsupervised methods as well as best practices in machine learning. The course features numerous case studies and applications, so you'll be getting a taste of everything from '...building smart robots (perception, control), text understanding (web search, anti-spam), computer vision, medical informatics, audio, database mining, and other areas.'

Machine Learning Specialization (Option # 2)
If you want to spend a bit more time getting familiar with machine learning, then this four course specialization in machine learning from the University of Washington is for you. 'Through a series of practical case studies, you will gain applied experience in major areas of Machine Learning including Prediction, Classification, Clustering, and Information Retrieval. You will learn to analyze large and complex datasets, create systems that adapt and improve over time, and build intelligent applications that can make predictions from data.'

The courses include:
  • Machine Learning Foundations: A Case Study Approach
  • Machine Learning: Regression
  • Machine Learning: Classification
  • Machine Learning: Clustering & Retrieval

Deep Learning Specialization
An entire Deep Learning specialization by Andrew Ng? Yes please! This specialization will teach you the foundations of deep learning, how to build neural networks, and how to run a successful deep learning project. They cover everything from convolutional networks and recurrent neural networks (RNN) to long short term memory (LSTM), Adam, Dropout, BatchNorm, Xavier/He initialization, and more. These courses teach you both the theory and how deep learning is applied in industry.  This includes several case studies in healthcare, autonomous driving, sign language reading, music generation, and natural language processing. This course is taught in Python and in TensorFlow.

The courses include:
  • Neural Networks and Deep Learning
  • Improving Deep Neural Networks: Hyperparameter tuning, Regularization and Optimization
  • Structuring Machine Learning Projects
  • Convolutional Neural Networks
  • Sequence Models

Other Advanced Courses

Systems Biology and Biotechnology Specialization
Many bioinformaticians work in systems biology, '...[a] field of study that focuses on complex interactions within biological systems, using a holistic approach to biological research.' This broad field utilizes a whole slew of different methodologies, so this specialization introduces you to topics like dynamical modeling, network and statistical modeling, "omics" technologies (e.g. genomics, proteomics), and single cell research technologies. Upon completion, you'll know how to combine experimental, computational, and mathematical methods to answer questions in a variety of biomedical fields. 

The courses include:
  • Introduction to Systems Biology
  • Experimental Methods in Systems Biology
  • Network Analysis in Systems Biology
  • Dynamical Modeling Methods for Systems Biology
  • Integrated Analysis in Systems Biology
  • Systems Biology and Biotechnology Capstone

Recommended Free Books

Programming

Advanced R - Free Online Version - Buy Print Version 
R programming book by data scientist Hadley Wickham (credentials include Chief Scientist at RStudio, and an Adjunct Professor of Statistics at the University of Auckland, Stanford University, and Rice University)

Think Python - Free Online Version (1st Edition) - Buy Print Version (2nd Edition) 
'Think Python is an introduction to Python programming for beginners. It starts with basic concepts of programming, and is carefully designed to define all terms when they are first used and to develop each new concept in a logical progression. Larger pieces, like recursion and object-oriented programming are divided into a sequence of smaller steps and introduced over the course of several chapters.'

Statistics and Data Science

An Introduction to Statistical Learning with Applications in R - Free Online Version - Buy Print Version 
'This book provides an introduction to statistical learning methods. It is aimed for upper level undergraduate students, masters students and Ph.D. students in the non-mathematical sciences. The book also contains a number of R labs with detailed explanations on how to implement the various methods in real life settings, and should be a valuable resource for a practicing data scientist.'

Think Stats - Free Online Version - Buy Print Version 
'Think Stats is an introduction to Probability and Statistics for Python programmers. Think Stats emphasizes simple techniques you can use to explore real data sets and answer interesting questions. The book presents a case study using data from the National Institutes of Health. Readers are encouraged to work on a project with real datasets. If you have basic skills in Python, you can use them to learn concepts in probability and statistics. Think Stats is based on a Python library for probability distributions (PMFs and CDFs). Many of the exercises use short programs to run experiments and help readers develop understanding.'

Exploratory Data Analysis with R - Free Online Version - Buy Print Version 
'This book teaches you to use R to effectively visualize and explore complex datasets. Exploratory data analysis is a key part of the data science process because it allows you to sharpen your question and refine your modeling strategies.'

The Elements of Statistical Learning (2nd edition) - Free Online Version - Buy Print Version 
'During the past decade has been an explosion in computation and information technology. With it has come vast amounts of data in a variety of fields such as medicine, biology, finance, and marketing. The challenge of understanding these data has led to the development of new tools in the field of statistics, and spawned new areas such as data mining, machine learning, and bioinformatics. Many of these tools have common underpinnings but are often expressed with different terminology. This book describes the important ideas in these areas in a common conceptual framework. While the approach is statistical, the emphasis is on concepts rather than mathematics. Many examples are given, with a liberal use of color graphics. It should be a valuable resource for statisticians and anyone interested in data mining in science or industry. The book's coverage is broad, from supervised learning (prediction) to unsupervised learning. The many topics include neural networks, support vector machines, classification trees and boosting--the first comprehensive treatment of this topic in any book.'

Machine Learning

Understanding Machine Learning - Free Online Version  - Buy Print Version 
'Machine learning is one of the fastest growing areas of computer science, with far-reaching applications. The aim of this textbook is to introduce machine learning, and the algorithmic paradigms it offers, in a principled way. The book provides a theoretical account of the fundamentals underlying machine learning and the mathematical derivations that transform these principles into practical algorithms. Following a presentation of the basics, the book covers a wide array of central topics unaddressed by previous textbooks. These include a discussion of the computational complexity of learning and the concepts of convexity and stability; important algorithmic paradigms including stochastic gradient descent, neural networks, and structured output learning; and emerging theoretical concepts such as the PAC-Bayes approach and compression-based bounds. Designed for advanced undergraduates or beginning graduates, the text makes the fundamentals and algorithms of machine learning accessible to students and non-expert readers in statistics, computer science, mathematics and engineering.'

Biology

Molecular Biology of the Cell - Searchable Online Version (4th Edition) - Buy Print Version (6th Edition)
'Molecular Biology of the Cell is the classic in-depth text reference in cell biology. By extracting fundamental concepts and meaning from this enormous and ever-growing field, the authors tell the story of cell biology, and create a coherent framework through which non-expert readers may approach the subject. Written in clear and concise language, and illustrated with original drawings, the book is enjoyable to read, and provides a sense of the excitement of modern biology. Molecular Biology of the Cell not only sets forth the current understanding of cell biology (updated as of Fall 2001), but also explores the intriguing implications and possibilities of that which remains unknown.'

Molecular Cell Biology - Searchable Online Version (4th Edition)  - Buy Print Version (8th Edition)
'Modern biology is rooted in an understanding of the molecules within cells and of the interactions between cells that allow construction of multicellular organisms. The more we learn about the structure, function, and development of different organisms, the more we recognize that all life processes exhibit remarkable similarities. Molecular Cell Biology concentrates on the macromolecules and reactions studied by biochemists, the processes described by cell biologists, and the gene control pathways identified by molecular biologists and geneticists. In this millennium, two gathering forces will reshape molecular cell biology: genomics, the complete DNA sequence of many organisms, and proteomics, a knowledge of all the possible shapes and functions that proteins employ.'

Misc.

How to be a modern scientist - Free Online Version 
'A book about how to be a scientist the modern, open-source way.'

Wednesday, September 20, 2017

How to ask a good programming question

Bioinformatics is full of programming challenges, but did you know that there are people on the Internet right now who are willing to give you programming advice for free? There is just one catch: no one is going to help you if you waste their time. Ever see a painful-to-read question on a help site where the original poster (OP) asks a question, someone responds asking for more information, OP responds with not enough information, someone else responds asking for further clarification, and so on? This is an example a bad question. Time is important to most people, and bad questions waste OP’s time and potential respondents' time. Not many people have the time or patience to go through the effort of deciphering a bad question. On the other hand, a good question will be straight to the point and contain all of the information necessary for someone else to quickly answer the question. Asking a good question makes it much easier for someone to respond since the problem will be clear and example code will be provided. There are five elements to asking a good question, and if you follow these elements, you will drastically increase your chances of receiving a response. However, there is a key point to keep in mind before you ask your question: don't be lazy.

Don't be lazy
In my opinion, the worst type of question is "How do I do xyz?" This type of question is almost never appropriate to ask because it's too broad. When you're soliciting help from a stranger, you need to have a little skin in the game, and this type of question will make it abundantly clear that you haven't put any effort into finding a solution on your own. Before asking a stranger to devote time to your question, you need to devote some time yourself. If you're not sure where to start, then work through a tutorial on xyz, go find a book on xyz, see how people have implemented xyz themselves on GitHub, search StackExchange for questions on xyz, or anything else you can think of to increase your knowledge of xyz. 

You should now be at the point where you’ve tried to implement xyz yourself and you now have a specific question. Keep in mind that you will still need to do some homework (even with a specific question) before posting your question. If you ask a simple question that can easily be Googled, then you might never get a response or you might get a lot of passive aggressive links to LMGTFY. Google can give you a helpful link to documentation or to StackExchange where your question has already been answered. If you’re having trouble finding your specific error or problem with Google, then please see this post for suggestions on how to format your search

The five elements to a good question
Now that you’ve done your due diligence, you can ask your good question. There are five key elements that make up a good question. Follow these to maximize your chances of receiving a response:
  • First, a good question needs a good title that clearly and succinctly conveys the problem. On most sites, only the title of your question will be visible until someone clicks on it, so you better make it straight to the point. An example of a bad title would be "BAM file confusion”, which doesn't specify what the actual problem is, whereas "Trouble calculating average coverage for a BAM file" will make it clear what the issue is. Your title doesn't necessarily have to be in question tense as long as it gets the point across. 
  • Second, have a leading sentence or two about what you're trying to accomplish. Having an idea of the big picture is helpful to others because if gives context to what you’re trying to accomplish. This context might even get you recommendations for shortcuts or alternative approaches that you hadn't considered. After this leading sentence should be the statement of the problem or the asking the question that you’d like answered.
  • Third, include a short, self-contained, correct/compilable example (SSCCE). This is crucially important. Coming up with a SSCCE reduces the number of things that could be going wrong in your code and allows others to quickly reproduce the issue you're having. Most sites allow you to embed code directly into your post, but you can also post your code to a site like Pastebin, which has features like syntax highlighting. Make sure to include sample output, any errors that you get, and other relevant information (operating system, versions of programs/programming languages, etc.). 
  • Fourth, make sure you proofread your post. If you want someone to give you a serious answer, then you want to show that you are serious by using proper punctuation and grammar. Next, ask yourself if your question is clear and straight to the point. Three paragraphs of background before you get to any code means that you aren't being straight to the point. Long, rambling questions like this will cause a lot of TL;DR.
  • Fifth, help others help you. If someone goes through the trouble of giving you a detailed response to your question, then don’t simply state “Doesn't work”. Make sure you specify why it doesn’t work. Make an updated SSCCE with the new code. Are you getting a new error message? Is the output different now?

Where to ask your good question

Now that you know what makes a good question, you will need somewhere to post it. Since a majority of bioinformatics is computer work, StackExchange is a great place to find answers to programming and system administration related questions. The StackExchange communities have a voting system where the best answers rise to the top. This feature makes it very easy to find quality responses to previously asked questions. StackExchange now features a new bioinformatics community for bioinformatics-related questions, but historically a StackExchange-like site, Biostars, has been the place to go for bioinformatics questions. The bioinformatics subreddit has a very active community and it's rare that a good question goes unanswered. Another option is SEQanswers, a popular forum dedicated to bioinformatics and next generation sequencing. Some software developers (like R) maintain mailing lists where you can email in a question which gets disseminated to everyone subscribed. To me, this method is a bit slower than getting help from the above sites, but occasionally obscure bioinformatics software might not be well known on a mainstream site like StackExchange and your only hope for support is via a mailing list. If you're encountering some strange behavior or you think you've run into a bug in a program, then you should consider emailing the developer directly or opening an issue wherever the project’s code repository is hosted (these days, it’s likely to be GitHub).

Monday, August 14, 2017

Your first bioinformatics project

Nothing will improve your bioinformatics skills like creating your own project, and nothing proves your bioinformatics skills to a prospective employer (or university admissions committee) like having your own project to showcase. Yes, having a solid foundation in biology and programming is important for anyone looking to do bioinformatics, but studying biology and programming books until you're blue in the face will not get you practical insights like your first project will. 

Picking your First Project

As a beginner it might seem hard to know where you can carve out your own little piece of bioinformatics and contribute to the community, but rest assured that there are more problems than there are bioinformaticians to solve them, so with a little digging you can find something cool to work on while simultaneously solving a problem. Your project doesn't even have to solve a Big Problem™ in bioinformatics. A cooler/better/faster way of doing something existing is still enough for a first project. Even a neat way to visualize existing data is enough. If you're having trouble identifying a project to work on, then this might be a sign that you need to do some more background research. Once you're familiar with a topic, it is REALLY easy to identify a problem that hasn't been solved or an area for improvement. There are many different subspecialties in bioinformatics, so to help narrow down your choices, you could always consider an area that a potential employer might be interested in, or if you still can't decide, then pick an area that might have broad appeal. For example, genomics and personalized medicine are on fire right now, so a project related to next generation sequencing pipelines will probably have more appeal than a project dealing with protein crystal structures. Still looking for ideas? Why not ask a biologist on r/biology about the pain points in their work or data analysis and come up with a bioinformatics solution for them?

If you're having trouble choosing a project or if you're that you have the programming skills it takes to complete a project, then I'd like to suggest working on some bioinformatics-specific programming problems. The exercises in regular programming books are great, but they don't get you thinking about programming in the context of biology. With this in mind, try working through some bioinformatics-specific programming problems on rosalind. rosalind poses real bioinformatics problems for you to solve, gives you the relevant background, and allows you to instantly check your solution through a web interface. rosalind gives you exposure to a variety of topics including '...computational mass spectrometry, alignment, dynamic programming, genome assembly, genome rearrangements, phylogeny, probability, and string algorithms'. Working your way through these problems (warning: some can be quite challenging) will give you exposure to the variety of problems a bioinformatician might work on, allow you to hone your programming skills, identify gaps and your knowledge, and act as a springboard for you to create your own project. A bonus is that all of your rosalind solutions can be shown a potential employer. This isn't as great as having your very own project, but it will prove you have programming experience and you can score some bonus points for having a particularly clever solution to a problem.

Hosting Your Project on GitHub

Once you've created your project, it will need to be hosted somewhere for potential employers to access. GitHub is a popular choice that offers free hosting for publicly accessible open source projects, and you can get free private repositories if you're a student. It's now very common practice to ask for a GitHub link as part of the application process, but even if you aren't directly asked, you should always include a link to your project's repository on your resume/CV. Don't ever just provide a link to your GitHub profile because it makes more work for the other person and it might be unclear as to what project you're trying to highlight. If you're wondering, it's considered poor form to offer to email someone a zipped file of your work "upon request". However, this doesn't mean that you simply git push your code, provide a link, and then forget about it. Oh no. There is an entire art to exhibiting a professional looking project.

The first thing you need for your project is a proper readme. This is the information displayed below the folders and files in GitHub. GitHub readmes are written in markdown, a quick and popular way to style text. A good readme tells a potential user what your project is about and how to use it. You should avoid using field-specific lingo or abbreviations without defining them first. Since prospective employers could be reading this, make sure to use proper grammar, spelling, and punctuation. A good readme template can be found here, and you can find examples of projects with good readmes here. The readme should absolutely include screenshots or sample output if you're generating images. The readme can even include an embedded video in gif form if you want to show some cool visual effects or animations. If you built a web tool, then the readme should link directly to a publicly accessible web server running the software. If it's not a web tool, then there should be a link to an installer or at least easy to follow instructions for building your tool. If it's a pain to get to a useable form of your tool, then you risk losing the interest of or frustrating the potential employer. Even if you made the most mind-blowing tool, frustrating a potential employer will mean you have a near zero chance at landing an interview.

The second thing you need to do is properly organize your project's structure. There are certain conventions that people will expect to see when perusing your code, and a professional looking project structure will show recruiters that you know your stuff. PLOS has a great guide for structuring your bioinformatics project. The PLOS guide seems to be more geared for projects that process data, so if your project is more software oriented, then you should check out this guide for project structure.


Suggested structure for your bioinformatics project from PLOS Computational Biology.

For advanced users, you should consider utilizing continuous integration (CI). CI includes version control (you're already doing that with GitHub) combined with various other practices like build automation and self testing. CI is good development practice, and you can get sweet badges for your project's page. Potential employers will see a badge on your project's page and know that you're the real deal. Travis CI is a popular choice with GitHub integration, and Travis CI is free for open source projects. Check out this guide for getting Travis CI integrated into your GitHub project.

Contribute to Open Source

In closing, an alternative to creating your own project would be to contribute to an existing open source project. It's really easy to find an open source project to contribute to (Galaxy is my favorite recommendation), and you can read this wonderful guide for everything you need to know from finding a project to opening a pull request. Keep in mind that there are good ways and bad ways to go about contributing to an open source project. The good way would mean being involved in multiple aspects like contributing code and being part of a design team or a steering committee. This way you can talk to a prospective employer about many different aspects of the project. The bad way would mean contributing code without really being involved with the project. This way you can only say, "Oh, well I fixed this one bug," which doesn't come off as very impressive during an interview. Contributing to open source the good way has the secondary benefit of building your reputation. Many job candidates are found through networking, so showing people you do good work and push good code can directly help you land a job. If you have a specific company or research group in mind, then contributing to an open source project that is used there (or was written there) can help your chances as an applicant. 

Monday, August 7, 2017

The best programming language for getting started in bioinformatics

"What programming language should I learn?" is one of the very first questions to tackle if you are a beginner wanting to learn bioinformatics. Choice of language is important since it will be a tool that you utilize often, so the obvious answer is that you should learn the "best" one. What features should this best language have? It should be easy to learn, cover all of your needs as a bioinformatician (like data analysis, text processing, and application development), and be amazingly fast at any task you throw at it... Unfortunately, any greybeard can tell you that this language does not exist. 

This language does not exist because it would be impossible for a room full of computer scientists to come to agreement on anything let alone the features of a best language. Instead, we have many computer languages that excel in some aspects while having shortcomings in others. This can probably best be summarized with a hammer analogy. Have you ever wondered why screwdriver attachments for hammers aren't more popular? A hammer is exceptionally good at driving nails, and a screwdriver is exceptionally good at driving screws. Why deal with an over-engineered scrammer when a hammer and a screwdriver work perfectly well independently?

For a seasoned bioinformatician, the "best" programming language would be whatever language gets the job done efficiently. They might choose JavaScript for making a web application, Java for a graphical user interface (GUI), and C for developing a fast algorithm (like the ones used in genomics for sequence alignment). However, this is not helpful for someone who might not know how to program in the first place. For a fledgling bioinformatician, the best language is actually a combination of two languages: R and Python

Why R an Python? These languages have all of the features you need to be successful, and it is unlikely that you will run into a bioinformatics problem that can't be solved because of the limitations of these languages. R and Python are consistently ranked as the two most popular programming languages for bioinformatics job positions according to indeed.com's job trends (accessed 08-02-17), so knowing these languages will likely help your job prospects. 


R and Python are consistently the most popular languages for bioinformatics jobs on indeed.com.


Lets break down three major needs of a bioinformatician (data analysis, text processing, and application development; by no means an exhaustive list) and find out why these two languages are the best for getting started.

Data Analysis (R)
Although bioinformaticians spend a lot of time building software tools, many will spend at least some time working with biological data. For data analysis, R is an excellent choice. It is both a language and an environment for statistical computing and graphics, and it has wide adaptation in the statistics and data science communities. This popularity means that there are thousands of libraries developed by others to take advantage of so you don't have to spend extra time coding. Even better, the Bioconductor project exists solely to provide R libraries for many types of bioinformatic analyses. R is a top choice by academics in bioinformatics and statistics, so a lot of the cutting edge tools based on the newest research are only available in R.

R has an absolutely wonderful (and free) integrated development environment (IDE) called RStudio, which takes the vanilla environment and transforms it into something much more useable. The RStudio folks also make Shiny, a web application framework for R. Shiny lets bioinformaticians take their R code and quickly make polished, interactive web applications without needing to know HTML, CSS, or JavaScript. RStudio's Chief Scientist and well-known data scientist, Hadley Wickham, has developed a suite of packages called the tidyverse. 'The tidyverse is a coherent system of packages for data manipulation, exploration and visualization that share a common design philosophy.' Basically, everything from transforming data to string manipulation to eye-pleasing visualizations can all be done with the libraries in this suite. The tidyverse is considered a default library installation by many in the R community, and I can't recommend it enough.

What's the best way to learn R? I am a big proponent of structured classes with homework and project deadlines to help facilitate learning, so I highly recommend the R Programming course at Coursera taught by three big names in the data science world (Peng, Leek, Caffo). This course is part of the Data Science Specialty, which is a great idea if you're going to be spending a lot of time analyzing biological data, and upon completion of the specialization you even receive a certificate that you can list on your resume/CV. If you prefer to be self taught, then I highly recommend R for Data Science: Import, Tidy, Transform, Visualize, and Model Data by Hadley Wickham. If you already know a programming language, then some of the quirks of R might take some getting used to, but it is still an invaluable addition to your toolbox. 

Text Processing and Application Development (Python)
Python is an object-oriented scripting language. Python was designed with code readability in mind, so Python code tends to be more readable and can accomplish tasks in fewer lines compared to other object-oriented languages. Python is one of the most popular languages in the world, and IEEE listed Python as the top ranked programming language of 2017 (up from number 3 last year). Python's popularity benefits bioinformaticians using Python because there are extensive libraries for everything from web frameworks to scientific computing. Python can scrape files and websites right out the box thanks to built-in string and HTML/XML processing functions. Have a neat idea for utilizing natural language data? Your idea is only a library install away thanks to the Natural Language Toolkit

Python is great for both web-based and desktop-based application development. For web-based applications, beginning bioinformaticians can choose between three popular frameworks (flask, django, and Pyramid). For starting out, I recommend flask since you can have a "hello world" page up and running in about six lines of code, and it is very easy to find help if you get stuck. For desktop applications, there are a number of library choices. I recommend starting with the tkinter library, included in most Python installs by default, which provides an interface to the Tk GUI toolkit. The Tk GUI toolkit comes with or is available for most operating systems, meaning that tkinter applications you write are platform independent (can work on multiple operating systems). You can have a tkinter "hello world" pop-up window in as little as three or four lines of code, and it is very easy to find help if you need it.

Unlike R where RStudio is really your only IDE choice, Python has several options. I highly recommend using Sublime Text, a fast text editor with must-have features like regex searches and column highlighting. Sublime can run on Mac, Windows, and even Linux. It can run Python code directly, and with the help of a few easy to install packages, it can be your one stop solution for all Python development. Sublime Text is not free but has an essentially indefinite trial version, and you can get rid of the occasional nag screen by purchasing a lifetime license for $75 USD. If you're looking for something free and open source, then Spyder provides an interface similar to RStudio's. Advanced text editors like vim probably have too steep of a learning curve to be useful to a beginner. However, once you get the hang of programming you might be interested in upping your game.

For learning Python, I suggest An Introduction to Interactive Programming in Python and part two, which will get you well on your way. These courses are part of the Fundamentals of Computing Specialization. If you like the two introductory Python courses, then you should consider taking the rest of the courses in the specialization since the mathematical computing skills you will learn will be helpful on your journey as a bioinformatician (and you get a certificate). For self-teaching, I can't recommend Zed Shaw's Learn Python 3 the Hard Way book enough. This book is a great because it requires you to type all of the exercises, and I'm a big fan of "learning by doing". For biologists looking to learn how to code, I also recommend the well-written, beginner-friendly Python for Biologists.

Python 2 or 3?
Python 3 is the latest version of the official Python release, and I recommend starting with Python 3 since it's arguably better for beginners. I might have told you otherwise a few years ago due to backwards compatibility issues and lack of library support for Python 3, but Python 3 has now been out since 2008 so these issues are mostly history. If you're still concerned or maybe you need to work with some legacy code, then you can read more about Python 2 vs Python 3 to help you figure out what version is most appropriate.

Why not just Python?
If you twisted my arm while insisting that you didn't have time to learn two languages because you were working two jobs, helping shelter puppies find homes on weekends, and learning to play the cello, then I would acquiesce that it was ok to only learn Python. Python can have R-like data analysis functionality with the help of the pandas library, but you will likely run into situations where a library you need is available in R but not Python. In my experience, R is easier to use for data analysis because it was built for data analysis (see above hammer analogy). Keep in mind that not learning R could hurt your job prospects since there are a LOT of positions that want this kind of experience (see above indeed.com graph). If a position that lists R programming experience came down to a candidate who only knew Python and an equally qualified candidate who knew Python but who also had some small R project up on github, then who do you think would get the job? 

In closing
You'll know when it's time to learn another language. You might come across something unbelievably cool in Erlang that draws you in, or you might start running into performance issues with your code. R and Python are great for a lot of things, but they can be very slow for computationally heavy tasks when compared to a language like C. The good news is that you aren't going to have a hard time picking up new languages since your brain has already been introduced to programming concepts by R and Python. 

Biology can be quite complicated and problems are going to come in all shapes and sizes. Taking a complex problem and breaking it down into manageable pieces that can be solved by a computer program is a skill that transcends any language. As a bioinformatician, this is a very important skill to develop in addition to being able to code. With this in mind, I'd like to close with a link to this great article, 'Don't learn to code. Learn to think.'





Popular Posts