-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspector_qc.Rd
109 lines (89 loc) · 4.28 KB
/
spector_qc.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/spector_qc.R
\name{spector_qc}
\alias{spector_qc}
\title{Compute QC (spector LAS) for bam files.}
\usage{
spector_qc(f_bam = NULL, f_bed = NULL, regions = "giab",
region_size = NULL, file_type = "bam", out_F = NULL, save_out = FALSE,
silent = FALSE, smr_var = "rms", file_cores = 1, chr_cores = 1,
bed_header = FALSE, region_overlap = 0, genome = "hg19",
res_verbose = TRUE)
}
\arguments{
\item{f_bam}{a string with path to \code{bam} file(s), it can link to
\code{*.bam} file (the full relative path is required), a folder with
\code{*.bam} files, or a file with with structure specified later.}
\item{f_bed}{file path for bed file to override default giab.}
\item{regions}{character. Indicates the type of region to be used to process
the bam file. The default value is \code{"giab"}, other options are
\code{"full.genome"/"genome"/"full"} for regions spanning the full genome,
or "custom" for custom bed files (\code{f_bed =} needed).}
\item{region_size}{integer. Choose size of regions to calculate LAS value.
The default \code{= NULL} means \code{region_size =} maximum power
of 2 that fits in the smallest region.}
\item{file_type}{type of file passed to f_bam (Optional). This is to ensure
the automated checks pick up the correct format. The possible options
are \code{"list"}, \code{"bam"}, and \code{"dir"}.}
\item{out_F}{(Optional) Folder path to save output. If omitted results
will be returned, but not saved.}
\item{save_out}{logical. Indicating if output from \code{spector_qc()}
should be saved.}
\item{silent}{logical. Default \code{FALSE}, if \code{TRUE} there is no
progress update for the code.}
\item{smr_var}{deprecated. Variable to use to compute summary.}
\item{file_cores}{integer. Optional number indicating if the QC should be
computed in parallel across all input files.}
\item{chr_cores}{integer. Optional number indicating if the QC should be
computed in parallel across chromosomes. Default value is \code{1}.}
\item{bed_header}{logical. \code{TRUE} if bed file has a header, the default
value is \code{FALSE}.}
\item{region_overlap}{numeric. This is a number used when computing full
genome regions in the package. It indicated the fractional overlap
between neighbouring regions.}
\item{genome}{character. The genome version of the bam file. Unless a \code{f_bed}
file is provided, the only possible options are \code{"hg19"} or \code{"hg38"}.}
\item{res_verbose}{logical. \code{TRUE} for a verbose output including information
regions. \code{FALSE} for summary results only.}
}
\value{
Output is a \code{tbl_df} object with a LAS value for each
region. Optionally the output can also be saved to file, but only if
\code{out_F} is provided.
}
\description{
Wavelet based technique to compute a quality LAS for regions
across the genome. The \code{spector_qc()} is the recommended function to
access \code{spector} since it includes several checks and allows for more
flexibility than some of the downstream functions.
}
\details{
The \code{spector_qc} function is the main function to use for QC in the
\code{spector} package. It will compute a quality control LAS for specific
regions across the genome.
The default regions, supplied in the package, are based
on the genome in a bottle project
(\href{http://jimb.stanford.edu/giab/}{giab}) reliable regions, calculated
using \code{ReliableGenome} (\href{http://github.com/popitsch/wtchg-rg}{RG}).
It is also possible to supply custom regions as a bed file or a
\code{data.frame} object.
It is important to supply full paths to \code{f_bam}, and \code{f_bed}.
Though the path can be relative to the current working directory, which can
be set with \code{\link[base:setwd]{base::setwd()}}. This also applies to the first
column of a parameter file that can be supplied to \code{f_bam}.
}
\examples{
\dontrun{
# Compute QC on sampl1.bam with default options
spector_qc(f_bam = "sample1.bam")
}
s1_path <- spector_sample("sample1.bam")
basic_path <- spector_sample("basic.bed")
# Compute QC on sample1.bam with custom region size
spector_qc(f_bam = s1_path, region_size = 2^14)
# Compute QC on sample1.bam with custom bed file
spector_qc(f_bam = s1_path, f_bed = basic_path)
# Compute QC and save output results
spector_qc(f_bam = s1_path, f_bed = basic_path, out_F = "~/",
save_out = TRUE)
}