This function allows to obtain a dataframe that can be used with plotgardener's plotHicTriangle, plotHicRectangle, plotHicSquare. It is equivalent to plotgardener's readHic function.
Usage
preparePlotgardener(
hicList = NULL,
ctrlHicList = NULL,
submatrices = NULL,
submatrix.name = NULL,
diffFun = "log2ratio",
which_chrom = NULL,
which_range = NULL
)
Arguments
- hicList
hicList from which to extract data
- ctrlHicList
hicList to use as control for a differential analysis.
- submatrices
list of submatrices.
- submatrix.name
name of submatrix to focus on. use
names(submatrices)
. If submatrices is notNULL
, this argument must not beNULL
.- diffFun
The function used to compute differential between counts column of hicList and ctrlHicList. If the argument is a character, possible choices are:
"-", "substract" or "substraction" apply a substraction (Default)
"/" or "ratio" apply a ratio
"log2","log2-","log2/" or "log2ratio" apply a log2 on ratio
other apply a log2 on 1+ratio
- which_chrom
a combination of chromsome names use
names(hicList)
to see the possible names.- which_range
a GRanges object or a string of type "chr1:1-100". see
StrToGranges()
.
Value
funcions returns a data.frame with 3 columns:
chrom, altchrom and counts. chrom being bin names of rows, altchrom being
bin names of columns and counts being the counts.
see also strawr::straw()
& plotgardener::readHic()
Examples
data(HiC_Ctrl.cmx_lst)
data(HiC_HS.cmx_lst)
preparePlotgardener(
hicList = HiC_HS.cmx_lst,
ctrlHicList = HiC_Ctrl.cmx_lst,
which_chrom = "2L_2L",
diffFun = "substract")|> head()
#> chrom altchrom counts
#> 1 0e+00 0e+00 5724
#> 2 0e+00 1e+05 3695
#> 3 1e+05 1e+05 2747
#> 4 0e+00 2e+05 398
#> 5 1e+05 2e+05 6324
#> 6 2e+05 2e+05 5613