Skip to content

Latest commit

 

History

History
25 lines (24 loc) · 648 Bytes

BioConductor.md

File metadata and controls

25 lines (24 loc) · 648 Bytes

import bigwig files and extract coverage in a Grange obj;

  • import as RLeList:
bw.files.list <- BigWigFileList(bw.files)
lapply(bw.files.list, function(bw){
    bw.rle <- import(bw, as = 'RleList')[[chrm]]
    as.vector(Views(bw.rle, ranges(g.intv))[[1]])
})
  • import selected region:
sapply(bw.files.list, function(bw){
    bw <- import(bw, which = g.intv)
    bw.cov <- coverage(keepSeqlevels(bw, chrm), weight = 'score')
    as.vector(Views(bw.cov[[1]], ranges(g.intv))[[1]])
})

convert Rle-factor to character

# try
as.character(seqnames(g.intv)[1])
# isntread of
as.character(runValue(seqnames(g.intv))[1])