jaleesr / BITFAM

BITFAM is a Bayesian approach and platform to infer transcription factor activities within individual cells using single cell RNA-sequencing data. Please see Gao S et al., Genome Research (2021) https://genome.cshlp.org/content/31/7/1296 for details.
31 stars 16 forks source link

BITFAM_weights #10

Closed jziggles closed 1 year ago

jziggles commented 1 year ago

Hello - another question for you. I have not been able to use the BITFAM_weights function. I can use the same BITFAM list normally for BITFAM_activities but it throws an error when using BITFAM_weights. Please advise, thanks!

Z <- BITFAM_activities(BITFAM_res) bw = BITFAM_weights(BITFAM_res) Error in extract(BITFAM_list$Model, result, "W") : object 'result' not found

jziggles commented 1 year ago

Hello - just following up on this. Thank you.

sgao30 commented 1 year ago

Hi,

The weight function had a bug. I believed we have fixed it one or two months ago. Could you please reinstall BITFAM and run the weight function? Or you can use the function below:

BITFAM_weights <- function(BITFAM_list){ result_matrix <- apply(extract(BITFAM_list$Model,"W")[[1]], c(2,3), mean) rownames(result_matrix) <- BITFAM_list$Genes colnames(result_matrix) <- BITFAM_list$TF_used return(result_matrix) }

Best wishes, Shang