Skip to content

Hi-C

tinymapper -m HiC runs hicstuff's pipeline on a Hi-C sample, from the reads to the contact maps, and adds a coverage track and the distance law.

A run

tinymapper -m HiC \
    -s ~/reads/JS001 \
    -g ~/genomes/W303/W303 \
    -o ~/results \
    --binning 1000 \
    --restriction DpnII,HinfI

--restriction names the enzymes the library was digested with, and --binning the bin size of the contact map, in bp.

What it does

  1. hicstuff pipeline maps the pairs, assigns them to restriction fragments, filters them, removes their duplicates, and bins them into a contact map, at --binning and coarser resolutions (.cool, .mcool). --hicstuff passes it options (--mapping 5spm --duplicates --filter --plot --no-cleanup by default).
  2. hicstuff distancelaw computes the contacts' decay with distance.
  3. hicstuff report writes hicstuff's report of the run, under the sample's name (hicstuff's report).
  4. The coverage track: the mapped reads, without duplicates, in counts per million (CPM), by bedtools and bedGraphToBigWig.
  5. A .hic contact map, by juicer_tools, when it is on the PATH.

Mapping

Since 0.15.0, hicstuff maps in its mode 5spm, bwa mem -5SPM, which needs hicstuff 4.1.0 or newer. bwa's index of the genome (bwa index ~/genomes/W303/W303.fa) is used when it is beside the FASTA; without it, hicstuff makes a temporary one at each run. To map with bowtie2, as tinymapper did before 0.15.0, pass hicstuff's iterative mapping, which needs bowtie2's index:

tinymapper -m HiC -s ~/reads/JS001 -g ~/genomes/W303/W303 \
    --hicstuff '--mapping iterative --duplicates --filter --plot --no-cleanup'

hicstuff's temporary files go to tmp/<sample>^<hash>/, a folder of the run's own, which the run removes at its end.

Balancing

hicstuff balances each resolution of the .mcool with cooler balance, with its defaults. --balance gives it other arguments, which hicstuff 4.1.0 checks before the run starts:

tinymapper -m HiC -s ~/reads/JS001 -g ~/genomes/W303/W303 \
    --balance '--cis-only --min-nnz 3 --mad-max 7'

What it writes

In --output, for a sample JS001 (File names):

  • matrices/JS001/: the contact maps, …^<hash>.cool and .mcool, and hicstuff's report, JS001.report.txt, .report_mqc.yaml and .report.html;
  • pairs/JS001/: the pairs kept, …^<hash>.valid_idx_pcrfree.pairs.gz, the fragments, .frags.tsv, and hicstuff's plots of the pairs;
  • plots/JS001/: the distance law, .distance_law.pdf and .tsv, and the fragments' sizes;
  • bam/genome/JS001/: the reads of each side, ….fwd.bam and ….rev.bam;
  • tracks/JS001/: ….CPM.bw;
  • JS001^<hash>.hicstuff_<YYYYMMDDHHMMSS>.log: hicstuff's log;
  • JS001.report.txt, .report_mqc.yaml, .report.html: tinymapper's report, with the sections [reads] and [hicstuff], taken from hicstuff's report, to which its page links (The report of a run).

hicstuff names its outputs after the prefix tinymapper gives it, <sample>^<hash>, which keeps two runs of a sample apart; its report is written again under the sample's name alone, so that MultiQC's rows of tinymapper and of hicstuff are the sample's. MultiQC's own hicstuff module needs a line of configuration to name its row after the sample too (MultiQC).

Paired-end reads only

A Hi-C run needs pairs: without an R2, it stops before it starts.