wmacnair/psupertime

glmnet error

Opened this issue · 0 comments

Hi,

Thank you for this package. I am trying to fit psupertime model for bulkRNAseq data. I have 40 samples and I am trying to fit the model with donor age. However, I get the following error. Can you please suggest:

  1. Whether psupertime can be used with bulkRNASe data.
  2. How can I solve this error?
Error in glmnet(glmnet.data$x, glmnet.data$y, family = "binomial", weights = glmnet.data$weights,  : 
  the length of penalty.factor does not match the number of variables

My command is:

y <- dds$ageDeath


mat_limma <- limma::removeBatchEffect(x = as.matrix(counts(dds, normalized = TRUE)), 
                                      batch = dds$sex,
                                      batch2 = dds$apoe,
                                      covariates = dds$pmi,
                                      design = model.matrix(~ as.factor(ageDeath),
                                                            data = as.data.frame(colData(dds))))

psuper_obj  <- psupertime(
  x = as(mat_limma, "dgCMatrix"),
  y,
  y_labels = NULL,
  sel_genes = "all",
  gene_list = NULL,
  scale = TRUE,
  smooth = FALSE,
  min_expression = 0.1,
  penalization = "best",
  method = "proportional",
  score = "xentropy",
  n_folds = 5,
  test_propn = 0.5,
  lambdas = NULL,
  max_iters = 1000,
  seed = 1234
)

Thanks
Nurun