Tanggal :September 25, 2020

bpy1. Biopython

Spread the love

If using Anaconda, you can install Biopython, from the terminal, using:

$ conda install biopython

Not every package is on conda. You might first search:

$ conda search biopython

or some other package. So for example, we can search Beautiful Soup, for HTML parsing, using:

$ conda search beautiful-soup

or a partial name such as

$ conda search beau

If it is not on conda, you can always use pip to install it:

$ <path to Anaconda folder>/bin/pip install package

You should get the exact package name from their website.

The most important data structure in Biopython is the sequence (Seq), and SeqRecord, to hold sequence with annotation. Here, we create a 4-sequence long DNA.

# bpy1.py
from __future__ import print_function
import Bio
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
four = Seq("AGTG",IUPAC.unambiguous_dna)
print("seq alphabet:",four.alphabet)
#version: 1.65
#seq: AGTG
#seq alphabet: IUPACUnambiguousDNA()
#complement: TCAC

Leave a Reply

Your email address will not be published. Required fields are marked *