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

Issues running with current version of pySCENIC #16

Open
rossinerbe opened this issue Jun 29, 2022 · 0 comments
Open

Issues running with current version of pySCENIC #16

rossinerbe opened this issue Jun 29, 2022 · 0 comments

Comments

@rossinerbe
Copy link

Hi, I had to fix some problems that arose when running domino with the current release version of pySCENIC and I just wanted to let you know for reference.

One thing was that the regulons.csv output file appears to have changed. In create_domino it uses

tf_targets = list()
for(row in 1:nrow(df)){
    tf = df[row,1]
    tf_genes = df[row,10]
    tf_genes = gsub("[\\(']", "", 
        regmatches(tf_genes, gregexpr("\\('.*?'", tf_genes))[[1]])
    tf_targets[[tf]] = unique(c(tf_targets[[tf]], tf_genes))
}

to read in the results of the file, but the tf targets appear to have migrated into column 9, instead of 10. This lead to no tf targets being returned. Keeping the column names from the .csv file instead of hard coding the column number could potentially resolve this across multiple versions.

The other issue I encountered with create_domino was matching the genes to receptors. I was using mouse, so only the first letter of the gene name is conventionally capitalized versus the receptors which are capitalized on all letters. This leads to no receptor-gene matches being returned here,
ser_receptors = intersect(names(keeps), all_receptors)
here,
module_rec_targets = intersect(module_targets, ser_receptors)
and here:
keep_id = which(dom@counts[rec,] > 0)
Including a warning if none of the receptors match the genes or checking in a case agnostic manner would make this issue a lot easier to track down.

The same gene case problem arose with build_domino which was again somewhat difficult to fix because there was no check or warning message for no matching genes to receptors in:

for(clust in levels(dom@clusters)){
            inc_ligs = clust_ligs[[clust]]
            inc_ligs = intersect(inc_ligs, rownames(dom@z_scores))_
            if(length(inc_ligs) == 1){inc_ligs = numeric(0)}
            cl_sig_mat = matrix(0, ncol = length(levels(dom@clusters)), 
                nrow = length(inc_ligs))
            colnames(cl_sig_mat) = colnames(signaling)
            rownames(cl_sig_mat) = inc_ligs
            for(c2 in levels(dom@clusters)){
                n_cell = length(which(dom@clusters == c2))
                if(n_cell > 1){
                    sig = rowMeans(dom@z_scores[inc_ligs, 
                        which(dom@clusters == c2)])
                } else if(n_cell == 1){
                    sig = dom@z_scores[inc_ligs, which(dom@clusters == c2)]
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