read_table: Read table constructor

View source: R/read_table.R

read_tableR Documentation

Read table constructor

Description

Create a read table from a BAM file and variant calls

Usage

read_table(bam_file, bai_file = NULL, variant_calls, pu = NULL, debug = F)

Arguments

bam_file

bam file

bai_file

index file. If missing then .bai appendix on bam_file is assumed.

pu

A BAM pileup object returned by BAM_pileup method. If NULL, a pile up will be created

variant_calls.

A data.frame specifying positions and nucleotides on reference to be taken as true variants, see details.

Details

variant_calls has 6 columns which must be names as c("pos", "A", "C", "G", "T", "-"). pos gives the position at which a true variant exists. The other columns have logical entries, with TRUE meaning that a true variant exists with the corresponding nucleotide.

Value

A data.frame with columns: count pos1 pos2 .. posn. Each row of the data.frame corresponds to a collection of reads that are identical at the variable positions. The count column gives the number of reads with the values specified in the posi columns. Every read is listed in the table, so that the sum of the count column gives the total number of reads. The posi are the positions specified by variant_calls, i.e. posi==as.character(variant_calls$pos[i]). Entries in the posi columns are either A/C/G/T/-/NA. NA means the read did not cover that variable position.


SLeviyang/RegressHaplo documentation built on June 1, 2022, 10:48 p.m.