Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kmerclust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Delattre
kmerclust
Commits
06151cc3
Verified
Commit
06151cc3
authored
Oct 19, 2023
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
dev/flat_full_poisson.Rmd: add fix for NA value in M step
parent
153ec623
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dev/flat_full.Rmd
+1
-1
1 addition, 1 deletion
dev/flat_full.Rmd
dev/flat_full_poisson.Rmd
+21
-9
21 additions, 9 deletions
dev/flat_full_poisson.Rmd
with
22 additions
and
10 deletions
dev/flat_full.Rmd
+
1
−
1
View file @
06151cc3
...
@@ -140,7 +140,7 @@ data %>%
...
@@ -140,7 +140,7 @@ data %>%
```
```
## OO data
## OO data
```{r sim_
X
O}
```{r sim_
O
O}
data <- sim_kmer(1e4, 1000, "OO")
data <- sim_kmer(1e4, 1000, "OO")
data %>%
data %>%
ggplot(aes(x = count_m, y = count_f, color = sex)) +
ggplot(aes(x = count_m, y = count_f, color = sex)) +
...
...
This diff is collapsed.
Click to expand it.
dev/flat_full_poisson.Rmd
+
21
−
9
View file @
06151cc3
...
@@ -265,11 +265,15 @@ m_bipoiss_clust_a_chr <- function(x, s, h) {
...
@@ -265,11 +265,15 @@ m_bipoiss_clust_a_chr <- function(x, s, h) {
sum((x[, 1] - s) * h) / denum +
sum((x[, 1] - s) * h) / denum +
sum((x[, 2] - s) * h) / denum
sum((x[, 2] - s) * h) / denum
) / 2
) / 2
re
turn(
list(
re
s <-
list(
l1 = lambda_global,
l1 = lambda_global,
l2 = lambda_global,
l2 = lambda_global,
l3 = sum(s * h) / denum
l3 = sum(s * h) / denum
))
)
for (i in which(is.na(res))) {
res[[i]] <- 1
}
return(res)
}
}
```
```
...
@@ -289,11 +293,15 @@ m_bipoiss_clust_a_chr <- function(x, s, h) {
...
@@ -289,11 +293,15 @@ m_bipoiss_clust_a_chr <- function(x, s, h) {
#' em_bipoiss(m_bipoiss = m_bipoiss_x_chr)
#' em_bipoiss(m_bipoiss = m_bipoiss_x_chr)
m_bipoiss_clust_x_chr <- function(x, s, h) {
m_bipoiss_clust_x_chr <- function(x, s, h) {
denum <- sum(h)
denum <- sum(h)
re
turn(
list(
re
s <-
list(
l1 = 1,
l1 = 1,
l2 = sum((x[, 2] - s) * h) / denum,
l2 = sum((x[, 2] - s) * h) / denum,
l3 = sum(s * h) / denum
l3 = sum(s * h) / denum
))
)
for (i in which(is.na(res))) {
res[[i]] <- 1
}
return(res)
}
}
```
```
...
@@ -314,11 +322,15 @@ m_bipoiss_clust_x_chr <- function(x, s, h) {
...
@@ -314,11 +322,15 @@ m_bipoiss_clust_x_chr <- function(x, s, h) {
#' em_bipoiss(m_bipoiss = m_bipoiss_y_chr)
#' em_bipoiss(m_bipoiss = m_bipoiss_y_chr)
m_bipoiss_clust_y_chr <- function(x, s, h) {
m_bipoiss_clust_y_chr <- function(x, s, h) {
denum <- sum(h)
denum <- sum(h)
re
turn(
list(
re
s <-
list(
l1 = sum((x[, 1] - s) * h) / denum,
l1 = sum((x[, 1] - s) * h) / denum,
l2 = 1,
l2 = 1,
l3 = sum(s * h) / denum
l3 = sum(s * h) / denum
))
)
for (i in which(is.na(res))) {
res[[i]] <- 1
}
return(res)
}
}
```
```
...
@@ -412,7 +424,7 @@ param_diff_poiss <- function(
...
@@ -412,7 +424,7 @@ param_diff_poiss <- function(
j <- 2
j <- 2
}
}
if (is.na(params[[i]][[param]])) {
if (is.na(params[[i]][[param]])) {
warning(paste("param_diff_poiss: parameter value: ", i, ":", params))
warning(paste("param_diff_poiss: parameter value: ", i, ":", params
, "\n"
))
return(T)
return(T)
}
}
if (abs(params[[i]][[param]] - old_params[[i]][[param]]) > threshold[j])
if (abs(params[[i]][[param]] - old_params[[i]][[param]]) > threshold[j])
...
@@ -800,9 +812,9 @@ We simulate 1 clusters from bi-Poisson distribution
...
@@ -800,9 +812,9 @@ We simulate 1 clusters from bi-Poisson distribution
```{r model_compare_OO}
```{r model_compare_OO}
data <- rbind(
data <- rbind(
extraDistr::rbvpois(1000, 100, 100, 200) # A
extraDistr::rbvpois(1000
0
, 100, 100, 200) # A
)
)
res <- data %>% poiss_compare_models(nboot =
5
, core = 1, max_iter = 30)
res <- data %>% poiss_compare_models(nboot =
10
, core = 1, max_iter = 30)
res %>%
res %>%
pivot_longer(cols = -c("name"), names_to = "metric") %>%
pivot_longer(cols = -c("name"), names_to = "metric") %>%
ggplot(aes(x = name, y = value)) +
ggplot(aes(x = name, y = value)) +
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment