Created
May 19, 2015 18:50
-
-
Save lcolladotor/a0eafc335a2738de42f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library('GenomicRanges') | |
library('derfinderData') | |
library('rtracklayer') | |
library('devtools') | |
## Find some bigwigs | |
bw <- dir(system.file('extdata', 'A1C', package = 'derfinderData'), full.names = TRUE) | |
## Regions to import | |
gr <- GRanges(c('chr21', 'chr21'), IRanges(c(9481564, 9963234), width = 1000)) | |
## Import one | |
( import(BigWigFile(bw[1]), selection = gr[1]) ) | |
( import(BigWigFile(bw[1]), selection = gr[1], as = 'NumericList') ) | |
## Now import with 2 ranges | |
( import(BigWigFile(bw[1]), selection = gr) ) | |
( import(BigWigFile(bw[1]), selection = gr, as = 'NumericList') ) | |
traceback() | |
## Session info | |
options(width = 100) | |
session_info() | |
Sys.time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> library('GenomicRanges') | |
Loading required package: BiocGenerics | |
Loading required package: parallel | |
Attaching package: ‘BiocGenerics’ | |
The following objects are masked from ‘package:parallel’: | |
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, | |
clusterExport, clusterMap, parApply, parCapply, parLapply, | |
parLapplyLB, parRapply, parSapply, parSapplyLB | |
The following object is masked from ‘package:stats’: | |
xtabs | |
The following objects are masked from ‘package:base’: | |
anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, | |
do.call, duplicated, eval, evalq, Filter, Find, get, intersect, | |
is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, | |
pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, | |
rownames, sapply, setdiff, sort, table, tapply, union, unique, | |
unlist, unsplit | |
Loading required package: S4Vectors | |
Loading required package: stats4 | |
Loading required package: IRanges | |
Loading required package: GenomeInfoDb | |
> library('derfinderData') | |
> library('rtracklayer') | |
> library('devtools') | |
> | |
> ## Find some bigwigs | |
> bw <- dir(system.file('extdata', 'A1C', package = 'derfinderData'), full.names = TRUE) | |
> | |
> ## Regions to import | |
> gr <- GRanges(c('chr21', 'chr21'), IRanges(c(9481564, 9963234), width = 1000)) | |
> | |
> ## Import one | |
> ( import(BigWigFile(bw[1]), selection = gr[1]) ) | |
GRanges object with 1 range and 1 metadata column: | |
seqnames ranges strand | score | |
<Rle> <IRanges> <Rle> | <numeric> | |
[1] chr21 [9481565, 9481639] * | 0.0299999993294477 | |
------- | |
seqinfo: 1 sequence from an unspecified genome | |
> ( import(BigWigFile(bw[1]), selection = gr[1], as = 'NumericList') ) | |
NumericList of length 1 | |
[[1]] 0 0.0299999993294477 0.0299999993294477 0.0299999993294477 ... 0 0 0 0 | |
> | |
> ## Now import with 2 ranges | |
> ( import(BigWigFile(bw[1]), selection = gr) ) | |
GRanges object with 2 ranges and 1 metadata column: | |
seqnames ranges strand | score | |
<Rle> <IRanges> <Rle> | <numeric> | |
[1] chr21 [9481565, 9481639] * | 0.0299999993294477 | |
[2] chr21 [9963234, 9963254] * | 0.0700000002980232 | |
------- | |
seqinfo: 1 sequence from an unspecified genome | |
> ( import(BigWigFile(bw[1]), selection = gr, as = 'NumericList') ) | |
Error in .local(con, format, text, ...) : | |
attempt to set index 1/1 in SET_VECTOR_ELT | |
> traceback() | |
4: .Call(BWGFile_query, path.expand(path(con)), as.list(which), | |
identical(colnames(selection), "score"), as == "NumericList") | |
3: .local(con, format, text, ...) | |
2: import(BigWigFile(bw[1]), selection = gr, as = "NumericList") | |
1: import(BigWigFile(bw[1]), selection = gr, as = "NumericList") | |
> | |
> ## Session info | |
> options(width = 100) | |
> session_info() | |
Session info --------------------------------------------------------------------------------------- | |
setting value | |
version R version 3.2.0 Patched (2015-05-18 r68382) | |
system x86_64, darwin10.8.0 | |
ui X11 | |
language (EN) | |
collate en_US.UTF-8 | |
tz America/Detroit | |
Packages ------------------------------------------------------------------------------------------- | |
package * version date source | |
Biobase 2.29.1 2015-05-03 Bioconductor | |
BiocGenerics * 0.15.0 2015-04-17 Bioconductor | |
BiocParallel 1.3.12 2015-05-19 Bioconductor | |
Biostrings 2.37.2 2015-05-07 Bioconductor | |
bitops 1.0-6 2013-08-17 CRAN (R 3.2.0) | |
colorout * 1.0-2 2015-05-19 local | |
derfinderData * 0.103.0 2015-05-19 Bioconductor | |
devtools * 1.8.0 2015-05-09 CRAN (R 3.2.0) | |
digest 0.6.8 2014-12-31 CRAN (R 3.2.0) | |
futile.logger 1.4.1 2015-04-20 CRAN (R 3.2.0) | |
futile.options 1.0.0 2010-04-06 CRAN (R 3.2.0) | |
GenomeInfoDb * 1.5.3 2015-05-13 Bioconductor | |
GenomicAlignments 1.5.9 2015-05-13 Bioconductor | |
GenomicRanges * 1.21.12 2015-05-17 Bioconductor | |
git2r 0.10.1 2015-05-07 CRAN (R 3.2.0) | |
IRanges * 2.3.8 2015-05-02 Bioconductor | |
lambda.r 1.1.7 2015-03-20 CRAN (R 3.2.0) | |
memoise 0.2.1 2014-04-22 CRAN (R 3.2.0) | |
RCurl 1.95-4.6 2015-04-24 CRAN (R 3.2.0) | |
Rsamtools 1.21.5 2015-05-17 Bioconductor | |
rtracklayer * 1.29.5 2015-05-01 Bioconductor | |
rversions 1.0.0 2015-04-22 CRAN (R 3.2.0) | |
S4Vectors * 0.7.2 2015-05-01 Bioconductor | |
SummarizedExperiment 0.1.5 2015-05-17 Bioconductor | |
XML 3.98-1.1 2013-06-20 CRAN (R 3.2.0) | |
XVector 0.9.1 2015-04-30 Bioconductor | |
zlibbioc 1.15.0 2015-04-17 Bioconductor | |
> Sys.time() | |
[1] "2015-05-19 14:48:58 EDT" | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment