Function Repository Resource:

BioSequenceGraph

Source Notebook

Build a graph from a biomolecular sequence

Contributed by: John Cassel, Wolfram|Alpha Scientific Content

ResourceFunction["BioSequenceGraph"][bioseq]

generates a Graph from the structure of the biomolecular sequence bioseq.

Details and Options

If VertexLabels is set to All, each node will be given the label of the corresponding letter in the sequence.
If EdgeLabels is set to All, each edge will be given the label corresponding to the type of bond it connects.

Examples

Basic Examples (1) 

Create a Graph from a biomolecular sequence:

In[1]:=
ResourceFunction["BioSequenceGraph"][
 BioSequence["DNA", "GGAGGGTGG", Bond[{3, 7}, "MultiHydrogen"]]]
Out[1]=
Image

Scope (2) 

Graphs can be created from hybrid strands:

In[2]:=
ResourceFunction["BioSequenceGraph"][
 BioSequence["HybridStrand", {"CCGA", "UCCA"}, Bond[{{1, 3}, {2, 2}}]]]
Out[2]=
Image

Sequence collections can also be converted to graphs:

In[3]:=
ResourceFunction["BioSequenceGraph"][
 BioSequence[{"CCGA", "UCCA"}, Bond[{{1, 3}, {2, 2}}]]]
Out[3]=
Image

Options (2) 

Using All as the value of VertexLabels will display the sequence terms for all vertices:

In[4]:=
ResourceFunction["BioSequenceGraph"][
 BioSequence["DNA", "GGAGGGTGG", Bond[{3, 7}, "MultiHydrogen"]], VertexLabels -> All]
Out[4]=
Image

Using All as the value of EdgeLabels will display the bond type for all edges:

In[5]:=
ResourceFunction["BioSequenceGraph"][
 BioSequence["DNA", "GGAGGGTGG", Bond[{3, 7}, "MultiHydrogen"]], EdgeLabels -> All]
Out[5]=
Image

Applications (1) 

Plotting in 3D can mean that bonded circular sequences may be easier to visualize:

In[6]:=
Graph3D[ResourceFunction["BioSequenceGraph"][
  BioSequence["CircularPeptide", "GLPVCGETCVGGTCNTPGCTCSWPVCTRN", Bond /@ {{5, 19}, {9, 21}, {14, 26}}]]]
Out[6]=
Image

Version History

  • 1.0.0 – 06 December 2021

Related Resources

License Information