Ch 1.b Handling Biological Data - aswalker-lab/AIChemBiochem GitHub Wiki
In this chapter we will discuss how to handle biological sequence data in Biopython.
Biological sequence data are primarily stored as fasta or genbank files. Fasta files consist of header lines that start with ">" and have information about the sequence (e.g. information like gene name or id, source organism, etc.) and sequence lines. Sequence can be on a single line or broken up into multiple lines. Fasta files can contain any type of sequence protein, RNA, or DNA. Example fasta formatting:
Genbank files include DNA sequences and annotations, such as genes and coding sequences (CDS), and sometimes protein domain annotations. These additional protein annotations can also sometimes contain the protein sequence. Example genbank header formatting:
Example that shows features portion of a genbank file:
Example that shows DNA sequence portion of a genbank file:
Biopython provides methods for reading and writing both fasta and genbank files, as well as for translating DNA to protein sequences.
Pandas is a module for managing data in python. Pandas can create dataframes which are tables of data. It can store different python objects, including strings for sequences of protein or nucleic acids.
Example reading fasta and genbank files: https://colab.research.google.com/github/aswalker-lab/AIChemBiochem/blob/main/1b_HandlingBioData/1b_1%20Intro%20to%20Biopython.ipynb
Example loading data on protein using pandas: https://colab.research.google.com/github/aswalker-lab/AIChemBiochem/blob/main/1b_HandlingBioData/1b_2%20Pandas%20and%20Biological%20Data.ipynb
If you choose to use the Google Colab for these examples, you will need to upload the fasta and gb file for the first notebook and the csv file with protein data which you can download from the Github. To do that click on the folder icon on the left hand panel of the Colab interface and then click the upload button:
