Commit 89c44907 authored by Rauschenberger's avatar Rauschenberger
Browse files

automation

parent efbd375a
...@@ -80,16 +80,19 @@ get.snps.geuvadis <- function(chr,path=getwd()){ ...@@ -80,16 +80,19 @@ get.snps.geuvadis <- function(chr,path=getwd()){
#' @param path #' @param path
#' data directory #' data directory
#' #'
#' @param size
#' maximum number of SNPs to read in at once
#'
#' @examples #' @examples
#' path <- "/virdir/Scratch/arauschenberger/trial" #' path <- "/virdir/Scratch/arauschenberger/trial"
#' #'
get.snps.bbmri <- function(chr,biobank=NULL,path=getwd()){ get.snps.bbmri <- function(chr,biobank=NULL,path=getwd(),size=500*10^3){
start <- Sys.time() start <- Sys.time()
message(rep("-",times=20)," chromosome ",chr," ",rep("-",times=20)) message(rep("-",times=20)," chromosome ",chr," ",rep("-",times=20))
p <- 5*10^6 # (maximum number of SNPs per chromosome, before filtering) p <- 5*10^6 # (maximum number of SNPs per chromosome, before filtering)
size <- 60*10^3 # (originally 100*10^3, decrease: slower but less memory) # size <- 60*10^3 # (originally 100*10^3, decrease: slower but less memory)
skip <- seq(from=0,to=p,by=size) skip <- seq(from=0,to=p,by=size)
if(is.null(biobank)){ if(is.null(biobank)){
study <- c("CODAM","LL","LLS0","LLS1","NTR0","NTR1","PAN","RS") study <- c("CODAM","LL","LLS0","LLS1","NTR0","NTR1","PAN","RS")
...@@ -251,7 +254,8 @@ get.exons.bbmri <- function(path=getwd()){ ...@@ -251,7 +254,8 @@ get.exons.bbmri <- function(path=getwd()){
# (3) removing identifiers without SNP data # (3) removing identifiers without SNP data
# (4) translating identifiers # (4) translating identifiers
utils::data(rnaSeqData_ReadCounts_BIOS_cleaned,package="BBMRIomics") # (1) utils::data(rnaSeqData_ReadCounts_BIOS_cleaned,package="BBMRIomics") # (1)
cd <- SummarizedExperiment::colData(counts)[,c("biobank_id","imputation_id","run_id")]; rm(counts) # (2) cd <- SummarizedExperiment::colData(counts)[,c("biobank_id","imputation_id","run_id")] # (2)
counts <- NULL
names(cd) <- substr(names(cd),start=1,stop=3) # abbreviate names names(cd) <- substr(names(cd),start=1,stop=3) # abbreviate names
cd <- cd[!is.na(cd$imp),] # (3) cd <- cd[!is.na(cd$imp),] # (3)
cd$id <- NA # (4) cd$id <- NA # (4)
......
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
</div> </div>
<pre class="usage"><span class='fu'>get.snps.bbmri</span>(<span class='no'>chr</span>, <span class='kw'>biobank</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>path</span> <span class='kw'>=</span> <span class='fu'>getwd</span>())</pre> <pre class="usage"><span class='fu'>get.snps.bbmri</span>(<span class='no'>chr</span>, <span class='kw'>biobank</span> <span class='kw'>=</span> <span class='kw'>NULL</span>, <span class='kw'>path</span> <span class='kw'>=</span> <span class='fu'>getwd</span>(), <span class='kw'>size</span> <span class='kw'>=</span> <span class='fl'>500</span> * <span class='fl'>10</span>^<span class='fl'>3</span>)</pre>
<h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2> <h2 class="hasAnchor" id="arguments"><a class="anchor" href="#arguments"></a>Arguments</h2>
<table class="ref-arguments"> <table class="ref-arguments">
...@@ -137,6 +137,10 @@ ...@@ -137,6 +137,10 @@
<th>path</th> <th>path</th>
<td><p>data directory</p></td> <td><p>data directory</p></td>
</tr> </tr>
<tr>
<th>size</th>
<td><p>maximum number of SNPs to read in at once</p></td>
</tr>
</table> </table>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
\alias{get.snps.bbmri} \alias{get.snps.bbmri}
\title{Get SNP data (BBMRI)} \title{Get SNP data (BBMRI)}
\usage{ \usage{
get.snps.bbmri(chr, biobank = NULL, path = getwd()) get.snps.bbmri(chr, biobank = NULL, path = getwd(), size = 500 * 10^3)
} }
\arguments{ \arguments{
\item{chr}{chromosome: integer \eqn{1-22}} \item{chr}{chromosome: integer \eqn{1-22}}
...@@ -12,6 +12,8 @@ get.snps.bbmri(chr, biobank = NULL, path = getwd()) ...@@ -12,6 +12,8 @@ get.snps.bbmri(chr, biobank = NULL, path = getwd())
\item{biobank}{character "CODAM", "LL", "LLS", "NTR", "PAN", "RS", or NULL (all)} \item{biobank}{character "CODAM", "LL", "LLS", "NTR", "PAN", "RS", or NULL (all)}
\item{path}{data directory} \item{path}{data directory}
\item{size}{maximum number of SNPs to read in at once}
} }
\description{ \description{
This function transforms SNP data (virtual machine). This function transforms SNP data (virtual machine).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment