lianos / sparrow Goto Github PK
View Code? Open in Web Editor NEWTake command of your set enrichment analyses.
Home Page: https://lianos.github.io/sparrow/
License: MIT License
Take command of your set enrichment analyses.
Home Page: https://lianos.github.io/sparrow/
License: MIT License
Dear maintainer, thank you for making this delightful package. I am trying to use it to perform an enrichment analysis using fits derived from a pseudobulk analysis, and am catching an error:
sparrow::seas(gsd = gsdb, x = metadata(fits.risk[[x]])$v,
design = metadata(fits.risk[[x]])$fit$design, contrast = metadata(fits.risk[[x]])$fit$contrasts[,"Risk_genotypeTRUE"],
methods = c('camera', 'fgsea'), feature.max.padj = 0.001)
Warning in .local(x, ...) :
Deactivating 140 gene sets because conformation of GeneSetDb to the target creates gene sets smaller than 2 or greater than Inf
Error in calculateIndividualLogFC(x, design, contrast, treat.lfc = treat.lfc, :
Assertion on 'contrast' failed: Must have length <= 4, but has length 5.
>
> x <- 'ATL'
> metadata(fits.risk[[x]])$fit$design
(Intercept) CohortMCD SexMale eGFR_Bx Risk_genotypeTRUE
1 1 0 1 101.727 1
2 1 1 1 23.285 1
3 1 0 0 107.653 0
4 1 1 0 78.557 0
5 1 0 1 68.520 1
6 1 0 0 64.046 0
7 1 0 1 84.839 0
8 1 1 1 61.602 0
9 1 0 1 33.666 0
10 1 0 1 19.367 1
11 1 0 1 21.972 1
12 1 1 0 80.348 0
13 1 0 1 112.467 0
14 1 0 1 57.139 1
15 1 1 1 149.864 0
16 1 0 1 114.610 1
17 1 1 0 90.385 0
18 1 0 1 79.794 1
19 1 0 1 96.773 0
attr(,"assign")
[1] 0 1 2 3 4
attr(,"contrasts")
attr(,"contrasts")$Cohort
[1] "contr.treatment"
attr(,"contrasts")$Sex
[1] "contr.treatment"
attr(,"contrasts")$Risk_genotype
[1] "contr.treatment"
> metadata(fits.risk[[x]])$fit$contrasts[,"Risk_genotypeTRUE"]
Intercept CohortMCD SexMale eGFR_Bx Risk_genotypeTRUE
0 0 0 0 1
Can you please help me understand this error message? Kindest Regards.
Hi Steve,
Many thanks for creating such a great package :)!
Would it be possible to make sparrow::corplot
returning data (i.e. E
) instead of invisible(NULL)
. I found the need for it while using the sparrow::corplot
with cluster = TRUE
and not being able to get the order of the genes.
Best,
Arek
As of Sept 2022, MSigDB is officially providing mouse geneset collections (MH, M1, M2, M3, M5, M8).
Let's ensure this plays nicely with the getMSigGeneSetDb
and getMSigCollection
functions.
This function is really polymorphic over x
, so this should come first.
The current function signature is:
seas <- function(gdb, x, design, contrast, ...)
but should really by
seas <- function(x, gdb, design = NULL, contrast = NULL, ...)
Let's bite this bullet before we release this into the wild.
t.stat <- sign(qlf$table$logFC) * sqrt(qlf$table$F)
z <- zscoreT(t.stat, df=qlf$df.total)
Dear maintainer, thank you for making this delightful package. I am trying to use it to perform an enrichment analysis using fits derived from a pseudobulk analysis, and am catching an error:
sparrow::seas(gsd = gsdb, x = metadata(fits.risk[[x]])$v$E,
design = metadata(fits.risk[[x]])$fit$design, contrast = metadata(fits.risk[[x]])$fit$contrasts[,"Risk_genotypeTRUE"],
methods = c('camera', 'fgsea'), feature.max.padj = 0.001)
Warning in .local(x, ...) :
Deactivating 140 gene sets because conformation of GeneSetDb to the target creates gene sets smaller than 2 or greater than Inf
Error in calculateIndividualLogFC(x, design, contrast, treat.lfc = treat.lfc, :
Assertion on 'contrast' failed: Must have length <= 4, but has length 5.
>
> x <- 'ATL'
> metadata(fits.risk[[x]])$fit$design
(Intercept) CohortMCD SexMale eGFR_Bx Risk_genotypeTRUE
1 1 0 1 101.727 1
2 1 1 1 23.285 1
3 1 0 0 107.653 0
4 1 1 0 78.557 0
5 1 0 1 68.520 1
6 1 0 0 64.046 0
7 1 0 1 84.839 0
8 1 1 1 61.602 0
9 1 0 1 33.666 0
10 1 0 1 19.367 1
11 1 0 1 21.972 1
12 1 1 0 80.348 0
13 1 0 1 112.467 0
14 1 0 1 57.139 1
15 1 1 1 149.864 0
16 1 0 1 114.610 1
17 1 1 0 90.385 0
18 1 0 1 79.794 1
19 1 0 1 96.773 0
attr(,"assign")
[1] 0 1 2 3 4
attr(,"contrasts")
attr(,"contrasts")$Cohort
[1] "contr.treatment"
attr(,"contrasts")$Sex
[1] "contr.treatment"
attr(,"contrasts")$Risk_genotype
[1] "contr.treatment"
> metadata(fits.risk[[x]])$fit$contrasts[,"Risk_genotypeTRUE"]
Intercept CohortMCD SexMale eGFR_Bx Risk_genotypeTRUE
0 0 0 0 1
Can you please help me understand this error message? Kindest Regards.
We previously included species and identifier maps in this package for this function to work, but since {babelgene} (which powers {msigdbr}) is now a dependency, let's use that.
Note the original function was called remap_identifiers
, but since we're using camel case here, we're going with convertIdentifiers
(and "converting" is more what we are doing, not remaping (I guess? ... who knows ...))
Just like issue #5, this function is really polymorphic over x
and not the GeneSetDb, so x
should come first.
The select_by, group_by, and bias_by were added so we can tweak how ora
was run through the seas()
wrapper, but those parameters aren't used in the seas()
function itself. Fix that!
A thin wrapper function implemented in gCrisprTools fails when invoking the seas
command:
It's not too hard to rename collections by manipulating the internal data.tables, let's do that.
This code snippet renames a "C7"
collection to "ImmuneSigDb"
in a GeneSetDb gdb
object:
gdb@db[collection == "C7", collection := "ImmuneSigDb"]
setkeyv(gdb@db, c("collection", "name", "feature_id"))
gdb@table[collection == "C7", collection := "ImmuneSigDb"]
setkeyv(gdb@table, c("collection", "name"))
gdb@collectionMetadata[collection == "C7", collection := "ImmuneSigDb"]
setkeyv(gdb@collectionMetadata, c("collection", "name"))
The function signature might look like:
renameCollection <- function(gdb, rename, ...) {
}
with rename
being a named character vector with names()
being the current name of the collection, and its values are the new collection names you want to rename them to.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.