Sequence Features#

A sequence “feature” is an annotated segment, with the annotations being generated either computationally, e.g. repeat classification, or experimentally, e.g. single nucleotide polymorphism. In this example, we just load both sequence and features from a GenBank record.

Drawing all features on a sequence segment#

We load chromosome I of Caenorhabditis elegans.

from cogent3 import load_seq

seq = load_seq("data/", moltype="dna")

DnaSequence, length=15,072,434 (truncated to 60)

As you can see it’s quite large. It doesn’t make sense to try and display all the features, so we will slice it down to a 10kbp segment.

seq = seq[25000:35000]

Drawing features is then limited to features within that segment.

fig = seq.get_drawable(), width=700)


If a feature extends outside the displayed segment, it’s hover text indicates it as “(incomplete)”.

Drawing selected feature biotypes#

We specify what biotypes we want to display.

fig = seq.get_drawable(biotype=("gene", "CDS", "mRNA")), width=650)