Skip to content

Usage of the R version of diffDomain

Dunming Hua edited this page Apr 26, 2023 · 1 revision

Welcome to the diffDomain-R wiki! There is a summary of usage.

This is the very first R version of diffdomain, and we will continue to improve it !!!

Install

Step1:

The package needs 'stringr', 'RMTstat' , and 'stawr' installed.

  • install.packages('stringr')

  • install.packages('RMTstat')

  • install.packages('strawr')

Step2:

install dfifdomain_0.1.0.tar.gz

For Linux

wget https://github.com/Tian-Dechao/diffDomain/blob/main/diffdomain-R/diffdomain_0.1.0.tar.gz
cd diffDomain/diffdomain-R

R
install.packages('diffdomain_0.1.0.tar.gz', repos = NULL,type = 'source')

image

For R studio

Method1:

You need to install this package locally first.

  • Tools --> Install Packages --> Install from choose 'Package Archive File(.tar.gz)'

  • Package archive choose dfifdomain_0.1.0.tar.gz --> Install

image

Method2:

  • install.packages("Path/diffdomain_0.1.0.tar.gz",repos = NULL,type = "source")

Step3:

  • library(diffdomain)

Usage

  1. comapre single TAD

comp2domains_by_twtest(chrn,start,end,fhic0,fhic1,[options])

  1. multiple comparison

comp2domains_by_twtest(fhic0,fhic1,tadlist_of_hic0.bed,[options])

Options

  • reso: resolution for hicfile [default:100000]
  • min_nbin: effective number of bin [default:10]
  • f: filtering parameter for filtering the null values of the matrix[0~1) [default:0.5]

For example, when setting ‘--f 0.6’, in the contact matrix of a TAD, if the number of the columns, whose proportions of missing values is lower than 40%, is smaller than min_nbin, DiffDomain will skip comparing this TAD anymore and set its result (statistics, the 5th column ; P value, the 6th column) as NA. In other words, DiffDomain compares the TAD contact matrixes with no less than min_nbin columns, whose missing values are less than (1-f)*100%.

  • ofile: the filepath for output file [default:stdout]
  • hicnorm: hic matrix normalization method [default:KR]
  • chrn: chromosome number [default:ALL]

Examples

  1. comapre single TAD
comp2domains_by_twtest(1,163500000,165000000,
                       "https://hicfiles.s3.amazonaws.com/hiseq/gm12878/in-situ/combined.hic", 
         "https://hicfiles.s3.amazonaws.com/hiseq/k562/in-situ/combined.hic",
                       reso = 10000,
                       ofile = "package-single-test")
  1. multiple comparison
comp2domains_by_twtest_parallel(
  "https://hicfiles.s3.amazonaws.com/hiseq/gm12878/in-situ/combined.hic", 
  "https://hicfiles.s3.amazonaws.com/hiseq/k562/in-situ/combined.hic", 
  "GSE63525_GM12878_primary+replicate_Arrowhead_domainlist.txt",
  ofile = "package-multiple-test")