Skip to content

Commit

Permalink
updated dirichlet generation
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericlemoine committed Feb 21, 2024
1 parent 4d18587 commit b034b00
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions distance/dna/distance.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,17 @@ func BuildWeightsGamma(al align.Alignment) []float64 {
return outweights
}

/* Returns a vector of weights following a Dirichlet distribution D(n ; 1,...,1)
with n alignment length
/*
Returns a vector of weights following a Dirichlet distribution D(n ; 1,...,1)
with n alignment length
*/
func BuildWeightsDirichlet(al align.Alignment) []float64 {
alpha := make([]float64, al.Length(), al.Length())
for i := 0; i < al.Length(); i++ {
alpha[i] = 1
}
outweights := stats.Dirichlet(float64(al.Length()), alpha...)
outweights, _ := stats.Dirichlet(float64(al.Length()), alpha...)
return outweights
}

Expand Down Expand Up @@ -439,7 +441,8 @@ func probaNt(sequenceCodes [][]uint8, selectedSites []bool, weights []float64) (
return pi, nil
}

/*Returns the proba of each nts for the 2 sequences considered
/*
Returns the proba of each nts for the 2 sequences considered
A=0
C=1
G=2
Expand Down

0 comments on commit b034b00

Please sign in to comment.