GetBigwigs: Get Bigwigs

View source: R/seqNdisplayR.R

GetBigwigsR Documentation

Get Bigwigs

Description

Internal function: Get bigwig file names from a data frame containing at a minimum columns bigwig_file, strand and dataset From chatGPT: the GetBigwigs function processes the filled_df data frame to extract and organize information based on the values in specific columns, with different extraction strategies depending on the conditions in the data. The extracted results are returned as a list with separate entries for '+' and '-'.

Usage

GetBigwigs(filled_df)

Arguments

filled_df

a filled dataframe (see details)

Details

Get bigwig file names from a data frame containing at a minimum columns bigwig_file, strand and dataset. Strand must be 'plus' or 'minus', use 'plus' for unstranded data. Columns on the right to dataset may contain subcategories, called subgroup_1, subgroup_2 etc. UPS: dataset and subgroup_s must be the right-most columns, see example below.

Value

Named lists or nested lists of named lists

Author(s)

MS

Examples

df = data.frame(bigwig_file=c('a.bw', 'b.bw', 'c.bw', 'd.bw', 'e.bw', 'f.bw'),
  strand = rep('plus', 6), dataset=c(rep('a',4), rep('b',2)),
  subgroup_1=c('x','x','y','y', 'x','y'),
  stringsAsFactors=FALSE)
GetBigwigs(df)

df = data.frame(
  bigwig_file=c('a_plus.bw', 'a_minus.bw', 'b_plus.bw', 'b_minus.bw', 'c_plus.bw', 'c_minus.bw'),
  strand = rep(c('plus', 'minus'), 3),
  dataset=c(rep('a',4), rep('b',2)),
  subgroup_1=c('x','x','y','y', 'x','y'),
  stringsAsFactors=FALSE)
GetBigwigs(df)


THJlab/seqNdisplayR documentation built on Aug. 3, 2024, 6:56 p.m.