Skip to content
Permalink
Browse files

Merge pull request #6 from nceglia/master

Size Factor Fixes
  • Loading branch information...
kieranrcampbell committed Mar 29, 2019
2 parents e819439 + 773e59e commit b6120cdccbb5a143fddd39455f52a6b2bd8cf23f
Showing with 4 additions and 14 deletions.
  1. +1 −6 R/clonealign.R
  2. +3 −8 R/inference-tflow.R
@@ -181,7 +181,7 @@ clonealign <- function(gene_expression_data,
cov = cov,
ref = cov,
fix_alpha = fix_alpha,
size_factors = "fixed",
size_factors = size_factors,
dtype = dtype,
saturate = saturate,
saturation_threshold = saturation_threshold,
@@ -526,8 +526,3 @@ plot_mean_dispersion <- function(em) {
ggplot2::qplot(x, y, geom = 'line') +
labs(x = expression(mu), y = expression(phi))
}





@@ -181,7 +181,7 @@ inference_tflow <- function(Y_dat,

mu_guess <- colMeans(data$Y / rowMeans(data$Y)) / rowMeans(data$L)
mu_guess <- mu_guess[-1] / mu_guess[1]

if(!data_init_mu) {
mu_guess <- rep(1, length(mu_guess))
}
@@ -208,7 +208,7 @@ inference_tflow <- function(Y_dat,
s <- NULL

# Sort out size factors
if(length(size_factors == 1) && N > 1) {
if(length(size_factors) == 1 && N > 1) {
if(!is.character(size_factors)) {
stop("If size factors does not contain sizes per cell it must be either 'fixed' or 'infer'. See ?clonealign")
}
@@ -223,7 +223,7 @@ inference_tflow <- function(Y_dat,
}

} else if(length(size_factors) > 1) {
if(length(size_factors) != N || !is.numeric(size_factors) || all(size_factors > 0)) {
if(length(size_factors) != N || !is.numeric(size_factors) || !all(size_factors > 0)) {
stop("If size factors is not specified as 'fixed' or 'infer' a positive numeric vector of length N_cells must be supplied. See ?clonealign")
}
s <- tf$constant(size_factors, dtype = dtype)
@@ -445,8 +445,3 @@ inference_tflow <- function(Y_dat,

return(rlist)
}





0 comments on commit b6120cd

Please sign in to comment.
You can’t perform that action at this time.