Commit db8d7591 authored by Rauschenberger's avatar Rauschenberger
Browse files

automation

parent 89c44907
......@@ -81,7 +81,8 @@ get.snps.geuvadis <- function(chr,path=getwd()){
#' data directory
#'
#' @param size
#' maximum number of SNPs to read in at once
#' maximum number of SNPs to read in at once;
#' trade-off between memory usage (low) and speed (high)
#'
#' @examples
#' path <- "/virdir/Scratch/arauschenberger/trial"
......@@ -92,7 +93,6 @@ get.snps.bbmri <- function(chr,biobank=NULL,path=getwd(),size=500*10^3){
message(rep("-",times=20)," chromosome ",chr," ",rep("-",times=20))
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)
skip <- seq(from=0,to=p,by=size)
if(is.null(biobank)){
study <- c("CODAM","LL","LLS0","LLS1","NTR0","NTR1","PAN","RS")
......@@ -120,7 +120,7 @@ get.snps.bbmri <- function(chr,biobank=NULL,path=getwd(),size=500*10^3){
if(study[j]=="NTR0"){dir <- "NTR/Affy6"}
if(study[j]=="NTR1"){dir <- "NTR/GoNL"}
path0 <- file.path("/mnt/virdir/Backup/RP3_data/HRCv1.1_Imputation",dir)
path1 <- "/virdir/Scratch/arauschenberger/trial"
path1 <- path
file0 <- paste0("chr",chr,".dose.vcf.gz")
file1 <- paste0(study[j],".chr",chr,".dose.vcf.gz")
file2 <- paste0(study[j],".chr",chr,".dose.vcf")
......@@ -169,7 +169,7 @@ get.snps.bbmri <- function(chr,biobank=NULL,path=getwd(),size=500*10^3){
# Removing empty rows.
cond <- apply(collect,1,function(x) all(sapply(x,length)==0))
collect <- collect[!cond,,drop=FALSE]
save(object=collect,file=file.path(path1,paste0("temp.chr",chr,".RData")))
#save(object=collect,file=file.path(path1,paste0("temp.chr",chr,".RData")))
#load(file.path(path1,paste0("temp.chr",chr,".RData")))
# Fusing all matrices.
......@@ -190,19 +190,20 @@ get.snps.bbmri <- function(chr,biobank=NULL,path=getwd(),size=500*10^3){
# Filter samples.
rownames(snps) <- sub(x=rownames(snps),pattern="LLS0|LLS1",replacement="LLS")
rownames(snps) <- sub(x=rownames(snps),pattern="NTR0|NTR1",replacement="NTR")
#split <- strsplit(x=colnames(snps),split=":")
#bio <- sapply(split,function(x) x[[1]])
#id <- sapply(split,function(x) x[[2]])
#cond <- rep(NA,times=ncol(snps))
#for(j in seq_along(study)){
# cond[bio==study[j]] <- duplicated(id[bio==study[j]])
#}
if(is.null(biobank)){
save(object=snps,file=file.path(path1,paste0("BBMRI.chr",chr,".RData")))
} else {
save(object=snps,file=file.path(path1,paste0(biobank,".chr",chr,".RData")))
}
# Remove temporary files.
for(j in seq_along(study)){
file1 <- paste0(study[j],".chr",chr,".dose.vcf.gz")
file2 <- paste0(study[j],".chr",chr,".dose.vcf")
file.remove(file.path(path1,c(file1,file2)))
}
}
......@@ -605,7 +606,7 @@ map.snps <- function(gene.chr,gene.start,gene.end,snp.chr,snp.pos,dist=10^3){
#' @export
#' @title
#' Drop trivial test
#' Drop trivial tests
#'
#' @description
#' This function
......
......@@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Drop trivial test — drop.trivial • spliceQTL</title>
<title>Drop trivial tests — drop.trivial • spliceQTL</title>
<!-- jquery -->
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script>
......@@ -28,7 +28,7 @@
<meta property="og:title" content="Drop trivial test — drop.trivial" />
<meta property="og:title" content="Drop trivial tests — drop.trivial" />
<meta property="og:description" content="This function" />
<meta name="twitter:card" content="summary" />
......@@ -109,7 +109,7 @@
<div class="row">
<div class="col-md-9 contents">
<div class="page-header">
<h1>Drop trivial test</h1>
<h1>Drop trivial tests</h1>
<small class="dont-index">Source: <a href='https://github.com/rauschenberger/spliceQTL/blob/master/R/functions.R'><code>R/functions.R</code></a></small>
<div class="hidden name"><code>drop.trivial.Rd</code></div>
</div>
......
......@@ -139,7 +139,8 @@
</tr>
<tr>
<th>size</th>
<td><p>maximum number of SNPs to read in at once</p></td>
<td><p>maximum number of SNPs to read in at once;
trade-off between memory usage (low) and speed (high)</p></td>
</tr>
</table>
......
......@@ -176,7 +176,7 @@
<td>
<p><code><a href="drop.trivial.html">drop.trivial()</a></code> </p>
</td>
<td><p>Drop trivial test</p></td>
<td><p>Drop trivial tests</p></td>
</tr><tr>
<!-- -->
<td>
......
......@@ -2,7 +2,7 @@
% Please edit documentation in R/functions.R
\name{drop.trivial}
\alias{drop.trivial}
\title{Drop trivial test}
\title{Drop trivial tests}
\usage{
drop.trivial(map)
}
......
......@@ -13,7 +13,8 @@ get.snps.bbmri(chr, biobank = NULL, path = getwd(), size = 500 * 10^3)
\item{path}{data directory}
\item{size}{maximum number of SNPs to read in at once}
\item{size}{maximum number of SNPs to read in at once;
trade-off between memory usage (low) and speed (high)}
}
\description{
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