I recently started to work with a lot of structural protein data with the aim of extracting features based on the proteins secondary structures.
This involved assigning secondary structures for .pdb files, which is a file format that contains positional information about each atom in a polipeptide chain.
As in many bioinformatic fields, tried-and-tested algorithms for this are several decades old but seem to be still the gold standard.
The algorithm that pops up most is DSSP (Dictionary of Protein Secondary Structure). You can clearly see the age in every ounce of that website.
DSSP was originally used to assign all secondary structures for the PDB (Protein Data bank). I cannot find a source if that is still the case though.
.pdb files obtained from PDB usually already contain a section with the assigned structures, but this is not true for example for the output of alpha fold, which only predicts the raw atom positions without any structure assignment.
Using dssp is straight forward, it can be installed directly via apt on ubuntu, and there is a biocontainer available here
dssp itself is also very easy to use. Once in the container, simply run
dssp -i <.pdb file> -o <dssp file>
The output format of DSSP is weird, but writing parsers is not too hard. It contains metadata sections indicated by the line start, which are not very interesting fort my purposes.
The structure assignments are contained in a fixed-column data format further down the file.
Here is an example of how it looks like:
# RESIDUE AA STRUCTURE BP1 BP2 ACC N-H-->O O-->H-N N-H-->O O-->H-N TCO KAPPA ALPHA PHI PSI X-CA Y-CA Z-CA CHAIN
1 1 A M 0 0 235 0, 0.0 4,-0.1 0, 0.0 0, 0.0 0.000 360.0 360.0 360.0 58.6 -7.4 17.5 38.1
2 2 A Y > + 0 0 202 2,-0.1 4,-0.6 3,-0.1 0, 0.0 0.539 360.0 69.8-121.3 -9.6 -8.6 17.8 34.5
3 3 A Y H > S+ 0 0 209 1,-0.2 4,-1.1 2,-0.2 3,-0.3 0.865 91.2 58.3 -82.3 -33.1 -5.5 19.3 32.5
4 4 A F H > S+ 0 0 193 1,-0.2 4,-1.7 2,-0.2 -1,-0.2 0.861 101.0 56.5 -67.1 -33.2 -3.2 16.2 32.7
5 5 A S H > S+ 0 0 91 1,-0.2 4,-1.5 2,-0.2 -1,-0.2 0.835 104.5 51.5 -71.2 -31.9 -5.6 13.8 31.0
6 6 A R H X S+ 0 0 204 -4,-0.6 4,-1.4 -3,-0.3 -1,-0.2 0.816 108.4 51.3 -75.1 -30.1 -6.0 16.0 27.8
7 7 A V H X S+ 0 0 96 -4,-1.1 4,-1.8 2,-0.2 -2,-0.2 0.924 110.2 49.0 -72.1 -41.8 -2.2 16.3 27.3
8 8 A A H X S+ 0 0 54 -4,-1.7 4,-1.9 1,-0.2 -2,-0.2 0.860 109.1 52.8 -65.7 -36.0 -1.8 12.5 27.5
9 9 A A H X S+ 0 0 65 -4,-1.5 4,-1.7 2,-0.2 -1,-0.2 0.885 108.6 50.6 -67.1 -36.6 -4.6 11.9 25.0
10 10 A R H X S+ 0 0 206 -4,-1.4 4,-1.6 2,-0.2 -2,-0.2 0.888 110.4 48.5 -68.7 -39.2 -2.9 14.3 22.5
11 11 A T H X S+ 0 0 84 -4,-1.8 4,-1.6 2,-0.2 -2,-0.2 0.894 109.7 52.6 -70.1 -36.5 0.5 12.5 22.7
etc.
Writing a parser for that section was straight forward. I added it to BioFSharp.IO if you are interested in using it yourself.
Without going into too much detail, one of the things I am interested in is how the structural assignments of DSSP relate to other structural annotations for it.
An example would be intrinsically disordered stretches, parts of the chain that do not have a structure, but this disorder is actually crucial for the proteins function.
You can read more about disorder in protein structures here. An awesome ressource for disorder annotations is DisProt. You can download its annotations in an easily usable tsv format (no custom parsing yay).
With these two annotations at hand, i started scripting with BioFSharp and Plotly.NET to get visual comparisons of both features (DSSP structure and disprot annotation).
My first attempts involved chunking the sequence and annotations by 60 and creating a annotated heatmap, assigning color based on the one character code of the structure. It achieved the goal, but was very hard to read, especially for large sequences.
I wont even include the source code for this, because it obviously sucks:
)
Fig1: My first pitiful attempt at visualizing sequence features
At this point, i thought i was pretty much near the goal of my project (i calculated some fancy metrics downstream from the features that do not belong in this post),
and therefore content with the visualization. But as often happens in any kind of project - especially in academia - the scale of the project increased and i wanted to include more features in my calculations.
One was the secondary structure assigment of Stride - basically an improved version of DSSP. Also, i wanted to look at different disprot annotations individually.
At this point, a generic solution for both handling sequence features as well as their visualization was needed.
Stride is not as straight-forward to use as DSSP. I ended up creating my own docker container that builds it from source:
FROM biocontainers/biocontainers:vdebian-buster-backports_cv1
USER root
RUN apt-get update && (apt-get install -t buster-backports -y gcc || apt-get install -y gcc) && (apt-get install -t buster-backports -y make || apt-get install -y make) && apt-get clean && apt-get purge
WORKDIR /bin/stride
COPY ./stride.tar.gz /bin/stride
ENV DEBIAN_FRONTEND noninteractive
RUN tar -zxf stride.tar.gz
RUN make
ENV PATH="/bin/stride/:${PATH}"
WORKDIR /data
USER biodocker
A sequence feature in its most basic form just need start and end index within the sequence. They are usually abbreviated by a one-character code in most visualizations, and DSSP as well as Stride use on-letter codes for their assignment.
I added additional metadata such as the name, type, and length of the feature, as well as arbitrary metadata. The full implementation in BioFSharp can be seen here
An annotated sequence is a sequence which has feature annotations. I decided to model these as a Map of sequence features, where the key represents the feature type, and the list contains the individual feature stretches of that type.
The sequence can also be tagged with a string to give it an identifier:
So with this type modelling i was able to annotate a sequence with arbitrary features and visualize their positions. This text-based representation has the same problems as my heatmap approach though: it gets quite hard to read with increasing sequence length and feature count.
Still, this is a nice pretty prionter for usage with fsi.AddPrinter.
To plot a sequence of characters on a 2D plot, we can leverage Plotly.NETs Annotations.
To give the annotations points that can trigger hovertext, i added an invisible line trace behind them.
Fig 2: A simple sequence plot using Plotly.NET's Annotations.
With some additional styling, we can make this look pretty good already:
Remove the Y axis
Mirror the X Axis
Add spike lines per default (very usefull later when combining with the feature traces)
typeChartwithstaticmemberSequencePlot(annotationText:#seq<string>,?FontSize:float)=letfontSize=defaultArgFontSize16.Chart.Line([foriin0..((Seq.lengthannotationText)-1)->(i,1)],MultiText=annotationText,Opacity=0.0,ShowLegend=false,LineColor=Color.fromKeywordBlack)|>Chart.withXAxis(LinearAxis.init(Visible=true,ShowLine=true,ShowTickLabels=true,ShowSpikes=true,ZeroLine=false,Range=StyleParam.Range.MinMax(0.,60.),// as default, show the first 60 characters. Double click to zoom out.Title=Title.init("Sequence index (0-based)",Font=Font.init(Size=fontSize)),TickFont=Font.init(Size=fontSize),Ticks=StyleParam.TickOptions.Inside,Mirror=StyleParam.Mirror.AllTicks))|>Chart.withYAxis(LinearAxis.init(Visible=false,ShowLine=false,ShowTickLabels=false,ShowGrid=false,ZeroLine=false))|>Chart.withAnnotations(annotationText|>Seq.mapi(funxtext->Annotation.init(x,1,Text=(stringtext),ShowArrow=false,Font=Font.init(Size=fontSize))))letseqPlot=Chart.SequencePlot(testSeq.Sequence|>Seq.map(BioItem.symbol>>string))|>Chart.withSize(1000)
Fig 3: A better styled version of the Sequence plot.
Now we need to add the feature traces. While Plotly.NET supports shapes to draw on a Plot, these have the disadvantage of not triggering hover events (at least to my knowledge).
So i decided to render each feature as a horizontal Bar trace, setting its Base property (the Bar start) to the feature start, and the length accordingly.
Using Chart.SingleStack in shared axis mode together with the previous sequence plot, this has the additional advantage that spikelines of the sequence plot span over the features (try hovering over the sequence below)
Fig 4: Bar traces with different bases can be used in a stacked chart to indicate features mapping to the sequence position of the sequence plot on top.
That looks exactly like i wanted it to turn out!
The rest is now a matter of styling. here is what i did additionally (in words):
render all features with the same color, unless indicated otherwise by a color mapping function
As seen on the plot above, When there are multiple features in a single lane, they get rendered with a y offset. This can be overcome by setting the barmode of the chart layout to Overlay
Add a x axis range slider to give more exploratory power
And here is the final result (in code):
typeChartwithstaticmemberSequenceFeatureView(annotatedSequence:AnnotatedSequence<_>,?FontSize:float,?ColorMapping:seq<(string*Color)>,?ShowRangeSlider:bool)=letshowRangeSlider=defaultArgShowRangeSlidertrueletsequenceString=annotatedSequence.Sequence|>Seq.map(BioItem.symbol>>string)letfeatureColorMap=ColorMapping|>Option.defaultValueSeq.empty|>Map.ofSeqletfeaturePlots=annotatedSequence.Features|>Map.toSeq|>Seq.map(fun(featureName,features)->features|>List.map(funf->Chart.Bar([featureName,f.Length-1],Width=0.8,Base=f.Start,Text=$"({f.Start}-{f.End}): {f.Abbreviation}",TextPosition=StyleParam.TextPosition.Inside,ShowLegend=false,MarkerColor=(Map.tryFindfeatureNamefeatureColorMap|>Option.defaultValue(Color.fromKeywordBlack)))))|>Seq.concat[Chart.SequencePlot(sequenceString,?FontSize=FontSize)|>Chart.withYAxis(LinearAxis.init(Domain=StyleParam.Range.MinMax(0.81,1.)))featurePlots|>Chart.combine|>Chart.withYAxis(LinearAxis.init(ShowGrid=true,FixedRange=false,Domain=StyleParam.Range.MinMax(0.,0.79)))]|>Chart.SingleStack(Pattern=StyleParam.LayoutGridPattern.Coupled)|>func->ifshowRangeSliderthenc|>Chart.withXAxisRangeSlider(RangeSlider.init(BorderColor=Color.fromKeywordGray,BorderWidth=1.))elsec|>Chart.withConfig(Config.init(ModeBarButtonsToAdd=[StyleParam.ModeBarButton.ToggleSpikelines]))|>Chart.withLayout(Layout.init(BarMode=StyleParam.BarMode.Overlay))|>Chart.withTitle$"Sequence feature view for {annotatedSequence.Tag}"
Here is what it looks like with a big test sequence:
letbigTestSeq=AnnotatedSequence.create"test sequence"("ATGCTAGTGTCATGCTAGTGTCATGCTAGTGTCATGCTAGTGTCATGCTAGTGTCATGCTAGTGTCATGCTAGTGTCATGCTAGTGTCATGCTAGTGTCATGCTAGTGTC"|>BioArray.ofNucleotideString)(Map.ofList["Feature 1",[SequenceFeature.create("F",1,33,'X');SequenceFeature.create("F",50,60,'D')]"Feature 2",[SequenceFeature.create("F",0,30,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,100,'L')]"Feature 3",[SequenceFeature.create("F",8,83,'X');SequenceFeature.create("F",84,100,'D')]"Feature 4",[SequenceFeature.create("F",80,85,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,79,'L')]"Feature 5",[SequenceFeature.create("F",1,33,'X');SequenceFeature.create("F",50,60,'D')]"Feature 6",[SequenceFeature.create("F",0,30,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,100,'L')]"Feature 7",[SequenceFeature.create("F",8,83,'X');SequenceFeature.create("F",84,100,'D')]"Feature 8",[SequenceFeature.create("F",80,85,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,79,'L')]"Feature 9",[SequenceFeature.create("F",1,33,'X');SequenceFeature.create("F",50,60,'D')]"Feature 10",[SequenceFeature.create("F",0,30,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,100,'L')]"Feature 11",[SequenceFeature.create("F",8,83,'X');SequenceFeature.create("F",84,100,'D')]"Feature 12",[SequenceFeature.create("F",80,85,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,79,'L')]"Feature 13",[SequenceFeature.create("F",1,33,'X');SequenceFeature.create("F",50,60,'D')]"Feature 14",[SequenceFeature.create("F",0,30,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,100,'L')]"Feature 15",[SequenceFeature.create("F",8,83,'X');SequenceFeature.create("F",84,100,'D')]"Feature 16",[SequenceFeature.create("F",80,85,'L');SequenceFeature.create("F",40,50,'E');SequenceFeature.create("F",52,79,'L')]])letfinalChart=Chart.SequenceFeatureView(bigTestSeq,ColorMapping=["Feature 10",Color.fromKeywordDarkSalmon]// show feature 10 in a different color)|>Chart.withSize(1000)
Fig 5: The final result of my feature view plotting efforts.
namespace BioFSharp
namespace System
namespace System.IO
SequenceFeature.Name: string
Multiple items val string : value:'T -> string <summary>Converts the argument to a string using <c>ToString</c>.</summary> <remarks>For standard integer and floating point values the and any type that implements <c>IFormattable</c><c>ToString</c> conversion uses <c>CultureInfo.InvariantCulture</c>. </remarks> <param name="value">The input value.</param> <returns>The converted string.</returns>
-------------------- type string = System.String <summary>An abbreviation for the CLI type <see cref="T:System.String" />.</summary> <category>Basic Types</category>
SequenceFeature.Start: int
Multiple items val int : value:'T -> int (requires member op_Explicit) <summary>Converts the argument to signed 32-bit integer. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using <c>Int32.Parse()</c>
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.</summary> <param name="value">The input value.</param> <returns>The converted int</returns>
-------------------- [<Struct>]
type int = int32 <summary>An abbreviation for the CLI type <see cref="T:System.Int32" />.</summary> <category>Basic Types</category>
-------------------- type int<'Measure> =
int <summary>The type of 32-bit signed integer numbers, annotated with a unit of measure. The unit
of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
<see cref="T:System.Int32" />.</summary> <category>Basic Types with Units of Measure</category>
SequenceFeature.End: int
SequenceFeature.Length: int
SequenceFeature.Abbreviation: char
Multiple items val char : value:'T -> char (requires member op_Explicit) <summary>Converts the argument to character. Numeric inputs are converted according to the UTF-16
encoding for characters. String inputs must be exactly one character long. For other
input types the operation requires an appropriate static conversion method on the input type.</summary> <param name="value">The input value.</param> <returns>The converted char.</returns>
-------------------- [<Struct>]
type char = System.Char <summary>An abbreviation for the CLI type <see cref="T:System.Char" />.</summary> <category>Basic Types</category>
SequenceFeature.Metadata: Map<string,string>
Multiple items module Map
from Microsoft.FSharp.Collections <summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.Map`2" />.</summary>
-------------------- type Map<'Key,'Value (requires comparison)> =
interface IReadOnlyDictionary<'Key,'Value>
interface IReadOnlyCollection<KeyValuePair<'Key,'Value>>
interface IEnumerable
interface IComparable
interface IEnumerable<KeyValuePair<'Key,'Value>>
interface ICollection<KeyValuePair<'Key,'Value>>
interface IDictionary<'Key,'Value>
new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
member Add : key:'Key * value:'Value -> Map<'Key,'Value>
member Change : key:'Key * f:('Value option -> 'Value option) -> Map<'Key,'Value>
... <summary>Immutable maps based on binary trees, where keys are ordered by F# generic comparison. By default
comparison is the F# structural comparison function or uses implementations of the IComparable interface on key values.</summary> <remarks>See the <see cref="T:Microsoft.FSharp.Collections.MapModule" /> module for further operations on maps.
All members of this class are thread-safe and may be used concurrently from multiple threads.</remarks>
-------------------- new : elements:seq<'Key * 'Value> -> Map<'Key,'Value>
SequenceFeature.FeatureType: string
val name : string
val featureStart : int
val featureEnd : int
val Abbreviation : char option
val Metadata : Map<string,string> option
val FeatureType : string option
val failwith : message:string -> 'T <summary>Throw a <see cref="T:System.Exception" /> exception.</summary> <param name="message">The exception message.</param> <returns>The result value.</returns>
module Option
from Microsoft.FSharp.Core <summary>Contains operations for working with options.</summary> <category>Options</category>
val defaultValue : value:'T -> option:'T option -> 'T <summary>Gets the value of the option if the option is <c>Some</c>, otherwise returns the specified default value.</summary> <param name="value">The specified default value.</param> <param name="option">The input option.</param> <returns>The option if the option is Some, else the default value.</returns> <remarks>Identical to the built-in <see cref="defaultArg" /> operator, except with the arguments swapped.</remarks> <example><code>
(99, None) ||> Option.defaultValue // evaluates to 99
(99, Some 42) ||> Option.defaultValue // evaluates to 42
</code></example>
val ofList : elements:('Key * 'T) list -> Map<'Key,'T> (requires comparison) <summary>Returns a new map made from the given bindings.</summary> <param name="elements">The input list of key/value pairs.</param> <returns>The resulting map.</returns>
val feature1 : SequenceFeature
type SequenceFeature =
{ Name: string
Start: int
End: int
Length: int
Abbreviation: char
Metadata: Map<string,string>
FeatureType: string }
static member create : name:string * featureStart:int * featureEnd:int * ?Abbreviation:char * ?Metadata:Map<string,string> * ?FeatureType:string -> SequenceFeature
static member tryGetIntersection : feature1:SequenceFeature -> feature2:SequenceFeature -> (int * int) option
val feature2 : SequenceFeature
val s1 : int
val e1 : int
val s2 : int
val e2 : int
union case Option.None: Option<'T> <summary>The representation of "No value"</summary>
union case Option.Some: Value: 'T -> Option<'T> <summary>The representation of "Value of type 'T"</summary> <param name="Value">The input value.</param> <returns>An option representing the value.</returns>
val max : e1:'T -> e2:'T -> 'T (requires comparison) <summary>Maximum based on generic comparison</summary> <param name="e1">The first value.</param> <param name="e2">The second value.</param> <returns>The maximum value.</returns>
val min : e1:'T -> e2:'T -> 'T (requires comparison) <summary>Minimum based on generic comparison</summary> <param name="e1">The first value.</param> <param name="e2">The second value.</param> <returns>The minimum value.</returns>
type IBioItem =
abstract member Formula : Formula
abstract member Name : string
abstract member Symbol : char
abstract member isGap : bool
abstract member isTerminator : bool <summary>
Marker interface for BioItem base.
</summary>
AnnotatedSequence.Tag: string
AnnotatedSequence.Sequence: seq<'T>
Multiple items val seq : sequence:seq<'T> -> seq<'T> <summary>Builds a sequence using sequence expression syntax</summary> <param name="sequence">The input sequence.</param> <returns>The result sequence.</returns>
-------------------- type seq<'T> = System.Collections.Generic.IEnumerable<'T> <summary>An abbreviation for the CLI type <see cref="T:System.Collections.Generic.IEnumerable`1" /></summary> <remarks>
See the <see cref="T:Microsoft.FSharp.Collections.SeqModule" /> module for further operations related to sequences.
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/sequences">F# Language Guide - Sequences</a>.
</remarks>
type 'T list = List<'T> <summary>The type of immutable singly-linked lists. </summary> <remarks>See the <see cref="T:Microsoft.FSharp.Collections.ListModule" /> module for further operations related to lists.
Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1; 2; 3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/lists">F# Language Guide - Lists</a>.
</remarks>
val create : tag:string -> sequence:seq<'a> -> featureMap:Map<string,SequenceFeature list> -> AnnotatedSequence<'a> (requires 'a :> IBioItem)
val tag : string
val sequence : seq<#IBioItem>
val featureMap : Map<string,SequenceFeature list>
val mutable hasInvalidFeatures : bool
val mutable invalidFeatures : (string * (SequenceFeature * SequenceFeature)) list
val isOverlap : (int * int -> int * int -> bool)
val stretch1 : int * int
val stretch2 : int * int
val iter : action:('Key -> 'T -> unit) -> table:Map<'Key,'T> -> unit (requires comparison) <summary>Applies the given function to each binding in the dictionary</summary> <param name="action">The function to apply to each key/value pair.</param> <param name="table">The input map.</param>
val key : string
val features : SequenceFeature list
val loop : (SequenceFeature list -> unit)
val featureList : SequenceFeature list
val f : SequenceFeature
val rest : SequenceFeature list
val frest : SequenceFeature
val addFeatures : featureKey:string -> features:SequenceFeature list -> anns:AnnotatedSequence<'a> -> AnnotatedSequence<'a> (requires 'a :> IBioItem)
val featureKey : string
val anns : AnnotatedSequence<#IBioItem>
val containsKey : key:'Key -> table:Map<'Key,'T> -> bool (requires comparison) <summary>Tests if an element is in the domain of the map.</summary> <param name="key">The input key.</param> <param name="table">The input map.</param> <returns>True if the map contains the key.</returns>
val add : key:'Key -> value:'T -> table:Map<'Key,'T> -> Map<'Key,'T> (requires comparison) <summary>Returns a new map with the binding added to the given map.
If a binding with the given key already exists in the input map, the existing binding is replaced by the new binding in the result map.</summary> <param name="key">The input key.</param> <param name="value">The input value.</param> <param name="table">The input map.</param> <returns>The resulting map.</returns>
val toStrings : anns:AnnotatedSequence<#IBioItem> -> string * Map<string,string>
val sequenceString : string
AnnotatedSequence.Sequence: seq<'a>
module Seq
from Microsoft.FSharp.Collections <summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.seq`1" />.</summary>
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U> <summary>Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The given function will be applied
as elements are demanded using the <c>MoveNext</c> method on enumerators retrieved from the
object.</summary> <remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.</remarks> <param name="mapping">A function to transform items from the input sequence.</param> <param name="source">The input sequence.</param> <returns>The result sequence.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
module BioItem
from BioFSharp <summary>
Basic functions on IBioItems interface
</summary>
val symbol : bItem:#IBioItem -> char <summary>
Returns the symbol of the bio item
</summary>
module String
from Microsoft.FSharp.Core <summary>Functional programming operators for string processing. Further string operations
are available via the member functions on strings and other functionality in
<a href="http://msdn2.microsoft.com/en-us/library/system.string.aspx">System.String</a>
and <a href="http://msdn2.microsoft.com/library/system.text.regularexpressions.aspx">System.Text.RegularExpressions</a> types.
</summary> <category>Strings and Text</category>
val concat : sep:string -> strings:seq<string> -> string <summary>Returns a new string made by concatenating the given strings
with separator <c>sep</c>, that is <c>a1 + sep + ... + sep + aN</c>.</summary> <param name="sep">The separator string to be inserted between the strings
of the input sequence.</param> <param name="strings">The sequence of strings to be concatenated.</param> <returns>A new string consisting of the concatenated strings separated by
the separation string.</returns> <exception cref="T:System.ArgumentNullException">Thrown when <c>strings</c> is null.</exception>
val emptyFormatString : string
val i : int
val length : source:seq<'T> -> int <summary>Returns the length of the sequence</summary> <param name="source">The input sequence.</param> <returns>The length of the sequence.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
val featureFormats : Map<string,string>
val map : mapping:('Key -> 'T -> 'U) -> table:Map<'Key,'T> -> Map<'Key,'U> (requires comparison) <summary>Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The key passed to the
function indicates the key of element being transformed.</summary> <param name="mapping">The function to transform the key/value pairs.</param> <param name="table">The input map.</param> <returns>The resulting map of keys and transformed values.</returns>
val fold : folder:('State -> 'T -> 'State) -> state:'State -> source:seq<'T> -> 'State <summary>Applies a function to each element of the collection, threading an accumulator argument
through the computation. If the input function is <c>f</c> and the elements are <c>i0...iN</c>
then computes <c>f (... (f s i0)...) iN</c></summary> <param name="folder">A function that updates the state with each element from the sequence.</param> <param name="state">The initial state.</param> <param name="source">The input sequence.</param> <returns>The state object after the folding function is applied to each element of the sequence.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
val acc : string
val feature : SequenceFeature
val featureStretch : string
val format : anns:AnnotatedSequence<#IBioItem> -> string
val featureStrings : Map<string,string>
val longestId : int
val toList : table:Map<'Key,'T> -> ('Key * 'T) list (requires comparison) <summary>Returns a list of all key-value pairs in the mapping.
The list will be ordered by the keys of the map.</summary> <param name="table">The input map.</param> <returns>The list of key/value pairs.</returns>
Multiple items module List
from Microsoft.FSharp.Collections <summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.list`1" />.</summary> <namespacedoc><summary>Operations for collections such as lists, arrays, sets, maps and sequences. See also
<a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/fsharp-collection-types">F# Collection Types</a> in the F# Language Guide.
</summary></namespacedoc>
-------------------- type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IReadOnlyList<'T>
interface IReadOnlyCollection<'T>
interface IEnumerable
interface IEnumerable<'T>
member GetReverseIndex : rank:int * offset:int -> int
member GetSlice : startIndex:int option * endIndex:int option -> 'T list
static member Cons : head:'T * tail:'T list -> 'T list
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
... <summary>The type of immutable singly-linked lists.</summary> <remarks>Use the constructors <c>[]</c> and <c>::</c> (infix) to create values of this type, or
the notation <c>[1;2;3]</c>. Use the values in the <c>List</c> module to manipulate
values of this type, or pattern match against the values directly.
</remarks> <exclude />
val map : mapping:('T -> 'U) -> list:'T list -> 'U list <summary>Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection.</summary> <param name="mapping">The function to transform elements from the input list.</param> <param name="list">The input list.</param> <returns>The list of transformed elements.</returns>
val fst : tuple:('T1 * 'T2) -> 'T1 <summary>Return the first element of a tuple, <c>fst (a,b) = a</c>.</summary> <param name="tuple">The input tuple.</param> <returns>The first value.</returns>
val maxBy : projection:('T -> 'U) -> source:seq<'T> -> 'T (requires comparison) <summary>Returns the greatest of all elements of the sequence, compared via Operators.max on the function result.</summary> <param name="projection">A function to transform items from the input sequence into comparable keys.</param> <param name="source">The input sequence.</param> <returns>The largest element of the sequence.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception> <exception cref="T:System.ArgumentException">Thrown when the input sequence is empty.</exception>
val snd : tuple:('T1 * 'T2) -> 'T2 <summary>Return the second element of a tuple, <c>snd (a,b) = b</c>.</summary> <param name="tuple">The input tuple.</param> <returns>The second value.</returns>
val mapi : mapping:(int -> 'T -> 'U) -> list:'T list -> 'U list <summary>Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The integer index passed to the
function indicates the index (from 0) of element being transformed.</summary> <param name="mapping">The function to transform elements and their indices.</param> <param name="list">The input list.</param> <returns>The list of transformed elements.</returns>
val chunkBySize : chunkSize:int -> source:seq<'T> -> seq<'T []> <summary>Divides the input sequence into chunks of size at most <c>chunkSize</c>.</summary> <param name="chunkSize">The maximum size of each chunk.</param> <param name="source">The input sequence.</param> <returns>The sequence divided into chunks.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception> <exception cref="T:System.ArgumentException">Thrown when <c>chunkSize</c> is not positive.</exception>
val innerSplits : seq<seq<string>>
val mapi : mapping:(int -> 'T -> 'U) -> source:seq<'T> -> seq<'U> <summary>Builds a new collection whose elements are the results of applying the given function
to each of the elements of the collection. The integer index passed to the
function indicates the index (from 0) of element being transformed.</summary> <param name="mapping">A function to transform items from the input sequence that also supplies the current index.</param> <param name="source">The input sequence.</param> <returns>The result sequence.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
val strs : seq<string>
val line : string
val elem : string
val sprintf : format:Printf.StringFormat<'T> -> 'T <summary>Print to a string using the given format.</summary> <param name="format">The formatter.</param> <returns>The formatted result.</returns>
module Array
from Microsoft.FSharp.Collections <summary>Contains operations for working with arrays.</summary> <remarks>
See also <a href="https://docs.microsoft.com/dotnet/fsharp/language-reference/arrays">F# Language Guide - Arrays</a>.
</remarks>
val ofSeq : source:seq<'T> -> 'T [] <summary>Builds a new array from the given enumerable object.</summary> <param name="source">The input sequence.</param> <returns>The array of elements from the sequence.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
val b : string []
type Environment =
static member Exit : exitCode: int -> unit
static member ExpandEnvironmentVariables : name: string -> string
static member FailFast : message: string -> unit + 1 overload
static member GetCommandLineArgs : unit -> string []
static member GetEnvironmentVariable : variable: string -> string + 1 overload
static member GetEnvironmentVariables : unit -> IDictionary + 1 overload
static member GetFolderPath : folder: SpecialFolder -> string + 1 overload
static member GetLogicalDrives : unit -> string []
static member SetEnvironmentVariable : variable: string * value: string -> unit + 1 overload
static member CommandLine : string
... <summary>Provides information about, and means to manipulate, the current environment and platform. This class cannot be inherited.</summary>
property System.Environment.NewLine: string with get <summary>Gets the newline string defined for this environment.</summary> <returns><see langword="\r\n" /> for non-Unix platforms, or <see langword="\n" /> for Unix platforms.</returns>
val testSeq : AnnotatedSequence<Nucleotides.Nucleotide>
Multiple items module AnnotatedSequence
from 008_sequence_features
Multiple items module BioArray
from BioFSharp.BioCollectionsExtensions
-------------------- module BioArray
from BioFSharp <summary>
This module contains the BioArray type and its according functions. The BioArray type is an array of objects using the IBioItem interface
</summary>
val ofNucleotideString : s:#seq<char> -> BioArray.BioArray<Nucleotides.Nucleotide> <summary>
Generates nucleotide sequence of one-letter-code raw string
</summary>
-------------------- type Color =
private new : obj:obj -> Color
override Equals : other:obj -> bool
override GetHashCode : unit -> int
static member fromARGB : a:int -> r:int -> g:int -> b:int -> Color
static member fromColorScaleValues : c:seq<#IConvertible> -> Color
static member fromColors : c:seq<Color> -> Color
static member fromHex : s:string -> Color
static member fromKeyword : c:ColorKeyword -> Color
static member fromRGB : r:int -> g:int -> b:int -> Color
static member fromString : c:string -> Color
... <summary>
Plotly color can be a single color, a sequence of colors, or a sequence of numeric values referencing the color of the colorscale obj
</summary>
static member Color.fromKeyword : c:ColorKeyword -> Color
-------------------- module Seq
from Microsoft.FSharp.Collections <summary>Contains operations for working with values of type <see cref="T:Microsoft.FSharp.Collections.seq`1" />.</summary>
Multiple items type Font =
inherit DynamicObj
new : unit -> Font
static member init : ?Family:FontFamily * ?Size:float * ?Color:Color -> Font
static member style : ?Family:FontFamily * ?Size:float * ?Color:Color -> (Font -> Font) <summary>
Font type inherits from dynamic object
</summary>
-------------------- new : unit -> Font
static member Font.init : ?Family:StyleParam.FontFamily * ?Size:float * ?Color:Color -> Font
module GenericChart
from Plotly.NET <summary>
Module to represent a GenericChart
</summary>
val toChartHTML : gChart:GenericChart.GenericChart -> string <summary>
Converts a GenericChart to it HTML representation. The div layer has a default size of 600 if not specified otherwise.
</summary>
val annotationText : #seq<string>
val FontSize : float option
Multiple items val float : value:'T -> float (requires member op_Explicit) <summary>Converts the argument to 64-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using <c>Double.Parse()</c>
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.</summary> <param name="value">The input value.</param> <returns>The converted float</returns>
-------------------- [<Struct>]
type float = System.Double <summary>An abbreviation for the CLI type <see cref="T:System.Double" />.</summary> <category>Basic Types</category>
-------------------- type float<'Measure> =
float <summary>The type of double-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
<see cref="T:System.Double" />.</summary> <category index="6">Basic Types with Units of Measure</category>
val fontSize : float
val defaultArg : arg:'T option -> defaultValue:'T -> 'T <summary>Used to specify a default value for an optional argument in the implementation of a function</summary> <param name="arg">An option representing the argument.</param> <param name="defaultValue">The default value of the argument.</param> <returns>The argument value. If it is None, the defaultValue is returned.</returns>
type Range =
| MinMax of float * float
| Values of float array
member Convert : unit -> obj
static member convert : (Range -> obj) <summary>
Defines a Range between min and max value
</summary>
union case StyleParam.Range.MinMax: float * float -> StyleParam.Range
Multiple items type Title =
inherit DynamicObj
new : unit -> Title
static member init : ?Text:string * ?Font:Font * ?Standoff:int * ?Side:Side * ?X:float * ?Y:float -> Title
static member style : ?Text:string * ?Font:Font * ?Standoff:int * ?Side:Side * ?X:float * ?Y:float -> (Title -> Title)
-------------------- new : unit -> Title
static member Title.init : ?Text:string * ?Font:Font * ?Standoff:int * ?Side:StyleParam.Side * ?X:float * ?Y:float -> Title
type TickOptions =
| Outside
| Inside
| Empty
member Convert : unit -> obj
override ToString : unit -> string
static member convert : (TickOptions -> obj)
static member toString : (TickOptions -> string) <summary>
Determines whether ticks are drawn or not. If "", this axis' ticks are not drawn. If "outside" ("inside"), this axis' are drawn outside (inside) the axis lines.
</summary>
union case StyleParam.TickOptions.Inside: StyleParam.TickOptions
type Mirror =
| True
| Ticks
| False
| All
| AllTicks
member Convert : unit -> obj
override ToString : unit -> string
static member convert : (Mirror -> obj)
static member toString : (Mirror -> string) <summary>
Determines if the axis lines or/and ticks are mirrored to the opposite side of the plotting area. If "true", the axis lines are mirrored.
If "ticks", the axis lines and ticks are mirrored. If "false", mirroring is disable. If "all", axis lines are mirrored on all shared-axes subplots. If "allticks", axis lines and ticks are mirrored on all shared-axes subplots.
</summary>
union case StyleParam.Mirror.AllTicks: StyleParam.Mirror
type LayoutGridPattern =
| Independent
| Coupled
member Convert : unit -> obj
override ToString : unit -> string
static member convert : (LayoutGridPattern -> obj)
static member toString : (LayoutGridPattern -> string) <summary>
Pattern to use for autogenerating Axis Ids when not specifically specifying subplot axes IDs in LayoutGrids
</summary>
union case StyleParam.LayoutGridPattern.Coupled: StyleParam.LayoutGridPattern <summary>
Gives one x axis per column and one y axis per row
</summary>
val annotatedSequence : AnnotatedSequence<#IBioItem>
val ColorMapping : seq<string * Color> option
val ShowRangeSlider : bool option
[<Struct>]
type bool = System.Boolean <summary>An abbreviation for the CLI type <see cref="T:System.Boolean" />.</summary> <category>Basic Types</category>
val showRangeSlider : bool
val sequenceString : seq<string>
val featureColorMap : Map<string,Color>
val empty<'T> : seq<'T> <summary>Creates an empty sequence.</summary> <returns>An empty sequence.</returns>
val ofSeq : elements:seq<'Key * 'T> -> Map<'Key,'T> (requires comparison) <summary>Returns a new map made from the given bindings.</summary> <param name="elements">The input sequence of key/value pairs.</param> <returns>The resulting map.</returns>
val featurePlots : seq<GenericChart.GenericChart>
val toSeq : table:Map<'Key,'T> -> seq<'Key * 'T> (requires comparison) <summary>Views the collection as an enumerable sequence of pairs.
The sequence will be ordered by the keys of the map.</summary> <param name="table">The input map.</param> <returns>The sequence of key/value pairs.</returns>
val featureName : string
type TextPosition =
| TopLeft
| TopCenter
| TopRight
| MiddleLeft
| MiddleCenter
| MiddleRight
| BottomLeft
| BottomCenter
| BottomRight
| Auto
...
member Convert : unit -> obj
override ToString : unit -> string
static member convert : (TextPosition -> obj)
static member toString : (TextPosition -> string) <summary>
Sets the positions of the `text` elements. Note that not all options work for every type of trace, e.g. Pie Charts only support "inside" | "outside" | "auto" | "none"
- Cartesian plots: Sets the positions of the `text` elements with respects to the (x,y) coordinates.
- Pie Charts and derivatives: Specifies the location of the text with respects to the sector.
</summary>
union case StyleParam.TextPosition.Inside: StyleParam.TextPosition
val tryFind : key:'Key -> table:Map<'Key,'T> -> 'T option (requires comparison) <summary>Lookup an element in the map, returning a <c>Some</c> value if the element is in the domain
of the map and <c>None</c> if not.</summary> <param name="key">The input key.</param> <param name="table">The input map.</param> <returns>The found <c>Some</c> value or <c>None</c>.</returns>
val concat : sources:seq<#seq<'T>> -> seq<'T> <summary>Combines the given enumeration-of-enumerations as a single concatenated
enumeration.</summary> <remarks>The returned sequence may be passed between threads safely. However,
individual IEnumerator values generated from the returned sequence should not be accessed concurrently.</remarks> <param name="sources">The input enumeration-of-enumerations.</param> <returns>The result sequence.</returns> <exception cref="T:System.ArgumentNullException">Thrown when the input sequence is null.</exception>
Multiple items type Domain =
inherit DynamicObj
new : unit -> Domain
static member init : ?X:Range * ?Y:Range * ?Row:int * ?Column:int -> Domain
static member style : ?X:Range * ?Y:Range * ?Row:int * ?Column:int -> (Domain -> Domain) <summary>
Dimensions type inherits from dynamic object
</summary>
type BarMode =
| Stack
| Group
| Overlay
| Relative
member Convert : unit -> obj
override ToString : unit -> string
static member convert : (BarMode -> obj)
static member toString : (BarMode -> string) <summary>
For bar and histogram plots only. This sets how multiple bar objects are plotted together. In other words, this defines how bars at the same location
appear on the plot. If set to 'stack' the bars are stacked on top of one another. If set to 'group', the bars are plotted next to one another, centered
around the shared location. If set to 'overlay', the bars are simply plotted over one another, you may need to set the opacity to see this.
</summary>
union case StyleParam.BarMode.Overlay: StyleParam.BarMode