Function Repository Resource:

ConvertSequenceBondsToDotBracketForm

Source Notebook

Convert the bonds of a biomolecular sequence to a string in a basic dot-bracket form

Contributed by: John Cassel, Wolfram|Alpha Scientific Content

ResourceFunction["ConvertSequenceBondsToDotBracketForm"][bioseq]

takes the bonds from a biomolecular sequence bioseq and attempts to find a corresponding string in dot-bracket form.

ResourceFunction["ConvertSequenceBondsToDotBracketForm"][bondlist,seqlength]

attempt to find a corresponding string in dot-bracket form for the given bond list bondlist and overall sequence length seqlength.

Details

The basic dot-bracket form supported here uses a period (.) to indicate no bonds at that point in the sequence, and paired parentheses ("(" and ")") and angle brackets ("<" and ">") for bonded pairs.

Examples

Basic Examples (2) 

Generate the dot-bracket form from a bonded biomolecular sequence:

In[1]:=
ResourceFunction["ConvertSequenceBondsToDotBracketForm"][
 BioSequence["RNA", "GCCAGACUGAYAUCUGGA", {Bond[{2, 17}], Bond[{3, 16}], Bond[{4, 15}], Bond[{5, 14}], Bond[{6, 13}]}]]
Out[1]=

Dot-bracket form can be calculated from a list of bonds and a sequence length:

In[2]:=
ResourceFunction[
 "ConvertSequenceBondsToDotBracketForm"][{Bond[{2, 7}], Bond[{1, 8}]},
  8]
Out[2]=

Scope (1) 

A dot-bracket form can often be found for bonds with nested bonding, such as in pseudo-knots:

In[3]:=
ResourceFunction["ConvertSequenceBondsToDotBracketForm"][
 BioSequence["RNA", "GAUGGCACUCCCAUCAAUUGGAGC", {Bond[{5, 11}], Bond[{4, 12}], Bond[{3, 13}], Bond[{2, 14}], Bond[{1, 15}], Bond[{10, 21}], Bond[{9, 22}], Bond[{8, 23}]}]]
Out[3]=

Possible Issues (2) 

It is not always possible to find a dot-bracket form for a given list of bonds:

In[4]:=
ResourceFunction[
 "ConvertSequenceBondsToDotBracketForm"][{Bond[{8, 21}], Bond[{28, 26}], Bond[{22, 19}], Bond[{15, 23}], Bond[{13, 4}], Bond[{24, 18}], Bond[{30, 27}], Bond[{17, 2}], Bond[{16, 20}], Bond[{25, 7}], Bond[{10, 11}], Bond[{12, 14}], Bond[{3, 1}], Bond[{5, 6}], Bond[{29, 9}]}, 30]
Out[4]=

The dot-bracket form for a biomolecular sequence without any bonds is not very interesting:

In[5]:=
ResourceFunction["ConvertSequenceBondsToDotBracketForm"][
 BioSequence["RNA", "GCCAGACUGAYAUCUGGA", {}]]
Out[5]=

Version History

  • 1.0.0 – 06 December 2021

Related Resources

License Information