Giter Club home page Giter Club logo

Comments (2)

nsheff avatar nsheff commented on July 24, 2024

Hi, thanks for the interest.

Try this:

LOLA/R/LOLA.R

Lines 163 to 178 in 8262ff5

#' If you want to test for differential enrichment within
#' your usersets, you can restrict the universe to only
#' regions that are covered in at least one of your sets.
#' This function helps you build just such a restricted
#' universe
#'
#' @param userSets The userSets you will pass to the enrichment calculation.
#' @return A restricted universe
#' @export
#' @examples
#' data("sample_input", package="LOLA") # load userSets
#' restrictedUniverse = buildRestrictedUniverse(userSets)
buildRestrictedUniverse = function(userSets) {
disjoin(unlist(userSets))
}

then just proceed as normal with that restricted universe as the universe you provide to LOLA.

from lola.

AdrijaK avatar AdrijaK commented on July 24, 2024

Thanks,

Is this the correct way to use it?

# get the example data:
dbPath = system.file("extdata", "hg19", package="LOLA")
regionDB = loadRegionDB(dbLocation=dbPath)
data("sample_universe", package="LOLA")
data("sample_input", package="LOLA")
getRegionSet(regionDB, collections="ucsc_example", filenames="vistaEnhancers.bed")
getRegionSet(dbPath, collections="ucsc_example", filenames="vistaEnhancers.bed")
getRegionFile(dbPath, collections="ucsc_example", filenames="vistaEnhancers.bed")

# convert userSets to GRangesList
userSets = as(userSets, "GRangesList")

# redefine universe for enabling differential enrichment calculations between two test sets stored in userSets
universeRedefined = buildRestrictedUniverse(userSets)

# redefine userSets for a more appropriate statistical enrichment comparison
userSetsRedefined = redefineUserSets(userSets, universeRedefined )

# calculate enrichments with LOLA
resRedefined = runLOLA(userSetsRedefined, universeRedefined, regionDB, cores=1)

Calculating unit set overlaps...
Calculating universe set overlaps...
Calculating Fisher scores...

resRedefined:

|userSet | dbSet|collection   |   pValueLog| oddsRatio| support| rnkPV| rnkOR| rnkSup| maxRnk| meanRnk|    b|    c|    d|description                      |cellType |tissue |antibody |treatment |dataSource |filename                    |    qValue|  size|
|:-------|-----:|:------------|-----------:|---------:|-------:|-----:|-----:|------:|------:|-------:|----:|----:|----:|:--------------------------------|:--------|:------|:--------|:---------|:----------|:---------------------------|---------:|-----:|
|setA    |     2|ucsc_example | 100.1529890| 3.2929780|    1062|     1|     3|      2|      3|    2.00|  579| 2510| 4507|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |laminB1Lads.bed             | 0.0000000|  1302|
|setB    |     1|ucsc_example |  64.4426074| 6.5896984|    5766|     1|     1|      1|      1|    1.00| 2516|   97|  279|CpG islands from UCSC annotation |NA       |NA     |NA       |NA        |NA         |cpgIslandExt.bed            | 0.0000000| 28691|
|setA    |     4|ucsc_example |  19.0468632| 3.7602194|     151|     2|     1|      3|      3|    2.00|   59| 3421| 5027|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |vistaEnhancers.bed          | 0.0000000|  1339|
|setA    |     5|ucsc_example |  19.0468632| 3.7602194|     151|     2|     1|      3|      3|    2.00|   59| 3421| 5027|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |vistaEnhancers_colNames.bed | 0.0000000|  1340|
|setA    |     3|ucsc_example |   1.1644597| 2.8515119|       8|     4|     4|      5|      5|    4.33|    4| 3564| 5082|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |numtSAssembled.bed          | 0.1369526|    78|
|setB    |     3|ucsc_example |   0.0012998| 0.2378840|       4|     2|     5|      5|      5|    4.00|    8| 5859| 2787|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |numtSAssembled.bed          | 1.0000000|    78|
|setB    |     2|ucsc_example |   0.0000000| 0.4720576|     880|     3|     2|      2|      3|    2.33|  761| 4983| 2034|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |laminB1Lads.bed             | 1.0000000|  1302|
|setB    |     4|ucsc_example |   0.0000000| 0.2836386|      80|     3|     3|      3|      3|    3.00|  130| 5783| 2665|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |vistaEnhancers.bed          | 1.0000000|  1339|
|setB    |     5|ucsc_example |   0.0000000| 0.2836386|      80|     3|     3|      3|      3|    3.00|  130| 5783| 2665|ucsc_example                     |NA       |NA     |NA       |NA        |NA         |vistaEnhancers_colNames.bed | 1.0000000|  1340|
|setA    |     1|ucsc_example |   0.0000000| 0.1769031|    3276|     5|     5|      1|      5|    3.67| 5006|  296|   80|CpG islands from UCSC annotation |NA       |NA     |NA       |NA        |NA         |cpgIslandExt.bed            | 1.0000000| 28691|

from lola.

Related Issues (20)

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.