forked from knausb/vcfR
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
78 changed files
with
1,287 additions
and
411 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,3 @@ | |
^\.dll$ | ||
cran-comments.md | ||
NEWS.md | ||
pinfsc50.png |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
Package: vcfR | ||
Title: Manipulate and Visualize VCF Data | ||
Description: Facilitates easy manipulation of variant call format (VCF) data. | ||
Functions are provided to rapidly read from and write to VCF files. | ||
Once VCF data is read into R a parser function extracts matrices of data. | ||
This information can then be used for quality control or other purposes. | ||
Additional functions provide visualization of genomic data. | ||
Once processing is complete data may be written to a VCF file (*.vcf.gz). | ||
It also may be converted into other popular R objects (e.g., genlight, DNAbin). | ||
VcfR provides a link between VCF data and familiar R software. | ||
Version: 1.4.0 | ||
Authors@R: c(person(c('Brian', 'J.'), 'Knaus', role = c('cre', 'aut'), | ||
email = '[email protected]'), | ||
person(c('Niklaus', 'J.'), 'Grunwald', role = 'aut', | ||
email = '[email protected]'), | ||
person(c('Eric', 'C.'), 'Anderson', role = 'ctb', | ||
email = '[email protected]'), | ||
person(c('David', 'J.'), 'Winter', role = 'ctb', | ||
email = '[email protected]'), | ||
person(c('Zhian', 'N.'), 'Kamvar', role = 'ctb', | ||
email = '[email protected]')) | ||
Functions are provided to rapidly read from and write to VCF files. Once | ||
VCF data is read into R a parser function extracts matrices of data. This | ||
information can then be used for quality control or other purposes. Additional | ||
functions provide visualization of genomic data. Once processing is complete | ||
data may be written to a VCF file (*.vcf.gz). It also may be converted into | ||
other popular R objects (e.g., genlight, DNAbin). VcfR provides a link between | ||
VCF data and familiar R software. | ||
Version: 1.5.0 | ||
Authors@R: c(person(c("Brian", "J."), "Knaus", role = c("cre", "aut"), | ||
email = "[email protected]"), | ||
person(c("Niklaus", "J."), "Grunwald", role = "aut", | ||
email = "[email protected]"), | ||
person(c("Eric", "C."), "Anderson", role = "ctb", | ||
email = "[email protected]"), | ||
person(c("David", "J."), "Winter", role = "ctb", | ||
email = "[email protected]"), | ||
person(c("Zhian", "N."), "Kamvar", role = "ctb", | ||
email = "[email protected]")) | ||
Maintainer: Brian J. Knaus <[email protected]> | ||
URL: https://github.com/knausb/vcfR, https://knausb.github.io/ | ||
vcfR_documentation/ | ||
Depends: | ||
R (>= 3.0.1) | ||
LinkingTo: Rcpp | ||
|
@@ -50,4 +52,4 @@ Suggests: | |
testthat | ||
VignetteBuilder: knitr | ||
License: GPL | ||
RoxygenNote: 5.0.1 | ||
RoxygenNote: 6.0.1 |
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ | |
#' @param max_DP maximum cumulative depth | ||
#' @param min_MQ minimum mapping quality | ||
#' @param max_MQ maximum mapping quality | ||
#' @param preserve a logical indicating whether or not to preserve the state of | ||
#' the current mask field. Defaults to \code{FALSE} | ||
#' @param ... arguments to be passed to methods | ||
#' | ||
#' @details | ||
|
@@ -34,30 +36,40 @@ | |
#' This vector is stored in the var.info$mask slot of a chromR object. | ||
#' | ||
#masker <- function(x, min_QUAL=999, min_DP=0.25, max_DP=0.75, minmq=20, maxmq=50, ...){ | ||
masker <- function(x, min_QUAL=1, min_DP=1, max_DP=1e4, min_MQ=20, max_MQ=100, ...){ | ||
masker <- function(x, min_QUAL=1, min_DP=1, max_DP=1e4, min_MQ=20, max_MQ=100, preserve=FALSE, ...){ | ||
quals <- getQUAL(x) | ||
# quals <- [email protected]$QUAL | ||
# info <- [email protected][,grep("DP|MQ",names([email protected])), drop=FALSE] | ||
# mask <- rep(TRUE, times=nrow(info)) | ||
mask <- rep(TRUE, times=nrow(x@var.info)) | ||
|
||
if (preserve){ | ||
mask <- x@var.info$mask | ||
} else { | ||
mask <- rep(TRUE, times=nrow(x@var.info)) | ||
} | ||
# Mask on QUAL | ||
if(sum(is.na(quals)) < length(quals)){ | ||
mask[quals < min_QUAL] <- FALSE | ||
# mask[quals < min_QUAL] <- FALSE | ||
mask <- mask & quals >= min_QUAL | ||
} | ||
|
||
# Mask on DP | ||
if( !is.null( x@var.info$DP ) ){ | ||
if(sum(is.na(x@var.info$DP)) < length(x@var.info$DP)){ | ||
mask[x@var.info$DP < min_DP] <- FALSE | ||
mask[x@var.info$DP > max_DP] <- FALSE | ||
# mask[[email protected]$DP < min_DP] <- FALSE | ||
# mask[[email protected]$DP > max_DP] <- FALSE | ||
mask <- mask & | ||
x@var.info$DP >= min_DP & | ||
x@var.info$DP <= max_DP | ||
} | ||
} | ||
|
||
if( !is.null( x@var.info$MQ ) ){ | ||
if(sum(is.na(x@var.info$MQ)) < length(x@var.info$MQ)){ | ||
mask[x@var.info$MQ < min_MQ] <- FALSE | ||
mask[x@var.info$MQ > max_MQ] <- FALSE | ||
# mask[[email protected]$MQ < min_MQ] <- FALSE | ||
# mask[[email protected]$MQ > max_MQ] <- FALSE | ||
mask <- mask & | ||
x@var.info$MQ >= min_MQ & | ||
x@var.info$MQ <= max_MQ | ||
} | ||
} | ||
x@var.info$mask <- mask | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ | |
#' @param chrom an object of class chrom. | ||
#' @param boxp logical specifying whether marginal boxplots should be plotted [T/F]. | ||
#' @param dp.alpha degree of transparency applied to points in dot plots [0-255]. | ||
#' @param chrom.s start position for the chromosome. | ||
#' @param chrom.e end position for the chromosome. | ||
#' @param chrom.s start position for the chromosome. (Deprecated. use xlim) | ||
#' @param chrom.e end position for the chromosome. (Deprecated. use xlim) | ||
#' @param drlist1 a named list containing elements to create a drplot | ||
#' @param drlist2 a named list containing elements to create a drplot | ||
#' @param drlist3 a named list containing elements to create a drplot | ||
|
@@ -51,6 +51,20 @@ chromo <- function( chrom, | |
stop("Expecting object of class chromR") | ||
} | ||
|
||
if( chrom.s != 1 | !is.null(chrom.e) ){ | ||
stop("The parameters 'chrom.s' and 'chrom.e' were deprecated in vcfR v1.5.0. Please use 'xlim' instead") | ||
} | ||
|
||
myDots <- list(...) | ||
|
||
if( !is.null( myDots$xlim ) ){ | ||
chrom.s <- myDots$xlim[1] | ||
chrom.e <- myDots$xlim[2] | ||
} else { | ||
chrom.s <- 1 | ||
chrom.e <- length(chrom) | ||
} | ||
|
||
# Test to see if the mask is populated. | ||
# if( length(grep('mask', colnames([email protected]))) < 1 ){ | ||
# [email protected]$mask <- rep( TRUE, times=nrow(chrom@vcf@fix) ) | ||
|
@@ -463,7 +477,7 @@ chromoqc <- function( chrom, | |
) | ||
|
||
chromo( chrom, boxp = boxp, | ||
chrom.e = chrom@len, | ||
# chrom.e = chrom@len, | ||
drlist1 = myList1, | ||
drlist2 = myList2, | ||
drlist3 = myList3, | ||
|
@@ -481,4 +495,4 @@ chromoqc <- function( chrom, | |
|
||
|
||
##### ##### ##### ##### ##### | ||
# EOF. | ||
# EOF. |
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
Oops, something went wrong.