.. _imbiopythonrst: ========= biopython ========= .. only:: html **Links:** :download:`notebook `, :downloadlink:`html `, :download:`PDF `, :download:`python `, :downloadlink:`slides `, :githublink:`GitHub|_doc/notebooks/2016/pydata/im_biopython.ipynb|*` The `Biopython `__ Project is an international association of developers of freely available `Python `__ tools for computational molecular biology. `documentation `__ `source `__ `installation `__ `tutorial `__ .. code:: ipython3 from jyquickhelper import add_notebook_menu add_notebook_menu() .. contents:: :local: example ------- .. code:: ipython3 from pyquickhelper.filehelper import download download("https://raw.githubusercontent.com/biopython/biopython/master/Tests/GenBank/NC_005816.gb", outfile="NC_005816.gb") .. parsed-literal:: 'NC_005816.gb' .. code:: ipython3 from reportlab.lib import colors from reportlab.lib.units import cm from Bio.Graphics import GenomeDiagram from Bio import SeqIO record = SeqIO.read("NC_005816.gb", "genbank") gd_diagram = GenomeDiagram.Diagram("Yersinia pestis biovar Microtus plasmid pPCP1") gd_track_for_features = gd_diagram.new_track(1, name="Annotated Features") gd_feature_set = gd_track_for_features.new_set() for feature in record.features: if feature.type != "gene": #Exclude this feature continue if len(gd_feature_set) % 2 == 0: color = colors.blue else: color = colors.lightblue gd_feature_set.add_feature(feature, color=color, label=True) gd_diagram.draw(format="linear", orientation="landscape", pagesize='A4', fragments=4, start=0, end=len(record)) gd_diagram.write("plasmid_linear.svg", "svg") .. code:: ipython3 from IPython.display import SVG SVG("plasmid_linear.svg") .. image:: im_biopython_6_0.svg .. code:: ipython3 gd_diagram.draw(format="circular", circular=True, pagesize=(20*cm,20*cm), start=0, end=len(record), circle_core=0.7) gd_diagram.write("plasmid_circular.svg", "svg") SVG("plasmid_circular.svg") .. image:: im_biopython_7_0.svg