Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glmnet error #30

Open
nfancy opened this issue Feb 22, 2023 · 0 comments
Open

glmnet error #30

nfancy opened this issue Feb 22, 2023 · 0 comments

Comments

@nfancy
Copy link

nfancy commented Feb 22, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant