bin_bam_sample: Load and bin BAM file

Description Usage Arguments Details Value Examples

Description

Load a BAM file and count reads in bins of size 50.000 base pairs

Usage

1
2
bin_bam_sample(bam_filepath, do_sort = FALSE, separate_strands = FALSE,
  custom_name = NULL)

Arguments

bam_filepath

Character The location and filename on the file system where the bam file is stored

do_sort

Boolean Sort the bam file? If the bam is unsorted set to true, but the use of pre-sorted bam files is recommended.

separate_strands

Boolean If set to true, reads from forward and reverse strands are counted and stored separately. This option should be used if you are planning on using regression, since this doubles the number of predictors (F+R) and distributes predictive power more equally over prediction sets since F and R strand from the same chromosome cannot be both in one prediction set.

custom_name

String The name of sample. Default samplename is the filename of the bam file without the .bam suffix and filepath prefix.

Details

This function returns an object of class NIPTSample, the main 'currency' of this package. It is a list with 5 items:

Value

Object NIPTSample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
##To process a single sample
binned_sample <- bin_bam_sample(bam_filepath = "/path/to/file.bam", 
                                separate_strands = T)

##To create a control group out of a set of bam files
bam_filepaths <- list.files(path = "/Path/to/bamfiles/", 
                            pattern = ".bam", full.names = T)

control_group  <- as_control_group(nipt_samples = lapply(X = bam_filepaths, 
                                   bin_bam_sample, do_sort = F, 
                                   separate_strands = T))

## End(Not run)

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