data-raw/DATASET.R

## code to prepare `DATASET` dataset goes here

library(GenomicRanges)
library(usethis)

# Downloading blacklist

ce10.blacklist <- rtracklayer::import(rtracklayer::BEDFile('https://github.com/Boyle-Lab/Blacklist/raw/master/lists/ce10-blacklist.v2.bed.gz'))
ce11.blacklist <- rtracklayer::import(rtracklayer::BEDFile('https://github.com/Boyle-Lab/Blacklist/raw/master/lists/ce11-blacklist.v2.bed.gz'))

dm3.blacklist <- rtracklayer::import(rtracklayer::BEDFile('https://github.com/Boyle-Lab/Blacklist/raw/master/lists/dm3-blacklist.v2.bed.gz'))
dm6.blacklist <- rtracklayer::import(rtracklayer::BEDFile('https://github.com/Boyle-Lab/Blacklist/raw/master/lists/dm6-blacklist.v2.bed.gz'))

hg19.blacklist <- rtracklayer::import(rtracklayer::BEDFile('https://github.com/Boyle-Lab/Blacklist/raw/master/lists/hg19-blacklist.v2.bed.gz'))
hg38.blacklist <- rtracklayer::import(rtracklayer::BEDFile('https://github.com/Boyle-Lab/Blacklist/raw/master/lists/hg38-blacklist.v2.bed.gz'))

mm10.blacklist <- rtracklayer::import(rtracklayer::BEDFile('https://github.com/Boyle-Lab/Blacklist/raw/master/lists/mm10-blacklist.v2.bed.gz'))

# Setting up the genomes

ce10.genome <- GenomeInfoDb::Seqinfo(genome='ce10')

dm3.genome <- GenomeInfoDb::Seqinfo(genome='dm3')

hg19.genome <- GenomeInfoDb::Seqinfo(genome='hg19')
hg38.genome <- GenomeInfoDb::Seqinfo(genome='hg38')

mm10.genome <- GenomeInfoDb::Seqinfo(genome='mm10')

# Gap tracks

session <- rtracklayer::browserSession()

for(i in c('dm3','dm6','hg19','hg38','mm10')){
    cat(i,'\n')
    GenomeInfoDb::genome(session) <- i
    assign(paste0(i,'.gap'),GenomicRanges::makeGRangesFromDataFrame(
        rtracklayer::getTable(rtracklayer::ucscTableQuery(session,table="gap")),
        starts.in.df.are.0based = TRUE))
}

# Output
usethis::use_data(ce10.blacklist,ce11.blacklist,
                  dm3.blacklist,dm6.blacklist,
                  hg19.blacklist,hg38.blacklist,
                  mm10.blacklist,
                  ce10.genome,dm3.genome,hg19.genome,hg38.genome,mm10.genome,
                  dm3.gap,dm6.gap,hg19.gap,hg38.gap,mm10.gap,
                  internal = TRUE,compress = 'xz',overwrite = T)

usethis::use_data("DATASET")
plbaldoni/scChIPseqsim documentation built on June 11, 2020, 7:41 p.m.