Skip to content

Instantly share code, notes, and snippets.

View lcolladotor's full-sized avatar

Leonardo Collado-Torres lcolladotor

View GitHub Profile
hola
===
asfd
```{r}
print('hola')
x <- 1
x
## Fix as best as possible the bug in calculatePvalues() regarding the default
## maxRegionGap value.
## Usage:
# Step 1: open R in the main results folder
# Step 2: use fixChrs() with options of your choice
# fixChrs('chr')
## Alternatively use fixRegions() manually and re-run
## bumphunter::annotateNearest()
## Visualizing the error
## Modified from https://github.com/lcolladotor/derfinderPlot/blob/master/tests/testthat/test_adv-plotCluster.R
library('derfinder')
## Collapse the coverage information
collapsedFull <- collapseFullCoverage(list(genomeDataRaw), verbose=TRUE)
## Calculate library size adjustments
sampleDepths <- sampleDepth(collapsedFull, probs=c(0.5), nonzero=TRUE,
> ## Visualizing the error
> ## Modified from https://github.com/lcolladotor/derfinderPlot/blob/master/tests/testthat/test_adv-plotCluster.R
>
> library('derfinder')
>
> ## Collapse the coverage information
> collapsedFull <- collapseFullCoverage(list(genomeDataRaw), verbose=TRUE)
2014-11-22 17:38:06 collapseFullCoverage: Sorting fullCov
2014-11-22 17:38:06 collapseFullCoverage: Collapsing chromosomes information by sample
>
---
title: "test"
output: pdf_document
---
This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>.
When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
```{r}
$ R
R version 3.1.1 Patched (2014-10-16 r66782) -- "Sock it to Me"
Copyright (C) 2014 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
> 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,
library('derfinder')
library('BiocParallel')
## Check that the cluster is correctly defined
## Aka, that it's a MulticoreParam class instead of the default SnowParam
x <- derfinder:::.define_cluster(BPPARAM.custom = MulticoreParam(workers = 2))
x
## Collapse the coverage information
collapsedFull <- collapseFullCoverage(list(genomeData$coverage),
library('BiocParallel')
## Run bplapply example code with MulticoreParam
system.time(result <- bplapply(1:10, function(v) {
message("working") ## 10 tasks
sqrt(v)
}, BPPARAM = MulticoreParam(workers = 2)))
result[[1]]
## Run bplapply example code with SnowParam
> x <- parallel::mclapply(1:10, sqrt)
> cl <- parallel::makeCluster(10, "PSOCK")
Loading required package: colorout
Loading required package: colorout
Loading required package: colorout
Loading required package: colorout
Loading required package: colorout
Loading required package: colorout
Loading required package: colorout
Loading required package: colorout