correctCIM: Corrects a chromosomal interactions map (CIM)

Description Usage Arguments Value Author(s) References See Also Examples

Description

This function applies a wavelet based correction to remove bias and noise, typical of Hi-C data, from a chromosomal interactions map (CIM).

Usage

1
correctCIM(m, seg, removeUncovered = FALSE)

Arguments

m

A CIM (matrix), where the cell m[i,j] is the interaction frequency between the genomic region i and the genomic region j.

seg

A data table definding a genome segmentation, giving the genomic coordinates of each row/col in the given CIM. The data table should include the following columns for each region: chromosome name, start position and end position.

removeUncovered

Optional: a boolean specifying whether regions that are uncovered (i.e. no interaction with other regions) should be removed before correction. set to FALSE by default.

Value

Returns a list with the following objects:

mCorrected

the corrected contat map

seg

a data table defining the genomic coordinates of each row/col in the corrected map (if removeUncoevered is set to FALSE, this would be the same as the input segmentation)

Author(s)

Yoli Shavit

References

http://www.cl.cam.ac.uk/~ys388/chromoR/ (including more examples and data sets)

See Also

See Also correctPairCIM, compareCIM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# correction
data(imr90.1.obs) #contact map of imr90 (replicate 1) 
                  #for chromosomes 1 and 2, before correction 
data(seg.imr90.obs) 
head(seg.imr90.obs)
res = correctCIM(imr90.1.obs, seg.imr90.obs, removeUncovered = TRUE)
# the corrected CIM - look at the first cell in the matrix.
# Note the difference in dimensions 
#(with respect to imr90.1.orig) since we set removeUncevered to TRUE
(res$mCorrected)[1,1]
dim(res$mCorrected)
# the coordinates for the corrected matrix 
head(res$seg)
nrow(res$seg)

Example output

Loading required package: haarfisz
Loading required package: wavethresh
Loading required package: MASS
WaveThresh: R wavelet software, release 4.6.8, installed

Copyright Guy Nason and others 1993-2016

Note: nlevels has been renamed to nlevelsWT

Loading required package: gdata
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata: 
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata: 
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

Attaching package: 'gdata'

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith

   chr   start     end
1 chr1       1  999999
2 chr1 1000000 1999999
3 chr1 2000000 2999999
4 chr1 3000000 3999999
5 chr1 4000000 4999999
6 chr1 5000000 5999999
[1] 26287.13
[1] 470 470
   chr   start     end
1 chr1       1  999999
2 chr1 1000000 1999999
3 chr1 2000000 2999999
4 chr1 3000000 3999999
5 chr1 4000000 4999999
6 chr1 5000000 5999999
[1] 470

chromoR documentation built on May 2, 2019, 2:05 p.m.