gatk-3.8/R/src/gsalib/man/gsa.read.eval.Rd

112 lines
4.4 KiB
Plaintext
Raw Normal View History

\name{gsa.read.eval}
\alias{gsa.read.eval}
* Added an R package, "gsalib", providing a place to store common, useful, documented R methods. To use this module, you must follow three steps: 1) Build the module with the following command: $ ant gsalib 2) Add the module path to your ~/.Rprofile file: .libPaths("/path/to/Sting/trunk/R/") 3) At the top of each R script that will use the library, include the line: library(gsalib) You can now use the package like any other R package. To get high-level documentation, supply the following command to R: help(gsalib) The methods contained herein are: getargs : A method to easily provide arguments to interactive and non-interactive scripts. Prints out a help message specifying how the script should be run if no arguments or "-h" is provided. Very helpful when you're writing an R-script piecemeal in interactive mode, then want to make it a command-line program. plot.venn : Plots a two-way or three-way proportional Venn diagram. read.eval : Reads VariantEval output that's formatted in R style. read.gatkreport : Reads GATKReport output. gsa.message : Emits a message with the prefix "[gsalib]" to stdout. gsa.warn : Emits a warning message with the prefix "[gsalib] Warning:" to stdout. gsa.error : Emits an error message with the prefix "[gsalib] Error: to stdout, calls traceback() and halts execution. Documentation on each of these methods can be obtained by typing "help(method_name)" at the R prompt. * Retired GATKReport.R, as that functionality has now been moved to gsalib. * Retired gsacommons, as that functionality has been split between gsalib and VariantReport.R. * Modified VariantReport.R to make use of gsalib. The script now uses the getargs() method to provide the user with some information as to the proper way to run the script. Documentation on how to prepare output is given at http://www.broadinstitute.org/gsa/wiki/index.php/VariantEval . * Added 'gsalib' target to build.xml file. Running "ant gsalib" will compile this module and place the R-ready package in R/gsalib . git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4416 348d0f76-0448-11de-a6fe-93d51630548a
2010-10-04 08:27:59 +08:00
\title{
Read a VariantEval file
}
\description{
Read a VariantEval file that's output in R format.
}
\usage{
gsa.read.eval(evalRoot)
* Added an R package, "gsalib", providing a place to store common, useful, documented R methods. To use this module, you must follow three steps: 1) Build the module with the following command: $ ant gsalib 2) Add the module path to your ~/.Rprofile file: .libPaths("/path/to/Sting/trunk/R/") 3) At the top of each R script that will use the library, include the line: library(gsalib) You can now use the package like any other R package. To get high-level documentation, supply the following command to R: help(gsalib) The methods contained herein are: getargs : A method to easily provide arguments to interactive and non-interactive scripts. Prints out a help message specifying how the script should be run if no arguments or "-h" is provided. Very helpful when you're writing an R-script piecemeal in interactive mode, then want to make it a command-line program. plot.venn : Plots a two-way or three-way proportional Venn diagram. read.eval : Reads VariantEval output that's formatted in R style. read.gatkreport : Reads GATKReport output. gsa.message : Emits a message with the prefix "[gsalib]" to stdout. gsa.warn : Emits a warning message with the prefix "[gsalib] Warning:" to stdout. gsa.error : Emits an error message with the prefix "[gsalib] Error: to stdout, calls traceback() and halts execution. Documentation on each of these methods can be obtained by typing "help(method_name)" at the R prompt. * Retired GATKReport.R, as that functionality has now been moved to gsalib. * Retired gsacommons, as that functionality has been split between gsalib and VariantReport.R. * Modified VariantReport.R to make use of gsalib. The script now uses the getargs() method to provide the user with some information as to the proper way to run the script. Documentation on how to prepare output is given at http://www.broadinstitute.org/gsa/wiki/index.php/VariantEval . * Added 'gsalib' target to build.xml file. Running "ant gsalib" will compile this module and place the R-ready package in R/gsalib . git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4416 348d0f76-0448-11de-a6fe-93d51630548a
2010-10-04 08:27:59 +08:00
}
%- maybe also 'usage' for other objects documented here.
\arguments{
\item{evalRoot}{
%% ~~Describe \code{evalRoot} here~~
}
}
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
%% ~Describe the value returned
%% If it is a LIST, use
%% \item{comp1 }{Description of 'comp1'}
%% \item{comp2 }{Description of 'comp2'}
%% ...
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%% ~~who you are~~
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
%% ~~objects to See Also as \code{\link{help}}, ~~~
}
\examples{
##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function(evalRoot) {
fileAlleleCountStats = paste(evalRoot, ".AlleleCountStats.csv", sep="");
fileCompOverlap = paste(evalRoot, ".Comp_Overlap.csv", sep="");
fileCountVariants = paste(evalRoot, ".Count_Variants.csv", sep="");
fileGenotypeConcordance = paste(evalRoot, ".Genotype_Concordance.csv", sep="");
fileMetricsByAc = paste(evalRoot, ".MetricsByAc.csv", sep="");
fileMetricsBySample = paste(evalRoot, ".MetricsBySample.csv", sep="");
fileQuality_Metrics_by_allele_count = paste(evalRoot, ".Quality_Metrics_by_allele_count.csv", sep="");
fileQualityScoreHistogram = paste(evalRoot, ".QualityScoreHistogram.csv", sep="");
fileSampleStatistics = paste(evalRoot, ".Sample_Statistics.csv", sep="");
fileSampleSummaryStatistics = paste(evalRoot, ".Sample_Summary_Statistics.csv", sep="");
fileSimpleMetricsBySample = paste(evalRoot, ".SimpleMetricsBySample.csv", sep="");
fileTi_slash_Tv_Variant_Evaluator = paste(evalRoot, ".Ti_slash_Tv_Variant_Evaluator.csv", sep="");
fileTiTvStats = paste(evalRoot, ".TiTvStats.csv", sep="");
fileVariant_Quality_Score = paste(evalRoot, ".Variant_Quality_Score.csv", sep="");
eval = list(
AlleleCountStats = NA,
CompOverlap = NA,
CountVariants = NA,
GenotypeConcordance = NA,
MetricsByAc = NA,
MetricsBySample = NA,
Quality_Metrics_by_allele_count = NA,
QualityScoreHistogram = NA,
SampleStatistics = NA,
SampleSummaryStatistics = NA,
SimpleMetricsBySample = NA,
TiTv = NA,
TiTvStats = NA,
Variant_Quality_Score = NA,
CallsetNames = c(),
CallsetOnlyNames = c(),
CallsetFilteredNames = c()
);
eval$AlleleCountStats = .attemptToLoadFile(fileAlleleCountStats);
eval$CompOverlap = .attemptToLoadFile(fileCompOverlap);
eval$CountVariants = .attemptToLoadFile(fileCountVariants);
eval$GenotypeConcordance = .attemptToLoadFile(fileGenotypeConcordance);
eval$MetricsByAc = .attemptToLoadFile(fileMetricsByAc);
eval$MetricsBySample = .attemptToLoadFile(fileMetricsBySample);
eval$Quality_Metrics_by_allele_count = .attemptToLoadFile(fileQuality_Metrics_by_allele_count);
eval$QualityScoreHistogram = .attemptToLoadFile(fileQualityScoreHistogram);
eval$SampleStatistics = .attemptToLoadFile(fileSampleStatistics);
eval$SampleSummaryStatistics = .attemptToLoadFile(fileSampleSummaryStatistics);
eval$SimpleMetricsBySample = .attemptToLoadFile(fileSimpleMetricsBySample);
eval$TiTv = .attemptToLoadFile(fileTi_slash_Tv_Variant_Evaluator);
eval$TiTvStats = .attemptToLoadFile(fileTiTvStats);
eval$Variant_Quality_Score = .attemptToLoadFile(fileVariant_Quality_Score);
uniqueJexlExpressions = unique(eval$TiTv$jexl_expression);
eval$CallsetOnlyNames = as.vector(uniqueJexlExpressions[grep("FilteredIn|Intersection|none", uniqueJexlExpressions, invert=TRUE, ignore.case=TRUE)]);
eval$CallsetNames = as.vector(gsub("-only", "", eval$CallsetOnlyNames));
eval$CallsetFilteredNames = as.vector(c());
eval;
}
}
% Add one or more standard keywords, see file 'KEYWORDS' in the
% R documentation directory.
\keyword{ ~kwd1 }
\keyword{ ~kwd2 }% __ONLY ONE__ keyword per line