Accessing online databases
BioFSharp contains a set of readers that facilitate the access to different biological online resources. This documentation aims to give an introduction for them.
UniProt's Proteins REST API online access |
📂View module documentation |
In this tutorial I want to show you how to access data from UniProt and give examples for what might be done with it. As a first step we will retreive data about the Copper-transporting ATPase 2 of different species.
1: 2: 3: 4: |
|
|
What we want to do now is getting an measure of phylogenetic relationship. We will do this by aligning the peptide-sequences with each other. For this we prepare the data and the alignment function.
1: 2: 3: |
|
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: |
|
Let's see what we get..
1: 2: 3: 4: |
|
|
We can see that the Copper-transporting ATPase 2 of mouse and rat are the most similar to each other, while the one of the sheep is relatively different.
But not only the protein names and their sequences can be stored in UniProt. For these proteins we also get information about the cellular location of each of their amino acids. Why not see if the hydrophobic amino acids are located in the membrane after all?
First we design a type to model the location more nicely. Afterwards we create a function for mapping the protein information to just the location information of all amino acids in one protein.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: |
|
We also create ourselves a function for retreiving hydrophobicity of all amino acids of our protein and an additional helper.
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: |
|
1: 2: 3: |
|
Now let's see what we get. The colored areas depict the cell membrane. The line graph represents the amino acids of the protein with their given hydrophobicity.
1: 2: 3: 4: 5: |
|
|
As you can see the hydrophobic areas overlap with the membrane areas.
namespace FSharp
--------------------
namespace Microsoft.FSharp
from FSharpAux
from BioFSharp
from BioFSharp.Formula
from BioFSharp.BioDB
type UniProteinDB =
new : unit -> UniProteinDB
static member getAntigen : accession:string -> Async<ProteinFeatureInfo>
static member getGenomicCoordinates : accession:string -> Async<GnEntry>
static member getProteinSeqFeature : accession:string * ?categories:string [] * ?types:string [] -> Async<ProteinFeatureInfo>
static member getProteomicsPeptide : accession:string -> Async<ProteinFeatureInfo>
static member getUniProtEntry : accession:string -> Async<Entry>
static member searchAntigens : ?offset:int * ?size:int * ?accession:string * ?antigenSequence:string * ?antigenID:string * ?ensemblIDs:string * ?matchscore:int -> Async<ProteinFeatureInfo []>
static member searchEntries : ?offset:int * ?size:int * ?accession:string * ?reviewed:string * ?isoforms:int * ?goterms:string * ?keywords:string * ?ec:string * ?gene:string * ?protein:string * ?organism:string * ?taxid:string * ?pubmed:string -> Async<Entry []>
static member searchGenomicCoordinates : ?offset:int * ?size:int * ?accession:string * ?chromosome:string * ?ensembl:string * ?gene:string * ?protein:string * ?taxid:string * ?location:string -> Async<GnEntry []>
static member searchNaturalVariants : ?offset:int * ?size:int * ?accession:string * ?taxid:string * ?sourcetype:string * ?consequencetype:string * ?wildtype:string * ?alternativesequence:string * ?location:string * ?disease:string * ?omim:string * ?evidence:string -> Async<ProteinFeatureInfo []>
...
--------------------
new : unit -> EbiAPI.UniProteinDB
type Async =
static member AsBeginEnd : computation:('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit)
static member AwaitEvent : event:IEvent<'Del,'T> * ?cancelAction:(unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate)
static member AwaitIAsyncResult : iar:IAsyncResult * ?millisecondsTimeout:int -> Async<bool>
static member AwaitTask : task:Task -> Async<unit>
static member AwaitTask : task:Task<'T> -> Async<'T>
static member AwaitWaitHandle : waitHandle:WaitHandle * ?millisecondsTimeout:int -> Async<bool>
static member CancelDefaultToken : unit -> unit
static member Catch : computation:Async<'T> -> Async<Choice<'T,exn>>
static member Choice : computations:seq<Async<'T option>> -> Async<'T option>
static member FromBeginEnd : beginAction:(AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T>
...
--------------------
type Async<'T> =
module Array
from FSharpAux
--------------------
module Array
from Microsoft.FSharp.Collections
from BioFSharp
Creates the pairwise global alignment of two amino acid sequences based on the BLOSUM62 scoring matrix
from BioFSharp.Algorithm
from BioFSharp.Algorithm
{ Open: int
Continuation: int
Similarity: 'a -> 'a -> int }
from BioFSharp
struct
interface IBioItem
interface IComparable
private new : value:byte -> AminoAcidSymbol
override Equals : other:obj -> bool
override GetHashCode : unit -> int
override ToString : unit -> string
member private Value : byte
static member Ala : AminoAcidSymbol
static member Arg : AminoAcidSymbol
static member Asn : AminoAcidSymbol
...
end
from BioFSharp.Algorithm.PairwiseAlignment
Aligns two amino acid sequences and writes their relative alignment score into a square matrix
module Array2D
from FSharpAux
--------------------
module Array2D
from Microsoft.FSharp.Collections
val float : value:'T -> float (requires member op_Explicit)
--------------------
type float = System.Double
--------------------
type float<'Measure> = float
static member Area : xy:seq<#IConvertible * #IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:'a2 * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:'a4 -> GenericChart
static member Area : x:seq<#IConvertible> * y:seq<#IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:'a2 * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:'a4 -> GenericChart
static member Bar : keysvalues:seq<#IConvertible * #IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart
static member Bar : keys:seq<#IConvertible> * values:seq<#IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart
static member BoxPlot : xy:seq<'a0 * 'a1> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Fillcolor:'a3 * ?Opacity:float * ?Whiskerwidth:'a4 * ?Boxpoints:Boxpoints * ?Boxmean:BoxMean * ?Jitter:'a5 * ?Pointpos:'a6 * ?Orientation:Orientation -> GenericChart
static member BoxPlot : ?x:'a0 * ?y:'a1 * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Fillcolor:'a3 * ?Opacity:float * ?Whiskerwidth:'a4 * ?Boxpoints:Boxpoints * ?Boxmean:BoxMean * ?Jitter:'a5 * ?Pointpos:'a6 * ?Orientation:Orientation -> GenericChart
static member Bubble : xysizes:seq<#IConvertible * #IConvertible * #IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:'a3 * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font -> GenericChart
static member Bubble : x:seq<#IConvertible> * y:seq<#IConvertible> * sizes:seq<#IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:'a3 * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font -> GenericChart
static member ChoroplethMap : locations:seq<string> * z:seq<#IConvertible> * ?Text:seq<#IConvertible> * ?Locationmode:LocationFormat * ?Autocolorscale:bool * ?Colorscale:Colorscale * ?Colorbar:'a2 * ?Marker:Marker * ?Zmin:'a3 * ?Zmax:'a4 -> GenericChart
static member Column : keysvalues:seq<#IConvertible * #IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart
...
from FSharp.Plotly
| Custom of seq<float * string>
| RdBu
| Earth
| Blackbody
| YIOrRd
| YIGnBu
| Bluered
| Portland
| Electric
| Jet
...
static member convert : (Colorscale -> obj)
| Intracellular
| Transmembrane
| Extracellular
Maps protein information to information of location of amino acids of this protein
nested type Absorption
nested type AlternativeName
nested type AssociationType
nested type CanonicalGeneType
nested type CitationType
nested type Client
nested type CofactorType
nested type CommentType
nested type Component
nested type ComponentType
nested type Conflict
nested type DbReference
nested type DbReferenceObject
nested type DbReferenceType
nested type Disease
nested type DiseaseComment
nested type Domain
nested type Entry
nested type ErrorMessage
nested type EventType
nested type Evidence
nested type EvidenceType
nested type EvidencedString
nested type EvidencedStringType
nested type ExonMapType
nested type Feature
nested type FeatureType
nested type GeneLocationType
nested type GeneNameType
nested type GeneType
nested type GenomicLocationType
nested type GnCoordinateType
nested type GnEntry
nested type GnFeatureType
nested type ImportedFromType
nested type IntAct
nested type InteractantType
nested type IsoformType
nested type JournalType
nested type KeywordType
nested type Kinetics
nested type Lineage
nested type Link
nested type LocationType
nested type MoleculeType
nested type Name
nested type NameListType
nested type OrganismNameType
nested type OrganismType
nested type PLocation2GLocation
nested type PLocation2GLocationCollection
nested type PeptideType
nested type PhDependence
nested type PolyphenPredictionType
nested type PositionType
nested type PropertyType
nested type ProteinExistenceType
nested type ProteinFeatureInfo
nested type ProteinNameType
nested type ProteinType
nested type Proteome
nested type RecommendedName
nested type RedoxPotential
nested type RedundantProteomeType
nested type ReferenceType
nested type Sequence
nested type SequenceType1
nested type SiftPredictionType
nested type SourceDataType
nested type SourceType
nested type StatusType
nested type SubcellLocationComment
nested type SubcellularLocation
nested type SubcellularLocationType
nested type SubmissionType
nested type SubmittedName
nested type TemperatureDependence
nested type UPInteraction
nested type VariantType
new : unit -> ProteinFeatureInfo + 1 overload
member Accession : string with get, set
member EntryName : string with get, set
member Features : Feature[] with get, set
member GeteGeneId : string with get, set
member GeteProteinId : string with get, set
member Sequence : string with get, set
member SequenceChecksum : string with get, set
member Taxid : FSharpOption<int> with get, set
member ToString : unit -> string
...
val int : value:'T -> int (requires member op_Explicit)
--------------------
type int = int32
--------------------
type int<'Measure> = int
Evaluates the hydrophobicity of all amino acids of a sequence
from BioFSharp
Creates the squares depicting the cell membrane
type Shape =
inherit DynamicObj
new : unit -> Shape
static member init : ?ShapeType:ShapeType * ?X0:'a * ?X1:'b * ?Y0:'c * ?Y1:'d * ?Path:'e * ?Opacity:'f * ?Line:Line * ?Fillcolor:'g * ?Layer:Layer * ?Xref:'h * ?Yref:'i -> Shape
static member style : ?ShapeType:ShapeType * ?X0:'a0 * ?X1:'a1 * ?Y0:'a2 * ?Y1:'a3 * ?Path:'a4 * ?Opacity:'a5 * ?Line:Line * ?Fillcolor:'a6 * ?Layer:Layer * ?Xref:'a7 * ?Yref:'a8 -> (Shape -> Shape)
--------------------
new : unit -> Shape
| Circle
| Rectangle
| SvgPath
| Line
static member convert : (ShapeType -> obj)
static member toString : (ShapeType -> string)
module Colors
from FSharpAux
--------------------
module Colors
from FSharp.Plotly
val toWebColor : c:Color -> string
--------------------
val toWebColor : c:Colors.Color -> string
module Table
from FSharpAux.Colors
--------------------
module Table
from FSharp.Plotly.Colors
module Office
from FSharpAux.Colors.Table
--------------------
module Office
from FSharp.Plotly.Colors.Table
val orange : Color
--------------------
val orange : Colors.Color
static member Chart.Line : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:'a2 * ?Opacity:float * ?Labels:seq<#System.IConvertible> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:'a4 * ?Width:'a5 -> GenericChart.GenericChart
{ A: byte
R: byte
G: byte
B: byte }
val toHex : prefix:bool -> c:Color -> string
--------------------
val toHex : prefix:bool -> c:Colors.Color -> string
val blue : Color
--------------------
val blue : Colors.Color
module Seq
from FSharpAux
--------------------
module Seq
from FSharp.Plotly
--------------------
module Seq
from Microsoft.FSharp.Collections