Format TSS or TSR counts for further analysis.

format_counts(experiment, data_type = c("tss", "tsr"), samples = "all")

Arguments

experiment

TSRexploreR object.

data_type

Whether to format TSS ('tss') or TSR ('tsr') counts.

samples

A vector of sample names to analyze.

Value

TSRexploreR object with properly formatted features in data.table format.

Details

When TSSs or TSRs are first loaded into the TSRexploreR object they are stored as GRanges objects. This function converts these into data.table format and adds a few columns to facilitate downstream analysis.

Examples

data(TSSs_reduced) TSSs_reduced %>% tsr_explorer %>% format_counts(data_type="tss")
#> An object of class "tsr_explorer" #> Slot "experiment": #> $TSSs #> $TSSs$S288C_Diamide_YDR077W #> GRanges object with 583 ranges and 1 metadata column: #> seqnames ranges strand | score #> <Rle> <IRanges> <Rle> | <integer> #> [1] IV 599749 + | 1 #> [2] IV 600017 + | 1 #> [3] IV 600179 + | 1 #> [4] IV 600612 + | 1 #> [5] IV 600696 + | 1 #> ... ... ... ... . ... #> [579] IV 601767 + | 3 #> [580] IV 601776 + | 2 #> [581] IV 601806 + | 1 #> [582] IV 601903 + | 1 #> [583] IV 601908 + | 1 #> ------- #> seqinfo: 17 sequences from an unspecified genome; no seqlengths #> #> #> $TSRs #> [1] NA #> #> #> Slot "counts": #> $TSSs #> $TSSs$raw #> $TSSs$raw$S288C_Diamide_YDR077W #> seqnames start end width strand score FHASH #> 1: IV 599749 599749 1 + 1 IV:599749:599749:+ #> 2: IV 600017 600017 1 + 1 IV:600017:600017:+ #> 3: IV 600179 600179 1 + 1 IV:600179:600179:+ #> 4: IV 600612 600612 1 + 1 IV:600612:600612:+ #> 5: IV 600696 600696 1 + 1 IV:600696:600696:+ #> --- #> 579: IV 601767 601767 1 + 3 IV:601767:601767:+ #> 580: IV 601776 601776 1 + 2 IV:601776:601776:+ #> 581: IV 601806 601806 1 + 1 IV:601806:601806:+ #> 582: IV 601903 601903 1 + 1 IV:601903:601903:+ #> 583: IV 601908 601908 1 + 1 IV:601908:601908:+ #> #> #> #> $TSRs #> $TSRs$raw #> list() #> #> #> #> Slot "correlation": #> list() #> #> Slot "diff_features": #> $TSSs #> $TSSs$results #> list() #> #> #> $TSRs #> $TSRs$results #> list() #> #> #> #> Slot "shifting": #> $results #> list() #> #> #> Slot "settings": #> list() #> #> Slot "meta_data": #> $sample_sheet #> [1] NA #> #> $genome_annotation #> NULL #> #> $genome_assembly #> NULL #> #>