Giter Site home page Giter Site logo

xinhe-lab / gsfa Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 1.0 1.35 MB

R package that performs sparse factor analysis and differential gene expression discovery simultaneously on single-cell CRISPR screening data.

Home Page: https://xinhe-lab.github.io/GSFA/

License: MIT License

R 30.43% C++ 66.31% C 2.80% Dockerfile 0.45%
single-cell crispr-screen-analysis scrna-seq-analysis factor-analysis differential-expression-analysis

gsfa's People

Contributors

gradonion avatar kevinlkx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kevinlkx

gsfa's Issues

Install problem

Hi, I have a problem with my Ubuntu system after trying to install GSFA with docker.
Actually, It doesn't work, (devtool install also didn't work)
My computer cannot reboot anymore with a broken GNOME display manager.
How can I fix this problem?
Please let me know if you have any ideas!

Determining prior parameters

Dear,

I am trying your software on my own dataset. I have around 29000 cells in which in total around 16000 genes are detected. Moreover, there are 65 genes that are perturbed. What is the best way to determine the prior parameters for fit0? In my last execution I used prior_beta_s = 20 (and the others as specified in the vignette), but I still have a lot of genes with lsfr equal to 0, which makes it hard to identify the real impact..

Thank you in advance!

dotplot_beta_PIP not work

code of https://xinhe-lab.github.io/GSFA_paper/gsfa_result_interpret_LUHMES.html

dotplot_beta_PIP(t(gibbs_PM$Gamma_pm), t(gibbs_PM$beta_pm),
marker_names = KO_names,
reorder_markers = c(KO_names[KO_names!="Nontargeting"], "Nontargeting"),
inverse_factors = F

  • )
    Error in dotplot_beta_PIP(t(gibbs_PM$Gamma_pm), t(gibbs_PM$beta_pm), marker_names = KO_names, :
    unused arguments (marker_names = KO_names, reorder_markers = c(KO_names[KO_names != "Nontargeting"], "Nontargeting"), inverse_factors = F)

speed up the deviance_residual_transform

mydeviance_residual_transform <- function(count_mat){
resid_mat <- matrix(nrow = nrow(count_mat), ncol = ncol(count_mat))
#row is cell,coll is gene
row_sum <- rowSums(count_mat) #每个细胞总read
col_sum <- colSums(count_mat) #每个基因总read
total_sum <- sum(count_mat)

for (i in 1:nrow(count_mat)){
U_i <- row_sum[i]col_sum/total_sum
cross_prod <- 2
count_mat[i,]log((count_mat[i,]+1e-6)/(U_i+1e-6)) + 2(row_sum[i] - count_mat[i,])*log((row_sum[i]-count_mat[i,])/(row_sum[i]-U_i))
l <- sign(count_mat[i,]-U_i) * sqrt(cross_prod)
resid_mat[i, ] <- l
}
return(resid_mat)
}

dev_res <- mydeviance_residual_transform(t(as.matrix(combined_obj@assays$RNA@counts[1:1000,1:1000])))
dev_res2 <- deviance_residual_transform(t(as.matrix(combined_obj@assays$RNA@counts[1:1000,1:1000])))

max(dev_res -dev_res2)
[1] 1.856293e-13

Error with fit_gsfa_multivar due to large matrix size: ARMA_64BIT_WORD issue

Thank you for providing such a valuable package.

I am eager to utilize it with my own data, but I am encountering an error when executing 'fit_gsfa_multivar'. I suspect that the large number of cells in my dataset might be causing the issue.

Here are the specifics:

$ dim(scaled.gene_exp)
[1] 93281 13025
$ dim(G_mat)
[1] 93281   109
$ iter_num
[1] 20
$ fit0 <- fit_gsfa_multivar(Y = scaled.gene_exp, G = G_mat, 
                          K = 50, init.method = "svd",
                          prior_w_s = 50, prior_w_r = 0.2,
                          prior_beta_s = 20, prior_beta_r = 0.2,
                          niter = iter_num, used_niter = iter_num/2,
                          verbose = T, return_samples = T)
Initializing Z and W with SVD.
Error: Mat::init(): requested size is too large; suggest to enable ARMA_64BIT_WORD

I understand from the error that due to the large number of cells, a 32-bit representation might not suffice, and a 64-bit representation is required. I am currently analyzing the data without limiting it to highly variable genes and excluding only low-expressed genes. However, even when I limit the number of genes, I encounter the same error, leading me to believe this isn't the core issue.

Believing that the lack of support for ARMA_64BIT_WORD might be the problem, I tried:
・Modifying the compile options of Armadillo to enable ARMA_64BIT_WORD.
・Modifying the compile options of RcppArmadillo to enable ARMA_64BIT_WORD.

Despite these changes and reinstalling GSFA, I still face the same error. Would you happen to have any suggestions or solutions to this problem? I understand you might be busy, but any guidance would be greatly appreciated.

Thank you in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.