as_control_group: Convert list of nipt samples to nipt control group

Description Usage Arguments Details Value Examples

Description

Convert list of nipt samples to nipt control group

Usage

1
as_control_group(nipt_samples, control_group_type = generic_control_group)

Arguments

nipt_samples

List of nipt_sample objects to be combined to a control group

control_group_type

Control group type, either 'generic control group' or 'fitted to sample'. Leave this argument blank

Details

This function returns an S3 object of class nipt_control_group. It is a list with 3 items:

Read count strategy should be uniform in all samples in a control group object; meaning samples where forward and reverse reads are counted separately cannot be in the same control group object as samples where forward and reverse reads are counted together.

A control group object with duplicate samples or samples with different correction statusses is possible but not recommended and will generate a warning message.

Value

NIPTControlGroup object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
##Retrieve filenames
bam_filepaths <- list.files(path = "/Path/to/bamfiles/", pattern = ".bam", full.names = T)
##Load files and convert to control group
control_group  <- as_control_group(nipt_samples = lapply(X = bam_filepaths, bin_bam_sample, 
                                                         do_sort = F, separate_strands = FALSE))
##Save control group for later
saveRDS(object = control_group, file = "/Path/to/directory/control_group.rds")

## End(Not run)

NIPTeR documentation built on May 2, 2019, 7:55 a.m.