Progress in Wolfram Support for Genomics and Biomolecular Sequence Processing

John Cassel, Wolfram Research

(RowDefault[, (Spacer1), , (Spacer1), ])  #WolframTechConf

ABSTRACT

This talk will give a view into the ongoing stream of development aimed at improving handling our biomolecular data, looking both at released functionality and work in development.  This coverage will include Wolfram Language support for biomolecular sequences, focusing on the BioSequence representation.  It will also be looking at Wolfram Knowledge Base support for gene entities.  In addition, related entries in the Wolfram function and data repositories will be covered.  All of these subjects will be grounded in a broader roadmap, and the talk will end with opportunities for feedback and participation.

Overview

Biomolecular Sequences

Motivation

Biomolecular sequences allow common bioinformatics operations to be undertaken conveniently by providing a level of abstraction above molecules

Quick Review of 12.2 Features

Sequence Representation

BioSequence["DNA", "TTGATGTAA"]

BioSequence[]

Common Biomolecular Operations

BioSequenceComplement[BioSequence["DNA", "TTGATGTAA"]]

BioSequence[]

Language Integration

StringContainsQ[BioSequence["DNA", "TTGATGTAA"],"ATGN"]

StringContainsQ[BioSequence["DNA", "TTGATGTAA"],"ATG"~~Verbatim["N"]]

New in Version 13

Additional Bonds

BioSequence["DNA","AGGGT",Bond[{1,5}]]

BioSequence[]

Hybrid Strands

BioSequence["HybridStrand",{"CTGGGT","AUUCGC"}]

BioSequence[]

Sequence Collections

BioSequence[{"CTGGGT","AUUCGC"}]

BioSequence[]

Schematic Visualization

BioSequencePlot[BioSequence["HybridStrand",{"CTGGGT","AUUCGC"}]]

Extensions, Modifications, and Other Conveniences

BioSequenceModify[BioSequence[{"CTGGGT","AUUCGC"}],"SplitDisconnectedCollection"]

{BioSequence[],BioSequence[]}

Future

Annotations...

Lookup and Alignments...

And Beyond...

Biomolecular Entities

Survey of Existing Types

Specific structures:  Genes, Proteins, SNPs

Types and Configurations:  BioSequenceType, GeneticTranslationTable

Future

Updates

BioSequenceBondType?

Related Wolfram Function and Data Repository Resources

A few examples, with links to further resources

Overall Direction

Representation

Algorithms

Visualization

Knowledge

Service Connectivity

Formats

Workflows

Community

Summing Up

Version 13 is a Big Step for Biomolecular Sequences

Higher-order Structure is the Logical Next Step in Biomolecular Sequence Functionality

Feedback and Questions

Biomolecular Sequences

Motivation: Why BioSequence?

The Wolfram Language provides the ability to access chemicals as molecules and operate upon them accordingly:

MoleculePlot3D[Molecule[Interpreter["Chemical"]["glucose"]]]

This molecular representation extends beyond notable chemicals to any reasonable molecule designated by the user:

Molecule["C[C@H](Cc1c[nH]c2c1ccc(c2)O)N"]

Molecule[]

Biomolecular sequences a provide level of abstraction above molecules to conveniently allow common bioinformatics operations:

BioSequenceComplement[BioSequence["DNA","CTTGAA"]]

BioSequence[]

This support extends to the sequences of biomolecular entities:

BioSequenceComplement[BioSequence[Interpreter["Gene"]["HBA2 human"]]]

BioSequence[]

Yet, these bio sequences can still be reduced to their molecular representation:

Molecule[BioSequenceComplement[BioSequence["DNA","CTTGA"]]]

Molecule[]

MoleculePlot3D[%]

Biomolecular Sequences

Quick Review of 12.2 Features

Sequence Representation

BioSequence provides support for DNA, RNA, and Peptide sequences:

BioSequence["DNA","ATCGGGAGTAGCAAAAGCCCTCTA"]

BioSequence[]

BioSequence["RNA","AUCGGGAGUAGCAAAAGCCCUCUA"]

BioSequence[]

BioSequence["Protein","ITGTSTVGVGRGVLGDQKNINTTYSTYYYLQDNTRGNGIFTYDAKYRTTLPGSLWADADNQFFASYDAPAVDAHYYAGVTYDYYK"]

BioSequence[]

BioSequence has deep support for degenerate letter processing:

BioSequenceInstances[BioSequence["DNA","AGY"]]

RandomInstance[BioSequence["DNA","AGY"]]

BioSequence can be extended by users:

es=EntityStore["ExtendedBioSequenceType"-><|"Entities"-><|"HachimojiDNA"-><|"Alphabet"->{"C","G","T","A","B","P","S","Z"},"Caption"->"Hachimoji DNA Sequence","Icon"->"DNA","ComplementLetterRules"->{"A"<->"T","C"<->"G","P"<->"Z","B"<->"S"},"BibliographicSource"->ExternalIdentifier["DOI","10.1126/science.aat0971"]|>|>|>];
EntityRegister[es];
BioSequence["HachimojiDNA","BCGGZS"]

BioSequenceComplement[BioSequence["HachimojiDNA","BCGGZS"]]

BioSequence["HachimojiDNA","BCGGZS"]["SequenceType"]

Common Biomolecular Operations

Complements, reverse complement, transcription, and translation are all supported:

BioSequenceComplement[BioSequence["DNA","AGG"]]

BioSequence[]

BioSequenceReverseComplement[BioSequence["DNA","AGG"]]

BioSequence[]

BioSequenceTranscribe[BioSequence["DNA","GWTATS"]]

BioSequence[]

BioSequenceTranslate[BioSequence["DNA","CTGATATAC"]]

BioSequence[]

Back translation is not unique, so many steps are taken to allow a compressed form of that overall space:

RandomInstance[First[BioSequenceBackTranslateList[BioSequence["Peptide","LIY"],MaxItems->1]]]

Language Integration

Bio Sequences as Strings

As of 12.2, biological sequences can be used in twenty five different String-related functions.  String functions have a few different behaviors when processing BioSequences.  Rather than surveying all the changes in string functions, these changes will be summarized by surveying key differences in behavior.

The most obvious and straightforward difference is that a BioSequence can be used in place of a String:

StringLength[BioSequence["DNA", "GCCACTTGCGTCATC"]]

Those that typically return a string or list of strings will return a BioSequence or list of BioSequences instead:

StringInsert[BioSequence["DNA","GGCC"],"AA",2]

For functions that perform matching, degenerate letters will produce additional matches:

StringContainsQ[BioSequence["DNA","CTCGGCA"],"CWCG"]

StringCount[BioSequence["DNA","CTCGGCA"],"CWCG"]

StringDelete[BioSequence["DNA","CTCGGCA"],"CWCG"]

StringSplit[BioSequence["DNA","CTCGGCA"],"WCG"]

To match degenerate letters exactly in these scenarios, use Verbatim:

StringContainsQ[BioSequence["DNA","CTCGGCA"],Verbatim["CWCG"]]

Verbatim can be used selectively in a string expression:

StringContainsQ[BioSequence["DNA","CTSGGCA"],Verbatim["CTSG"]~~"SN"]

The same principles apply in functions that use rules:

StringReplace[BioSequence["DNA","CTCGGCA"],"CWCG"->"A"]

StringCases[BioSequence["DNA","CTCGGCA"],x_~~"W"~~x_:>x<>"A"]

StringCases[BioSequence["DNA","CTCGGCA"],x_~~Verbatim["W"]~~x_:>x<>"A"]

StringCases[BioSequence["DNA","CWCGGCA"],x_~~Verbatim["W"]~~x_:>x<>"A"]

Another key difference includes the matching behavior on circular types (currently “CircularDNA”), namely that “wrap-around” matches are supported.

StringContainsQ[BioSequence["CircularDNA","AGGGCCC"],"CA"]

StringMatchQ[BioSequence["CircularDNA","AGGGCCC"],"S"..~~"A"]

StringCases[BioSequence["CircularDNA","AGGGCCC"],"SA"]

StringCount[BioSequence["CircularDNA","AGGGCCC"],"SA"]

StringReplace[BioSequence["CircularDNA","AGGGCCC"],"NAN"->"T"]

Note that in circular replacements, the framework can alter where the “start” of the sequence is.

Circularity means that operations taking string positions can take “wrap-around” positions:

StringTake[BioSequence["CircularDNA","CGGA"],{4,1}]

StringDrop[BioSequence["CircularDNA","CGGA"],{4,1}]

StringReplacePart[BioSequence["CircularDNA","CCGA"],"G",{4,1}]

Similarly, wrap-around positions can be produced by string functions yielding positions:

StringPosition[BioSequence["CircularDNA","GAAAACGAAC"],"CG"]

Other Integration

Of course, sequence operations are supported for BioSequence:

SequenceAlignment[BioSequence[(Entity["hemoglobin, alpha 1", Entity["Gene",{"HBA1",{"Species"->"HomoSapiens"}}], "Entity[\"Gene\", {\"HBA1\", {\"Species\" -> \"HomoSapiens\"}}]", "gene"])],BioSequence[(Entity["hemoglobin, alpha 2", Entity["Gene",{"HBA2",{"Species"->"HomoSapiens"}}], "Entity[\"Gene\", {\"HBA2\", {\"Species\" -> \"HomoSapiens\"}}]", "gene"])]]

ResourceFunction["AlignmentToPositionDifferences"][%]

Biomolecular Sequences

New in Version 13

Bonds

Additional bonds can be added between sequence terms:

BioSequence["DNA","GGAGGGTGG",Bond[{3,7},"MultiHydrogen"]]

BioSequence[]

BioSequencePlot[BioSequence["DNA","GGAGGGTGG",Bond[{3,7},"MultiHydrogen"]]]

Bonds at the level of a sequence may represent a set of bonds at the molecular level (e.g. the “MultiHydrogen” bond connecting the A  and T above represents the two hydrogen bonds connecting the base pair).

A number of such bonds can be added:

BioSequencePlot[BioSequence["RNA", "GCCAGACUGAAYAUCUGGA", {Bond[{2, 18}], Bond[{3, 17}], Bond[{4, 16}], Bond[{5, 15}], Bond[{6, 14}]}]]

To specify a number of bonds, it can be convenient to use dot-bracket notation as a shorthand:

BioSequencePlot[BioSequence["RNA", "GCCAGACUGAAYAUCUGGA",".(((((.......)))))."]]

Fairly sophisticated structures specified this way:

BioSequencePlot[BioSequence["RNA", "GAUGGCACUCCCAUCAAUUGGAGC","(((((..<<<))))).....>>>."]]

Another way to specify multiple bonds is to use a compatible Span for each index of the bond:

BioSequencePlot[BioSequence["RNA", "GCCAGACUGAAYAUCUGGA",{Bond[{2;;6;;1,(18;;14;;-1)}]}]]

Span of bonds are evaluated to the simpler bonds they are shorthand for:

BioSequence["RNA", "GCCAGACUGAAYAUCUGGA",{Bond[{2;;6;;1,(18;;14;;-1)}]}]//InputForm

Bond Types

By default, the bond that the user provides is not presumed to be of any particular type:

BioSequence["DNA", "GGAGGGTGG", {Bond[{3,7}]}]

If not provided, a bond type will be inferred for operations that require them, where possible:

BioSequenceModify[BioSequence["DNA", "GGAGGGTGG", {Bond[{3,7}]}],"CanonicalRepresentation"]//InputForm

By default, additional bonds of DNA and RNA are of the type “MultiHydrogen”, which allows both standard base pairing and any other base pairing (e.g. Hoogsteen, wobble) that might be typically encountered.

With peptide sequences, it matters what is being connected.  The supported peptide bond types, “DisulfideBridges” and “LactamBridges” bridges, can only be connected between certain amino acids, and not all connections can be supported.

BioSequenceModify[
BioSequence["Peptide","CGGGU"],
{"AddBond",{1,5}}
]//InputForm

BioSequenceModify[
BioSequence["Peptide","DGGGK"],
{"AddBond",{1,5}}]//InputForm

BioSequenceModify[
BioSequence["Peptide","DGGGC"],
{"AddBond",{1,5}}]//InputForm

Bond Example

Here are some example toxins that have nice 3D molecule plots.

robustoxin, Atrax robustus:

robustoxin=BioSequence["CAKKRNWCGKNEDCCCPMKCIYAWYNQQGSCQTTITGLFKKC",Bond/@{{1,15},{8,20},{14,31},{16,42}}]

BioSequenceModify[robustoxin,"CanonicalRepresentation"]//InputForm

robustoxin["MolecularMass"]

MoleculePlot3D[robustoxin]

slotoxin, Centruroides noxius:

slotoxin=BioSequence["TFIDVDCTVSKECWAPCKAAFGVDRGKCMGKKCKCYV",Bond/@{{7,28},{13,33},{17,35}}];

BioSequenceModify[slotoxin,"CanonicalRepresentation"]//InputForm

slotoxin["MolecularMass"]

MoleculePlot3D[slotoxin]

margatoxin, Centruroides margaritatus:

margatoxin=BioSequence["TIINVKCTSPKQCLPPCKAQFGQSAGAKCMNGKCKCYPH",Bond/@{{7,29},{13,34},{17,36}}];

BioSequenceModify[margatoxin,"CanonicalRepresentation"]//InputForm

margatoxin["MolecularMass"]

MoleculePlot3D[margatoxin]

Hybrid Strands

A hybrid strand is a single strand composed of many motif sequences, possibly of different types, bonded end-to-end with the primary linkage for those types of sequences.

DNA and RNA are common hybrid sequences, as they both have phosphodiester bonds forming their primary structure:

BioSequence["HybridStrand",{"CTGGGT","AUUCGC"}]

BioSequence[]

BioSequencePlot[BioSequence["HybridStrand",{"CTGGGT","AUUCGC"}]]

Using the letters is a shorthand and the system will attempt to guess the relevant type:

BioSequence["HybridStrand",{"CTGGGT","AUUCGC"}]//InputForm

If a sequence of letters can be interpreted multiple ways, you may need to specify what you mean to get the right interpretation:

BioSequence["HybridStrand",{"TGAGGT","CGCA"}]//InputForm

BioSequencePlot[BioSequence["HybridStrand",{"TGAGGT",BioSequence["RNA","CGCA"]}]]

Hybrid strands can be represented as molecules:

MoleculePlot[Molecule[BioSequence["HybridStrand",{"TGAGGT",BioSequence["RNA","CGCA"]}]]]

Bonds can occur both within a given motif and across motifs in hybrid strands:

BioSequencePlot[BioSequence["HybridStrand",
{BioSequence["DNA","TGAGGT",Bond[{3,6}]],BioSequence["RNA","CGCA"]},
Bond[{{1,1},{2,4}}]]]

This form is equivalent:

BioSequencePlot[BioSequence["HybridStrand",
{BioSequence["DNA","TGAGGT"],BioSequence["RNA","CGCA"]},
{Bond[{{1,3},{1,6}}],Bond[{{1,1},{2,4}}]}]]

Sequence Collections

A sequence collection is a set of sequences unconnected except by explicitly specified bonds or higher-order cross-sequence features, if at all.

A sequence collection is expressed through a list of sequences as the first argument.

These two sequences are not connected:

BioSequence[{"CTGGGT","AUUCGC"}]

BioSequencePlot[%]

Here are a number of disconnected circular sequences:

BioSequencePlot[BioSequence[
Table[
RandomInstance[BioSequence["CircularDNA",9]],
{4}
]
]]

As before, the strings are a shorter form for a complete motif sequence:

BioSequence[{"CTGGGT","AUUCGC"}]//InputForm

Of course, a sequence of disconnected sequences is an edge case, and the major point of sequence collections is to support chemicals composed of multiple bonded sequences.

Insulin is a great example of the need for sequence collections, as it is composed of two peptide sequences with three additional sets of bonds:

insulinSequences=BioSequence[{BioSequence["Peptide","FVNQHLCGSHLVEALYLVCGERGFFYTPKT"],BioSequence["Peptide","GIVEQCCTSICSLYQLENYCN"]},{Bond[{{2,1,6},{2,1,11}}],Bond[{{2,1,7},{1,1,7}}],Bond[{{2,1,20},{1,1,19}}]}]

We can see that these bonds are disulfide bridges:

BioSequenceModify[insulinSequences,"CanonicalRepresentation"]//InputForm

Here is the corresponding insulin molecule:

insulinMolecule=Molecule[insulin];
MoleculePlot[insulinMolecule]

Molecular and molar mass properties are available for sequence collections even without converting to molecule:

insulinSequences["MolecularMass"]

insulinMolecule["MolecularMass"]

insulinSequences["MolarMass"]

insulinMolecule["MolarMass"]

Even more exotic combinations are certainly possible.  Here is a collection with two bonded hybrid strands:

hybridStrandCollection=BioSequence[{BioSequence["HybridStrand",{BioSequence["DNA", "G"],BioSequence["DNA", "CCCC"],BioSequence["RNA", "G"],BioSequence["DNA", "TTTT"]}],
BioSequence["HybridStrand",{BioSequence["DNA", "AAAAA"],BioSequence["RNA", "U"],BioSequence["DNA", "GGGGG"]}]},{Bond[{{1,2,2},{2,3,3}}],Bond[{{1,2,3},{2,3,2}}],Bond[{{1,4,2},{2,1,3}}],Bond[{{1,4,3},{2,1,2}}]}]

BioSequencePlot[hybridStrandCollection]

Indeed, molecules can be generated for these objects as well:

MoleculePlot[Molecule[hybridStrandCollection]]

If there are many bonds, spans can also be used in more nested structures:

BioSequence[
{BioSequence["DNA","ACCCCA"],BioSequence["AAGGGGA"]},
Bond[{{1,2;;5},{2,3;;6}}]
]

BioSequencePlot[%]

Schematic Visualization

Throughout, we’ve seen examples of BioSequencePlot, but let’s look a little further.

BioSequencePlot has to solve the problem that it can be given sequences of any size:

repeatedPseudoknot[n_]:=BioSequencePlot[BioSequence["RNA", StringRepeat["GAUGGCACUCCCAUCAAUUGGAGC",n],StringRepeat["(((((..<<<))))).....>>>.",n]]]

For smaller structures, displaying the symbol for each base makes sense:

repeatedPseudoknot[1]

For larger sequences, those are better condensed as tooltips:

repeatedPseudoknot[20]

For the largest structures, it’s no longer practical to represent each term in the sequence as a node, and so many are grouped together:

repeatedPseudoknot[100]

By default, every motif is given a different color, and DNA and RNA are given different shapes:

BioSequencePlot[BioSequence[{BioSequence["HybridStrand",{BioSequence["RNA", "G"],BioSequence["DNA", "CCCC"],BioSequence["RNA", "G"],BioSequence["DNA", "TTTT"]}],
BioSequence["HybridStrand",{BioSequence["DNA", "AAAAA"],BioSequence["RNA", "U"],BioSequence["DNA", "GGGGG"]}],"TCAGGC"},{Bond[{{1,2,2},{2,3,3}}],Bond[{{1,2,3},{2,3,2}}],Bond[{{1,4,2},{2,1,3}}],Bond[{{1,4,3},{2,1,2}}]}]]

For more complex sequences, the tooltips become more complex to allow better navigation:

BioSequencePlot[BioSequence[{BioSequence["HybridStrand",{BioSequence["DNA", "G"],BioSequence["DNA", "CCCC"],BioSequence["RNA", "G"],BioSequence["DNA", "TTTT"]}],
BioSequence["HybridStrand",{BioSequence["DNA", "AAAAA"],BioSequence["RNA", "U"],BioSequence["DNA", "GGGGG"]}],BioSequence["DNA",100]},{Bond[{{1,2,2},{2,3,3}}],Bond[{{1,2,3},{2,3,2}}],Bond[{{1,4,2},{2,1,3}}],Bond[{{1,4,3},{2,1,2}}]}]]

Extensions, Modifications, and Other Conveniences

Circular RNA and Peptides

Circular RNA and peptides are now supported in addition to circular DNA:

BioSequence["CircularDNA", "ATGCTATGG"]

BioSequence["CircularRNA", "AUCCGGAGA"]

BioSequence[]

(* evolidine, first circular peptide isolated in plants *)
BioSequence["CircularPeptide", "SFLPVNL"]

Entry by Standard Abbreviation

Many people find the abbreviations for amino acids easier to remember than their single letter symbols.

Here is a peptide sequence entered with standard abbreviations:

BioSequence["Peptide","MetGluSerLeuValProGlyPheAsnGluLysThrHisVal"]

BioSequence[]

Type inference works for abbreviations just as it does for single-letter symbols:

BioSequence["MetGluSerLeuValProGlyPheAsnGluLysThrHisVal"]

The abbreviation sequence can be accessed as a property:

BioSequence["Peptide", "MESLVPGFNEKTHV", {}]["AbbreviationSequence"]

Modifying Circularity

Convert a linear sequence to a circular sequence:

BioSequenceModify[
BioSequence["DNA", "TGGACTTTC", {}],
"MakeCircular"
]

Convert a circular sequence to a linear sequence:

BioSequenceModify[
BioSequence["CircularDNA", "TGGACTTTC", {}],
"MakeLinear"
]

Modifications for Adding and Deleting Bonds

You can add and delete bonds by specifying the indexes where those bonds are found, or by passing in a Bond:

BioSequenceModify[BioSequence["GGAGGGTGG"],{"AddBond",{3,7}}]

BioSequencePlot[%]

BioSequenceModify[BioSequence["GGAGGGTGG",{Bond[{3,7}]}],{"DeleteBond",{3,7}}]

BioSequencePlot[%]

Adding Sequences to Collections

Add a sequence or a list of sequences into a sequence collection:

BioSequenceModify[BioSequence[{"ACCTGG","UCAUG"}],{"AddToCollection",BioSequence["CTTA"]}]

BioSequence[]

Splitting Disconnected Collections

Separate the unbound components of a sequence collection into separate collections:

BioSequenceModify[
BioSequence[
{BioSequence["HybridStrand",{"CAGT","GUA"}],
BioSequence["DNA","GGC"],
BioSequence["HybridStrand",{"CAU","ATTCG"}]},
Bond[{{1,2,1},{3,1,1}}, "MultiHydrogen"]
],
"SplitDisconnectedCollection"
]

{BioSequence[],BioSequence[]}

Obtaining a Canonical Representation

Sometimes, it is useful to know if two sequences or sequence collections are identical.  This can be tricky, as the same sequence can be represented in different ways, and collections can be in any order.

Here we see the order of sequences change, which also changes the indexing of the bond list:

BioSequenceModify[
BioSequence[{BioSequence["DNA","GGGG"],BioSequence["DNA","CCCC"]},
{Bond[{{1,1},{2,2}},"MultiHydrogen"]}
],
"CanonicalRepresentation"
]

%["SequenceBondList"]

Here we see that the canonical form of a single motif hybrid strand is the motif sequence:

BioSequenceModify[
BioSequence[{BioSequence["HybridStrand",{BioSequence["DNA","CAGT"]}]},
{Bond[{{1,1,2},{1,1,4}},"MultiHydrogen"]}
],
"CanonicalRepresentation"
]

Other Bond Representations

In the course of our work, we’ve found that it’s occasionally useful to change how bonds are represented, so we’ve exposed these changes to our users.

Sometimes, it’s helpful to have bonds contained inside the broader structure, say so that a sequence could be removed but all of its local additional bonds preserved:

BioSequenceModify[
BioSequence["HybridStrand",
{BioSequence["DNA","CAGT"],BioSequence["RNA","GUA"]},
{Bond[{{1,2},{1,4}},"MultiHydrogen"]}
],
"InnermostBondRepresentation"
]//InputForm

On the other hand, sometimes it’s helpful to have all the bonds on the outermost structure, so that they can be used all together in some analysis or manipulation:

BioSequenceModify[BioSequence["HybridStrand", {BioSequence["DNA", "CAGT", {Bond[{2, 4}, "MultiHydrogen"]}], 
  BioSequence["RNA", "GUA", {}]}, {}],"OutermostBondRepresentation"]//InputForm

Biomolecular Sequences

Future

Annotations...

In the future, we will be interested in annotating sequences to indicate various regions, such as coding sequences or regulatory regions.

These annotations could then be processed in various ways, such as extracted into their own sequences with modifications, or added directly with machine learning or other heuristics.

Lookup and Alignments...

Given a sequence, we would like to be able to find where it might coincide with a reference sequence, and give alignments.  If the alignment differences coincide with known SNPs, particularly those of interest, it is useful to provide those as well.

And Beyond...

Of course, we create this work to see what our users can do with it and are very interested when other directions would better enable their work.

Biomolecular Entities

Survey of Existing Types

Specific structures:  Genes, Proteins, SNPs

Gene entities provide positional, structural, and functional content for a number of model organisms:

(Entity["acyl-CoA dehydrogenase, C-2 to C-3 short chain", Entity["Gene",{"ACADS",{"Species"->"HomoSapiens"}}], "Entity[\"Gene\", {\"ACADS\", {\"Species\" -> \"HomoSapiens\"}}]", "gene"])["Dataset"]

Gene entities can be used with BioSequence:

BioSequence[Entity["Gene",{"ACADS",{"Species"->"HomoSapiens"}}]]

BioSequence[]

Like gene entities, protein entities provide structural, positional, and functional information:

Interpreter["Protein"]["myoglobin"]

(Entity["myoglobin", Entity["Protein","MB"], "Entity[\"Protein\", \"MB\"]", "protein"])["Dataset"]

Protein entities also can be used to obtain their corresponding BioSequences:

BioSequence[(Entity["myoglobin", Entity["Protein","MB"], "Entity[\"Protein\", \"MB\"]", "protein"])]

Single nucelotide polymorphisms (SNPs) describe commonly observed changes at a particular genetic position:

(Entity["rs10489188", Entity["SNP","RS10489188"], "Entity[\"SNP\", \"RS10489188\"]", "SNP"])["Dataset"]

SNP entities can be useful as the result of alignments against a reference sequence.

Types and Configurations:  BioSequenceType, GeneticTranslationTable

The motif types of BioSequence are built into the BioSequenceType entity:

EntityList["BioSequenceType"]

These entities include the metadata that describe sequence behavior:

(Entity["DNA", Entity["BioSequenceType","DNA"], "Entity[\"BioSequenceType\", \"DNA\"]", "biomolecular sequence type"])["PropertyAssociation"]

Here we can see the correspondence in action:

(Entity["DNA", Entity["BioSequenceType","DNA"], "Entity[\"BioSequenceType\", \"DNA\"]", "biomolecular sequence type"])["DegenerateLetterRules"]["B"]

BioSequenceInstances[BioSequence["DNA","B"]]

Genetic translation table describes how the translation from codon to amino acid can vary between different biological systems:

EntityList["GeneticTranslationTable"]

(Entity["alternative flatworm mitochondrial", Entity["GeneticTranslationTable","AlternativeFlatwormMitochondrial"], "Entity[\"GeneticTranslationTable\", \"AlternativeFlatwormMitochondrial\"]", "genetic translation table"])["PropertyAssociation"]

These tables can be used to change the behavior of the translation operation:

BioSequenceTranslate[BioSequence["RNA","CUGAUAUAC"]]

BioSequenceTranslate[BioSequence["DNA", "CTGATATAC"], 
 (Entity["vertebrate mitochondrial", Entity["GeneticTranslationTable","VertebrateMitochondrial"], "Entity[\"GeneticTranslationTable\", \"VertebrateMitochondrial\"]", "genetic translation table"])]

Future

Updates

There has been a lot of work going into update content entities, particularly gene entities.  The goal is to tie these genes to particular reference assemblies and annotations to improve tracking.

??? BioSequenceBondType ???

There will probably be a BioSequenceBondType so that the various bond types and rules that govern them are available computationally.

Related Wolfram Function and Data Repository Resources

This talk is pretty long for the allocate time, so this topic is going to get relatively short coverage: just a couple of statements with links for further reference.

Sample SARS-CoV-2 genomes generally have few differences.  For that reason, it’s practical to optimize alignment when we can assume they are nearly identical:

alignment=ResourceFunction["AlignNearlyIdenticalSequences"][ResourceData["Genetic Sequences for the SARS-CoV-2 Coronavirus","ReferenceBioSequence"],BioSequence["DNA",ResourceFunction["ImportFASTA"]["MW850352"][[2,1]]]];
alignment[[;;3]]

To summarize alignments with very few differences, we can convert them to the differences that occur at a given position.

ResourceFunction["AlignmentToPositionDifferences"][alignment]

See the corresponding blog post https://blog.wolfram.com/2021/08/19/newick-trees-proximity-resources-and-accessions-analyzing-sars-cov-2-genetic-sequences/, Daniel Lichtblau’s TechTalk (https://www.youtube.com/watch?v=RDM1_zMdnMM) , and Wolfram Community contributions (including https://community.wolfram.com/groups/-/m/t/920422 and https://community.wolfram.com/groups/-/m/t/2342489) for further details.

OVerall Direction

By raising the level of expressiveness, the Wolfram Language seeks to enable work at the level workers in the domain need.

Representation

Can we computationally represent a given biological structure at a level of abstraction that preserves the right level of detail for practical tasks?

Algorithms

Do we have the major algorithms that users need to do practical work, as well as all of the “glue” code to undertake preprocessing?

Visualization

Can we help people understand, navigate, and communicate the structures and processes they are working with?

Knowledge

Do we have the supporting facts that allow people to access notable structures in an integrated way?

Service Connectivity

Does the functionality and knowledge that we support curtail gracefully, allowing people with further interests to integrate findings from services into their local representation, algorithms, and knowledge?

Formats

Can we communicate with other programs and traditions of representation, capturing what has been learned from those practices?

Workflows

Is there a clear path from raw measurements to actionable insights?

Community

Can we focus on what our community needs most when selecting the above?

Conclusion

Version 13 is a Big Step for Biomolecular Sequences

Version 13 better expresses the biomolecular context in which sequences appear by allowing the expression of higher-order structure

Higher-order Structure is the Logical Next Step in Biomolecular Sequence Functionality

With bonds, hybrid strands, and sequence collections, the Wolfram Language now can represent a much broader range of significant biomolecular structures

Feedback and Questions

This is not solo work; thanks to collaborators including Jan, Michael, Carlos, Danny, Brad, Brian, Isabel, Keiko, Bjorn, and SW among many others.