Pando icon indicating copy to clipboard operation
Pando copied to clipboard

Update grn.R

Open Sandman-1 opened this issue 2 years ago • 1 comments

The NetworkTFs() function does not return a data frame or matrix with transcription factor names as column names. As a result, when the program tries to find transcription factors to use - tf_use <- colnames(motif2tf) - R returns an error of incorrect dimensions shortly after saying it's fitting a model. This is during the early part of the infer_grn step.

Instead, the NetworkTFs() function returns a named numeric, with names being the actual transcription factors. Therefore, my proposed edit is to change the line "tf_use <- colnames(motif2tf)" to "tf_use <- names(motif2tf) %>% na.omit()" and follow it with "motif2tf <- motif2tf[tf_use, drop = FALSE]."

Sandman-1 avatar Jan 01 '23 23:01 Sandman-1

The function NetworkTFs() should return a sparse matrix with TFs a colnames, if this is not the case there is a chance something went wrong earlier in the workflow. What did you pass as motif_tfs to find_motifs()?

joschif avatar Jan 06 '23 15:01 joschif