GATKR6: GATK binding as an R6 class

Description Details Public fields Methods See Also Examples

Description

A GATK binding in an object-oriented form as a R6 class.

Details

The GATK is predominantly used in a pipeline by chaining individual GATK function calls to clean a bam file and prepare it for further analysis. This GATK class utilize the R6 method chaining to facilitate this usage.

Public fields

bam

a path to a current bam file. Modified during each method call to point to the result of the last GATK action.

original

a path to the original (unmodified) bam file

reference

a path to reference genome fasta (.fas) file

vcf

a path to the Variant Coding File (VCF)

outdir

an output directory for individual methods

remake

whether to remake already existing files

history

a method call history

Methods

Public methods


Method new()

Create a new GATK object

Usage
GATKR6$new(bam, reference, vcf, outdir = NULL, remake = FALSE)
Arguments
bam

an input bam file

reference

a reference fasta (.fas) file to which the sam/bam file was mapped

vcf

a vcf file with known polymorphic sites

outdir

optional an output directory

remake

optional remake the output if it already exists

Returns

a new GATK object


Method SortSam()

Sort the SAM/BAM file

Usage
GATKR6$SortSam(output = NULL)
Arguments
output

optional a path for an output bam file


Method MarkDuplicates()

Mark duplicates

Usage
GATKR6$MarkDuplicates(output = NULL)
Arguments
output

optional a path for an output bam file


Method SplitNCigarReads()

Split the reads around the N in their CIGAR string.

Usage
GATKR6$SplitNCigarReads(output = NULL)
Arguments
output

optional a path for an output bam file


Method Recalibrate()

Recalibrate the base quality score

Usage
GATKR6$Recalibrate(output = NULL, table = NULL)
Arguments
output

optional a path for an output bam file

table

optional an output path for a new base quality scores


Method FilterSamReadsTag()

Filter the sam/bam file according to tag and its values.

Usage
GATKR6$FilterSamReadsTag(tag, values, output = NULL)
Arguments
tag

a name of the tag that will be used for filtering reads

values

one or multiple values of a chosen tag

output

optional a path for an output bam file


Method clean()

Clean all intermediate files

Intermediate files are all files except the original bam file used during the initialization of the GATKR6 object and the current bam file.

Usage
GATKR6$clean()

Method clone()

The objects of this class are cloneable with this method.

Usage
GATKR6$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

GATK a group of functions that partially bind to the GATK toolkit, gatk_prepare and gatk_snv for a convenience functions utilizing the GATK calls

Examples

1
2
3
4
5
6
## Not run: 
bam = GATKR6$new("foo.bam", "bar.fas", "baz.vcf")
bam$SortSam()$SplitNCigarReads()$Recalibrate()
bam$bam

## End(Not run)

bioDS/phyloRNA documentation built on Feb. 21, 2022, 3:28 p.m.