diff --git a/dev/404.html b/dev/404.html index 6d85c5a..f2f263d 100644 --- a/dev/404.html +++ b/dev/404.html @@ -16,7 +16,7 @@
- + \ No newline at end of file diff --git a/dev/api.html b/dev/api.html index 97bb2ba..16d7410 100644 --- a/dev/api.html +++ b/dev/api.html @@ -13,7 +13,7 @@ - + @@ -29,7 +29,7 @@ 0.0 0.0 0.0 0.0 0.1111 0.4444 0.0 0.4444 - Initial Probabilities -> Vector{Float64}(4 × 1): - 0.3333 0.3333 0.0 0.3333

source

BioMarkovChains.initials Method
julia
initials(sequence::SeqOrView{A}) where A

Calculate the estimated initial probabilities for a Markov chain based on a given sequence.

This function takes a sequence of states and calculates the estimated initial probabilities of each state in the sequence for a Markov chain. The initial probabilities are estimated by counting the occurrences of each state at the beginning of the sequence and normalizing the counts to sum up to 1.

πi=P(Xi=i),iTi=1Nπi=1

Now using the dinucleotides counts estimating the initials would follow:

πi^=cikck

Arguments

Returns

An Vector{Flot64} of estimated initial probabilities for each state in the sequence.

source

BioMarkovChains.log_odds_ratio_matrix Method
julia
log_odds_ratio_matrix(model1::BioMarkovChain, model2::BioMarkovChain)

Calculates the log-odds ratio between the transition probability matrices of two BioMarkovChain models.

β=logP(x|m1)P(x|m2)

Where m1 and m2 are the two models transition probability matrices.

Arguments

source

BioMarkovChains.log_odds_ratio_score Method
julia
log_odds_ratio_score(sequence::SeqOrView{A}; modela::BioMarkovChain, modelb::BioMarkovChain, b::Number = 2)

Compute the log odds ratio score between a given sequence and a BioMarkovChain model.

S(x)=i=1Lβxix=i=1logai1m1xiai1m2xi

Arguments

Returns

The log odds ratio score between the sequence and the models.

Example

source

BioMarkovChains.markovprobability Method
julia
markovprobability(sequence::LongNucOrView{4}, model::BioMarkovChain)

Compute the probability of a given sequence using a transition probability matrix and the initial probabilities distributions of a BioMarkovModel.

P(X1=i1,,XT=iT)=πi1T1t=1T1ait,it+1

Arguments

Keywords

Returns

Example

julia
seq = LongDNA{4}("CGCGCGCGCGCGCGCGCGCGCGCGCG")
+   0.3333  0.3333  0.0     0.3333

source

BioMarkovChains.initials Method
julia
initials(sequence::SeqOrView{A}) where A

Calculate the estimated initial probabilities for a Markov chain based on a given sequence.

This function takes a sequence of states and calculates the estimated initial probabilities of each state in the sequence for a Markov chain. The initial probabilities are estimated by counting the occurrences of each state at the beginning of the sequence and normalizing the counts to sum up to 1.

πi=P(Xi=i),iTi=1Nπi=1

Now using the dinucleotides counts estimating the initials would follow:

πi^=cikck

Arguments

Returns

An Vector{Flot64} of estimated initial probabilities for each state in the sequence.

source

BioMarkovChains.log_odds_ratio_matrix Method
julia
log_odds_ratio_matrix(model1::BioMarkovChain, model2::BioMarkovChain)

Calculates the log-odds ratio between the transition probability matrices of two BioMarkovChain models.

β=logP(x|m1)P(x|m2)

Where m1 and m2 are the two models transition probability matrices.

Arguments

source

BioMarkovChains.log_odds_ratio_score Method
julia
log_odds_ratio_score(sequence::SeqOrView{A}; modela::BioMarkovChain, modelb::BioMarkovChain, b::Number = 2)

Compute the log odds ratio score between a given sequence and a BioMarkovChain model.

S(x)=i=1Lβxix=i=1logai1m1xiai1m2xi

Arguments

Returns

The log odds ratio score between the sequence and the models.

Example

source

BioMarkovChains.markovprobability Method
julia
markovprobability(sequence::LongNucOrView{4}, model::BioMarkovChain)

Compute the probability of a given sequence using a transition probability matrix and the initial probabilities distributions of a BioMarkovModel.

P(X1=i1,,XT=iT)=πi1T1t=1T1ait,it+1

Arguments

Keywords

Returns

Example

julia
seq = LongDNA{4}("CGCGCGCGCGCGCGCGCGCGCGCGCG")
    
 markovprobability(seq, model=CPGPOS, logscale=true)
     -45.073409957110556
@@ -54,7 +54,7 @@
  0.0  0.0  0.0  1.0
  0.0  1.0  0.0  0.0
  1.0  0.0  0.0  0.0

source

- + \ No newline at end of file diff --git a/dev/article01.html b/dev/article01.html index 1082269..52bb8c5 100644 --- a/dev/article01.html +++ b/dev/article01.html @@ -37,7 +37,7 @@ 0.43478260869565216 0.34782608695652173 0.13043478260869565
- + \ No newline at end of file diff --git a/dev/assets/api.md.zfS-jOne.js b/dev/assets/api.md.C7nT9GaC.js similarity index 90% rename from dev/assets/api.md.zfS-jOne.js rename to dev/assets/api.md.C7nT9GaC.js index 3daed4f..27ea09f 100644 --- a/dev/assets/api.md.zfS-jOne.js +++ b/dev/assets/api.md.C7nT9GaC.js @@ -9,7 +9,7 @@ import{_ as i,c as T,j as t,a as s,G as n,a5 as Q,B as m,o as e}from"./chunks/fr 0.0 0.0 0.0 0.0 0.1111 0.4444 0.0 0.4444 - Initial Probabilities -> Vector{Float64}(4 × 1): - 0.3333 0.3333 0.0 0.3333

source

`,9))]),t("details",h,[t("summary",null,[a[6]||(a[6]=t("a",{id:"BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.initials")],-1)),a[7]||(a[7]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[12]||(a[12]=Q('
julia
initials(sequence::SeqOrView{A}) where A

Calculate the estimated initial probabilities for a Markov chain based on a given sequence.

This function takes a sequence of states and calculates the estimated initial probabilities of each state in the sequence for a Markov chain. The initial probabilities are estimated by counting the occurrences of each state at the beginning of the sequence and normalizing the counts to sum up to 1.

',3)),t("mjx-container",p,[(e(),T("svg",g,a[8]||(a[8]=[Q('',1)]))),a[9]||(a[9]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mtable",{displaystyle:"true",columnalign:"right left",columnspacing:"0em",rowspacing:"3pt"},[t("mtr",null,[t("mtd",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",null,"="),t("mi",null,"i"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"i"),t("mo",null,"∈"),t("mi",null,"T")])]),t("mtr",null,[t("mtd",null,[t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"N")])]),t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mn",null,"1")])])])])],-1))]),a[13]||(a[13]=t("p",null,"Now using the dinucleotides counts estimating the initials would follow:",-1)),t("mjx-container",u,[(e(),T("svg",c,a[10]||(a[10]=[Q('',1)]))),a[11]||(a[11]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mrow",{"data-mjx-texclass":"ORD"},[t("mover",null,[t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",{stretchy:"false"},"^")])]),t("mo",null,"="),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])]),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])])])],-1))]),a[14]||(a[14]=t("p",null,[t("strong",null,"Arguments")],-1)),a[15]||(a[15]=t("ul",null,[t("li",null,[t("code",null,"sequence::SeqOrView{A}"),s(": The sequence of states representing the Markov chain.")])],-1)),a[16]||(a[16]=t("p",null,[t("strong",null,"Returns")],-1)),a[17]||(a[17]=t("p",null,[s("An "),t("code",null,"Vector{Flot64}"),s(" of estimated initial probabilities for each state in the sequence.")],-1)),a[18]||(a[18]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",k,[t("summary",null,[a[19]||(a[19]=t("a",{id:"BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_matrix")],-1)),a[20]||(a[20]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[30]||(a[30]=Q('
julia
log_odds_ratio_matrix(model1::BioMarkovChain, model2::BioMarkovChain)

Calculates the log-odds ratio between the transition probability matrices of two BioMarkovChain models.

',2)),t("mjx-container",H,[(e(),T("svg",x,a[21]||(a[21]=[Q('𝓂𝓂',1)]))),a[22]||(a[22]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"β"),t("mo",null,"="),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},")")]),t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])]),t("mo",{stretchy:"false"},")")])])])],-1))]),t("p",null,[a[27]||(a[27]=s("Where ")),t("mjx-container",y,[(e(),T("svg",L,a[23]||(a[23]=[Q('𝓂',1)]))),a[24]||(a[24]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])],-1))]),a[28]||(a[28]=s(" and ")),t("mjx-container",w,[(e(),T("svg",f,a[25]||(a[25]=[Q('𝓂',1)]))),a[26]||(a[26]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])],-1))]),a[29]||(a[29]=s(" are the two models transition probability matrices."))]),a[31]||(a[31]=t("p",null,[t("strong",null,"Arguments")],-1)),a[32]||(a[32]=t("ul",null,[t("li",null,[t("p",null,[t("code",null,"model1::BioMarkovChain"),s(": The first BioMarkovChain model.")])]),t("li",null,[t("p",null,[t("code",null,"model2::BioMarkovChain"),s(": The second BioMarkovChain model.")])])],-1)),a[33]||(a[33]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",M,[t("summary",null,[a[34]||(a[34]=t("a",{id:"BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_score")],-1)),a[35]||(a[35]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[38]||(a[38]=Q('
julia
log_odds_ratio_score(sequence::SeqOrView{A}; modela::BioMarkovChain, modelb::BioMarkovChain, b::Number = 2)

Compute the log odds ratio score between a given sequence and a BioMarkovChain model.

',2)),t("mjx-container",b,[(e(),T("svg",D,a[36]||(a[36]=[Q('𝓂𝓂',1)]))),a[37]||(a[37]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"S"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"L")])]),t("msub",null,[t("mi",null,"β"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"x"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mi",null,"x")])]),t("mo",null,"="),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")])]),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])]),t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])])])])],-1))]),a[39]||(a[39]=Q('

Arguments

Returns

The log odds ratio score between the sequence and the models.

Example

source

',6))]),t("details",Z,[t("summary",null,[a[40]||(a[40]=t("a",{id:"BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.NucleicAcidAlphabet",href:"#BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.NucleicAcidAlphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.markovprobability")],-1)),a[41]||(a[41]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[44]||(a[44]=Q('
julia
markovprobability(sequence::LongNucOrView{4}, model::BioMarkovChain)

Compute the probability of a given sequence using a transition probability matrix and the initial probabilities distributions of a BioMarkovModel.

',2)),t("mjx-container",C,[(e(),T("svg",A,a[42]||(a[42]=[Q('',1)]))),a[43]||(a[43]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mn",null,"1")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mn",null,"1")]),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"X"),t("mi",null,"T")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mi",null,"T")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("msubsup",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mn",null,"1")])]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∏"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("msub",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mi",null,"t")]),t("mo",null,","),t("msub",null,[t("mi",null,"i"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"+"),t("mn",null,"1")])])])])])],-1))]),a[45]||(a[45]=Q(`

Arguments

Keywords

Returns

Example

julia
seq = LongDNA{4}("CGCGCGCGCGCGCGCGCGCGCGCGCG")
+   0.3333  0.3333  0.0     0.3333

source

`,9))]),t("details",h,[t("summary",null,[a[6]||(a[6]=t("a",{id:"BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.initials")],-1)),a[7]||(a[7]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[12]||(a[12]=Q('
julia
initials(sequence::SeqOrView{A}) where A

Calculate the estimated initial probabilities for a Markov chain based on a given sequence.

This function takes a sequence of states and calculates the estimated initial probabilities of each state in the sequence for a Markov chain. The initial probabilities are estimated by counting the occurrences of each state at the beginning of the sequence and normalizing the counts to sum up to 1.

',3)),t("mjx-container",p,[(e(),T("svg",g,a[8]||(a[8]=[Q('',1)]))),a[9]||(a[9]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mtable",{displaystyle:"true",columnalign:"right left",columnspacing:"0em",rowspacing:"3pt"},[t("mtr",null,[t("mtd",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",null,"="),t("mi",null,"i"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"i"),t("mo",null,"∈"),t("mi",null,"T")])]),t("mtr",null,[t("mtd",null,[t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"N")])]),t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mn",null,"1")])])])])],-1))]),a[13]||(a[13]=t("p",null,"Now using the dinucleotides counts estimating the initials would follow:",-1)),t("mjx-container",u,[(e(),T("svg",c,a[10]||(a[10]=[Q('',1)]))),a[11]||(a[11]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mrow",{"data-mjx-texclass":"ORD"},[t("mover",null,[t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",{stretchy:"false"},"^")])]),t("mo",null,"="),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])]),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])])])],-1))]),a[14]||(a[14]=t("p",null,[t("strong",null,"Arguments")],-1)),a[15]||(a[15]=t("ul",null,[t("li",null,[t("code",null,"sequence::SeqOrView{A}"),s(": The sequence of states representing the Markov chain.")])],-1)),a[16]||(a[16]=t("p",null,[t("strong",null,"Returns")],-1)),a[17]||(a[17]=t("p",null,[s("An "),t("code",null,"Vector{Flot64}"),s(" of estimated initial probabilities for each state in the sequence.")],-1)),a[18]||(a[18]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",k,[t("summary",null,[a[19]||(a[19]=t("a",{id:"BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_matrix")],-1)),a[20]||(a[20]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[30]||(a[30]=Q('
julia
log_odds_ratio_matrix(model1::BioMarkovChain, model2::BioMarkovChain)

Calculates the log-odds ratio between the transition probability matrices of two BioMarkovChain models.

',2)),t("mjx-container",H,[(e(),T("svg",x,a[21]||(a[21]=[Q('𝓂𝓂',1)]))),a[22]||(a[22]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"β"),t("mo",null,"="),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},")")]),t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])]),t("mo",{stretchy:"false"},")")])])])],-1))]),t("p",null,[a[27]||(a[27]=s("Where ")),t("mjx-container",y,[(e(),T("svg",L,a[23]||(a[23]=[Q('𝓂',1)]))),a[24]||(a[24]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])],-1))]),a[28]||(a[28]=s(" and ")),t("mjx-container",w,[(e(),T("svg",f,a[25]||(a[25]=[Q('𝓂',1)]))),a[26]||(a[26]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])],-1))]),a[29]||(a[29]=s(" are the two models transition probability matrices."))]),a[31]||(a[31]=t("p",null,[t("strong",null,"Arguments")],-1)),a[32]||(a[32]=t("ul",null,[t("li",null,[t("p",null,[t("code",null,"model1::BioMarkovChain"),s(": The first BioMarkovChain model.")])]),t("li",null,[t("p",null,[t("code",null,"model2::BioMarkovChain"),s(": The second BioMarkovChain model.")])])],-1)),a[33]||(a[33]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",M,[t("summary",null,[a[34]||(a[34]=t("a",{id:"BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_score")],-1)),a[35]||(a[35]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[38]||(a[38]=Q('
julia
log_odds_ratio_score(sequence::SeqOrView{A}; modela::BioMarkovChain, modelb::BioMarkovChain, b::Number = 2)

Compute the log odds ratio score between a given sequence and a BioMarkovChain model.

',2)),t("mjx-container",b,[(e(),T("svg",D,a[36]||(a[36]=[Q('𝓂𝓂',1)]))),a[37]||(a[37]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"S"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"L")])]),t("msub",null,[t("mi",null,"β"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"x"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mi",null,"x")])]),t("mo",null,"="),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")])]),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])]),t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])])])])],-1))]),a[39]||(a[39]=Q('

Arguments

Returns

The log odds ratio score between the sequence and the models.

Example

source

',6))]),t("details",Z,[t("summary",null,[a[40]||(a[40]=t("a",{id:"BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.DNAAlphabet",href:"#BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.DNAAlphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.markovprobability")],-1)),a[41]||(a[41]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[44]||(a[44]=Q('
julia
markovprobability(sequence::LongNucOrView{4}, model::BioMarkovChain)

Compute the probability of a given sequence using a transition probability matrix and the initial probabilities distributions of a BioMarkovModel.

',2)),t("mjx-container",C,[(e(),T("svg",A,a[42]||(a[42]=[Q('',1)]))),a[43]||(a[43]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mn",null,"1")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mn",null,"1")]),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"X"),t("mi",null,"T")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mi",null,"T")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("msubsup",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mn",null,"1")])]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∏"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("msub",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mi",null,"t")]),t("mo",null,","),t("msub",null,[t("mi",null,"i"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"+"),t("mn",null,"1")])])])])])],-1))]),a[45]||(a[45]=Q(`

Arguments

Keywords

Returns

Example

julia
seq = LongDNA{4}("CGCGCGCGCGCGCGCGCGCGCGCGCG")
    
 markovprobability(seq, model=CPGPOS, logscale=true)
     -45.073409957110556
diff --git a/dev/assets/api.md.zfS-jOne.lean.js b/dev/assets/api.md.C7nT9GaC.lean.js
similarity index 90%
rename from dev/assets/api.md.zfS-jOne.lean.js
rename to dev/assets/api.md.C7nT9GaC.lean.js
index 3daed4f..27ea09f 100644
--- a/dev/assets/api.md.zfS-jOne.lean.js
+++ b/dev/assets/api.md.C7nT9GaC.lean.js
@@ -9,7 +9,7 @@ import{_ as i,c as T,j as t,a as s,G as n,a5 as Q,B as m,o as e}from"./chunks/fr
    0.0     0.0     0.0     0.0
    0.1111  0.4444  0.0     0.4444
   - Initial Probabilities -> Vector{Float64}(4 × 1):
-   0.3333  0.3333  0.0     0.3333

source

`,9))]),t("details",h,[t("summary",null,[a[6]||(a[6]=t("a",{id:"BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.initials")],-1)),a[7]||(a[7]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[12]||(a[12]=Q('
julia
initials(sequence::SeqOrView{A}) where A

Calculate the estimated initial probabilities for a Markov chain based on a given sequence.

This function takes a sequence of states and calculates the estimated initial probabilities of each state in the sequence for a Markov chain. The initial probabilities are estimated by counting the occurrences of each state at the beginning of the sequence and normalizing the counts to sum up to 1.

',3)),t("mjx-container",p,[(e(),T("svg",g,a[8]||(a[8]=[Q('',1)]))),a[9]||(a[9]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mtable",{displaystyle:"true",columnalign:"right left",columnspacing:"0em",rowspacing:"3pt"},[t("mtr",null,[t("mtd",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",null,"="),t("mi",null,"i"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"i"),t("mo",null,"∈"),t("mi",null,"T")])]),t("mtr",null,[t("mtd",null,[t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"N")])]),t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mn",null,"1")])])])])],-1))]),a[13]||(a[13]=t("p",null,"Now using the dinucleotides counts estimating the initials would follow:",-1)),t("mjx-container",u,[(e(),T("svg",c,a[10]||(a[10]=[Q('',1)]))),a[11]||(a[11]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mrow",{"data-mjx-texclass":"ORD"},[t("mover",null,[t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",{stretchy:"false"},"^")])]),t("mo",null,"="),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])]),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])])])],-1))]),a[14]||(a[14]=t("p",null,[t("strong",null,"Arguments")],-1)),a[15]||(a[15]=t("ul",null,[t("li",null,[t("code",null,"sequence::SeqOrView{A}"),s(": The sequence of states representing the Markov chain.")])],-1)),a[16]||(a[16]=t("p",null,[t("strong",null,"Returns")],-1)),a[17]||(a[17]=t("p",null,[s("An "),t("code",null,"Vector{Flot64}"),s(" of estimated initial probabilities for each state in the sequence.")],-1)),a[18]||(a[18]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",k,[t("summary",null,[a[19]||(a[19]=t("a",{id:"BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_matrix")],-1)),a[20]||(a[20]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[30]||(a[30]=Q('
julia
log_odds_ratio_matrix(model1::BioMarkovChain, model2::BioMarkovChain)

Calculates the log-odds ratio between the transition probability matrices of two BioMarkovChain models.

',2)),t("mjx-container",H,[(e(),T("svg",x,a[21]||(a[21]=[Q('𝓂𝓂',1)]))),a[22]||(a[22]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"β"),t("mo",null,"="),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},")")]),t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])]),t("mo",{stretchy:"false"},")")])])])],-1))]),t("p",null,[a[27]||(a[27]=s("Where ")),t("mjx-container",y,[(e(),T("svg",L,a[23]||(a[23]=[Q('𝓂',1)]))),a[24]||(a[24]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])],-1))]),a[28]||(a[28]=s(" and ")),t("mjx-container",w,[(e(),T("svg",f,a[25]||(a[25]=[Q('𝓂',1)]))),a[26]||(a[26]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])],-1))]),a[29]||(a[29]=s(" are the two models transition probability matrices."))]),a[31]||(a[31]=t("p",null,[t("strong",null,"Arguments")],-1)),a[32]||(a[32]=t("ul",null,[t("li",null,[t("p",null,[t("code",null,"model1::BioMarkovChain"),s(": The first BioMarkovChain model.")])]),t("li",null,[t("p",null,[t("code",null,"model2::BioMarkovChain"),s(": The second BioMarkovChain model.")])])],-1)),a[33]||(a[33]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",M,[t("summary",null,[a[34]||(a[34]=t("a",{id:"BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_score")],-1)),a[35]||(a[35]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[38]||(a[38]=Q('
julia
log_odds_ratio_score(sequence::SeqOrView{A}; modela::BioMarkovChain, modelb::BioMarkovChain, b::Number = 2)

Compute the log odds ratio score between a given sequence and a BioMarkovChain model.

',2)),t("mjx-container",b,[(e(),T("svg",D,a[36]||(a[36]=[Q('𝓂𝓂',1)]))),a[37]||(a[37]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"S"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"L")])]),t("msub",null,[t("mi",null,"β"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"x"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mi",null,"x")])]),t("mo",null,"="),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")])]),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])]),t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])])])])],-1))]),a[39]||(a[39]=Q('

Arguments

Returns

The log odds ratio score between the sequence and the models.

Example

source

',6))]),t("details",Z,[t("summary",null,[a[40]||(a[40]=t("a",{id:"BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.NucleicAcidAlphabet",href:"#BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.NucleicAcidAlphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.markovprobability")],-1)),a[41]||(a[41]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[44]||(a[44]=Q('
julia
markovprobability(sequence::LongNucOrView{4}, model::BioMarkovChain)

Compute the probability of a given sequence using a transition probability matrix and the initial probabilities distributions of a BioMarkovModel.

',2)),t("mjx-container",C,[(e(),T("svg",A,a[42]||(a[42]=[Q('',1)]))),a[43]||(a[43]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mn",null,"1")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mn",null,"1")]),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"X"),t("mi",null,"T")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mi",null,"T")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("msubsup",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mn",null,"1")])]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∏"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("msub",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mi",null,"t")]),t("mo",null,","),t("msub",null,[t("mi",null,"i"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"+"),t("mn",null,"1")])])])])])],-1))]),a[45]||(a[45]=Q(`

Arguments

Keywords

Returns

Example

julia
seq = LongDNA{4}("CGCGCGCGCGCGCGCGCGCGCGCGCG")
+   0.3333  0.3333  0.0     0.3333

source

`,9))]),t("details",h,[t("summary",null,[a[6]||(a[6]=t("a",{id:"BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.initials-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.initials")],-1)),a[7]||(a[7]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[12]||(a[12]=Q('
julia
initials(sequence::SeqOrView{A}) where A

Calculate the estimated initial probabilities for a Markov chain based on a given sequence.

This function takes a sequence of states and calculates the estimated initial probabilities of each state in the sequence for a Markov chain. The initial probabilities are estimated by counting the occurrences of each state at the beginning of the sequence and normalizing the counts to sum up to 1.

',3)),t("mjx-container",p,[(e(),T("svg",g,a[8]||(a[8]=[Q('',1)]))),a[9]||(a[9]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mtable",{displaystyle:"true",columnalign:"right left",columnspacing:"0em",rowspacing:"3pt"},[t("mtr",null,[t("mtd",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",null,"="),t("mi",null,"i"),t("mo",{stretchy:"false"},")"),t("mo",null,","),t("mi",null,"i"),t("mo",null,"∈"),t("mi",null,"T")])]),t("mtr",null,[t("mtd",null,[t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"N")])]),t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])])]),t("mtd",null,[t("mi"),t("mo",null,"="),t("mn",null,"1")])])])])],-1))]),a[13]||(a[13]=t("p",null,"Now using the dinucleotides counts estimating the initials would follow:",-1)),t("mjx-container",u,[(e(),T("svg",c,a[10]||(a[10]=[Q('',1)]))),a[11]||(a[11]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mrow",{"data-mjx-texclass":"ORD"},[t("mover",null,[t("msub",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mo",{stretchy:"false"},"^")])]),t("mo",null,"="),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])]),t("msub",null,[t("mi",null,"c"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"k")])])])],-1))]),a[14]||(a[14]=t("p",null,[t("strong",null,"Arguments")],-1)),a[15]||(a[15]=t("ul",null,[t("li",null,[t("code",null,"sequence::SeqOrView{A}"),s(": The sequence of states representing the Markov chain.")])],-1)),a[16]||(a[16]=t("p",null,[t("strong",null,"Returns")],-1)),a[17]||(a[17]=t("p",null,[s("An "),t("code",null,"Vector{Flot64}"),s(" of estimated initial probabilities for each state in the sequence.")],-1)),a[18]||(a[18]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",k,[t("summary",null,[a[19]||(a[19]=t("a",{id:"BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_matrix-Union{Tuple{A}, Tuple{BioMarkovChain{A}, BioMarkovChain{A}}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_matrix")],-1)),a[20]||(a[20]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[30]||(a[30]=Q('
julia
log_odds_ratio_matrix(model1::BioMarkovChain, model2::BioMarkovChain)

Calculates the log-odds ratio between the transition probability matrices of two BioMarkovChain models.

',2)),t("mjx-container",H,[(e(),T("svg",x,a[21]||(a[21]=[Q('𝓂𝓂',1)]))),a[22]||(a[22]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"β"),t("mo",null,"="),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])]),t("mo",{stretchy:"false"},")")]),t("mrow",null,[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{"data-mjx-texclass":"ORD",stretchy:"false"},"|"),t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])]),t("mo",{stretchy:"false"},")")])])])],-1))]),t("p",null,[a[27]||(a[27]=s("Where ")),t("mjx-container",y,[(e(),T("svg",L,a[23]||(a[23]=[Q('𝓂',1)]))),a[24]||(a[24]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])],-1))]),a[28]||(a[28]=s(" and ")),t("mjx-container",w,[(e(),T("svg",f,a[25]||(a[25]=[Q('𝓂',1)]))),a[26]||(a[26]=t("mjx-assistive-mml",{unselectable:"on",display:"inline",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",width:"auto",overflow:"hidden"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])],-1))]),a[29]||(a[29]=s(" are the two models transition probability matrices."))]),a[31]||(a[31]=t("p",null,[t("strong",null,"Arguments")],-1)),a[32]||(a[32]=t("ul",null,[t("li",null,[t("p",null,[t("code",null,"model1::BioMarkovChain"),s(": The first BioMarkovChain model.")])]),t("li",null,[t("p",null,[t("code",null,"model2::BioMarkovChain"),s(": The second BioMarkovChain model.")])])],-1)),a[33]||(a[33]=t("p",null,[t("a",{href:"https://github.com/BioJulia/BioMarkovChains.jl/",target:"_blank",rel:"noreferrer"},"source")],-1))]),t("details",M,[t("summary",null,[a[34]||(a[34]=t("a",{id:"BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet",href:"#BioMarkovChains.log_odds_ratio_score-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.Alphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.log_odds_ratio_score")],-1)),a[35]||(a[35]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[38]||(a[38]=Q('
julia
log_odds_ratio_score(sequence::SeqOrView{A}; modela::BioMarkovChain, modelb::BioMarkovChain, b::Number = 2)

Compute the log odds ratio score between a given sequence and a BioMarkovChain model.

',2)),t("mjx-container",b,[(e(),T("svg",D,a[36]||(a[36]=[Q('𝓂𝓂',1)]))),a[37]||(a[37]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"S"),t("mo",{stretchy:"false"},"("),t("mi",null,"x"),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"L")])]),t("msub",null,[t("mi",null,"β"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"x"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i")])]),t("mi",null,"x")])]),t("mo",null,"="),t("munder",null,[t("mo",{"data-mjx-texclass":"OP"},"∑"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"="),t("mn",null,"1")])]),t("mi",null,"log"),t("mo",{"data-mjx-texclass":"NONE"},"⁡"),t("mfrac",null,[t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"1")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])]),t("mrow",null,[t("msubsup",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"i"),t("mo",null,"−"),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",{mathvariant:"script"},"m")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mn",null,"2")])])])]),t("msub",null,[t("mi",null,"x"),t("mi",null,"i")])])])])],-1))]),a[39]||(a[39]=Q('

Arguments

Returns

The log odds ratio score between the sequence and the models.

Example

source

',6))]),t("details",Z,[t("summary",null,[a[40]||(a[40]=t("a",{id:"BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.DNAAlphabet",href:"#BioMarkovChains.markovprobability-Union{Tuple{Union{BioSequences.LongSequence{A}, BioSequences.LongSubSeq{A}}}, Tuple{A}} where A<:BioSequences.DNAAlphabet"},[t("span",{class:"jlbinding"},"BioMarkovChains.markovprobability")],-1)),a[41]||(a[41]=s()),n(l,{type:"info",class:"jlObjectType jlMethod",text:"Method"})]),a[44]||(a[44]=Q('
julia
markovprobability(sequence::LongNucOrView{4}, model::BioMarkovChain)

Compute the probability of a given sequence using a transition probability matrix and the initial probabilities distributions of a BioMarkovModel.

',2)),t("mjx-container",C,[(e(),T("svg",A,a[42]||(a[42]=[Q('',1)]))),a[43]||(a[43]=t("mjx-assistive-mml",{unselectable:"on",display:"block",style:{top:"0px",left:"0px",clip:"rect(1px, 1px, 1px, 1px)","-webkit-touch-callout":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none",position:"absolute",padding:"1px 0px 0px 0px",border:"0px",display:"block",overflow:"hidden",width:"100%"}},[t("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[t("mi",null,"P"),t("mo",{stretchy:"false"},"("),t("msub",null,[t("mi",null,"X"),t("mn",null,"1")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mn",null,"1")]),t("mo",null,","),t("mo",null,"…"),t("mo",null,","),t("msub",null,[t("mi",null,"X"),t("mi",null,"T")]),t("mo",null,"="),t("msub",null,[t("mi",null,"i"),t("mi",null,"T")]),t("mo",{stretchy:"false"},")"),t("mo",null,"="),t("msubsup",null,[t("mi",null,"π"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mn",null,"1")])]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("munderover",null,[t("mo",{"data-mjx-texclass":"OP"},"∏"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"="),t("mn",null,"1")]),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"T"),t("mo",null,"−"),t("mn",null,"1")])]),t("msub",null,[t("mi",null,"a"),t("mrow",{"data-mjx-texclass":"ORD"},[t("msub",null,[t("mi",null,"i"),t("mi",null,"t")]),t("mo",null,","),t("msub",null,[t("mi",null,"i"),t("mrow",{"data-mjx-texclass":"ORD"},[t("mi",null,"t"),t("mo",null,"+"),t("mn",null,"1")])])])])])],-1))]),a[45]||(a[45]=Q(`

Arguments

Keywords

Returns

Example

julia
seq = LongDNA{4}("CGCGCGCGCGCGCGCGCGCGCGCGCG")
    
 markovprobability(seq, model=CPGPOS, logscale=true)
     -45.073409957110556
diff --git a/dev/biomarkovchains.html b/dev/biomarkovchains.html
index c9e0efd..b44162c 100644
--- a/dev/biomarkovchains.html
+++ b/dev/biomarkovchains.html
@@ -19,7 +19,7 @@
   
   
     
Skip to content

Towards Markov Chains

DNA as a Markov chain

Several packages (e.g. MarkovChainsHammer.jl, DiscreteMarkovChains.jl, etc.) in the Julia ecosystem have been implemented to work with Markov chains with a state space of integers, those could be efficient in many ways, but they are clumsy to work with a specialized biological types as in the BioJulia ecosystem. Therefore, in the GeneFinder package we dedicated some implementations to work with BioSequence types so that we can expand the functionality in an efficient way (see complete API).

One important step towards many gene finding algorithms is to represent a DNA sequence as a Markov chain. In this representation a DNA sequence of a reduced alphabet A={A,C,G,T} is draw as a four-vertex graph, where each letter of A is a state (vertex) and the edges of the graph represent transitions from one nucleotide to another in a sequence (e.g. AT represent a single nucleotide to nucleotide transition). This is also considered more specifically as a Discrete Markov chain (Axelson-Fisk 2015). The complete set of transitions and states of a DNA sequence of alphabet A.

More formally a Markov chain is a random process where each state is a random variable Xt where tT is a discrete time in a finite sequence T and the probability to jump from one state into another is only dependent of the current state. Therefore a definition of this Markov property is given by:

P(Xt=j|Xt1=i)

where i,jA . This property led us to generalize a way to calculate the probability of a sequence T from a process (X1...XT) where each random variable is a nucleotide from A so that:

P(X1=i1,...,XT=iT)=P(X1=i1)t=2TP(Xt=it|Xt1=it1)

Note that previous equations has two terms, a initial probability P(X1=i1) and the the product of all transitions beginning at t=2. So, to calculate the initial probability distribution of each of the nucleotides of a string T with the alphabet 𝒜 we can first calculate the transition probability matrix M^ out of the frequency count of the transitions. In an alphabet 𝒜 we got 42 transitions of one order, that is the AA,AC,AG,... which coincides with the frequency of the dinucleotides in the sequence. So we can later in fact build a 4x4 matrix representing all the transitions. For instance in a DNA sequence T of 24 nucleotides:

CCTCCCGGACCCTGGGCTCGGGAC

We can calculate each frequency nucleotide to any other nucleotide m^ij=cijci where cij is the actual count of the dinucleotide, and therefore ci is the counts of the nucleotide i to any other nucleotide and build the transition probability matrix:

[ACGTA0.001.000.000.00C0.000.560.220.30G0.250.120.620.00T0.000.670.330.00]

It is noteworthy that initial probabilities can also be obtained from the counts of each nucleotide transitions cij over the total sum of the dinucleotide counts ck:

π^i=cikck

That way for the previous example example we can can calculate the initial probabilities π^=(0.08,0.43,0.34,0.13). Both set of probabilities composed a transition model that can be used to predict the probability of any DNA sequence using equation (2).

References

Axelson-Fisk, Marina. 2015. Comparative Gene Finding. Vol. 20. Computational Biology. London: Springer London. http://link.springer.com/10.1007/978-1-4471-6693-1.

- + \ No newline at end of file diff --git a/dev/getstarted.html b/dev/getstarted.html index dfc890c..635633a 100644 --- a/dev/getstarted.html +++ b/dev/getstarted.html @@ -37,7 +37,7 @@ 0.0833 0.375 0.3417 0.2 - Initial Probabilities -> Vector{Float64}(4 × 1): 0.087 0.4348 0.3478 0.1304
- + \ No newline at end of file diff --git a/dev/hashmap.json b/dev/hashmap.json index 41d5936..21603fd 100644 --- a/dev/hashmap.json +++ b/dev/hashmap.json @@ -1 +1 @@ -{"api.md":"zfS-jOne","article01.md":"BdJ-pfFi","biomarkovchains.md":"CChOotgC","getstarted.md":"D89Wvxuh","home.md":"BRDkl6Ze","index.md":"CO72eP2z"} +{"api.md":"C7nT9GaC","article01.md":"BdJ-pfFi","biomarkovchains.md":"CChOotgC","getstarted.md":"D89Wvxuh","home.md":"BRDkl6Ze","index.md":"CO72eP2z"} diff --git a/dev/home.html b/dev/home.html index 7522294..73a690e 100644 --- a/dev/home.html +++ b/dev/home.html @@ -19,7 +19,7 @@
Skip to content


Representing biological sequences as Markov chains


Overview

This package aim to represent BioSequences types as Markov chains to perform different operations and predictions

- + \ No newline at end of file diff --git a/dev/index.html b/dev/index.html index 1328e83..12b1a2b 100644 --- a/dev/index.html +++ b/dev/index.html @@ -19,7 +19,7 @@
Skip to content

BioMarkovChains.jl

Representing biological sequences as Markov chains

BioMarkovChains

Install BioMarkovChains from the julia REPL. Press ] to enter pkg mode, and enter the add BioMarkovChains command.

julia
(@v1.10) pkg> add BioMarkovChains

For more information, see the Get Started section.

- + \ No newline at end of file