How to use AnCorrW Colocalization Analysis Tool:
-----------------------------------------------------

Default options: All filetypes=0 (BED), strands=0 (both), processing type is
chromosome-wide, output format is text, no maximum correlation pair length
limit is set

AnCorrW cannot detect data type, so user should correctly describe the input
datasets by the following options:
--infile1       -i1   The name of input file 1
--fileformat1   -f1   type of input file 1: 0-BED, 2-TXT/SGR, 3-BED6/BED12, 4-GFF2/GFF3
--strand1       -s1   strand of input file 1: 0-both, 1-forward, 2-reverse
--infile2       -i2   The name of input file 2
--fileformat2   -f2   type of input file 2: 0-BED, 2-TXT/SGR, 3-BED6/BED12, 4-GFF2/GFF3
--strand2       -s2   strand of input file 2: 0-both, 1-forward, 2-reverse
AnCorrW accepts gzipped files too, so you can analyze .bed.gz, .sgr.gz and .gff.gz files
with no extra options/tricks. The input formats with examples are described
at the page:
https://ancorr.eimb.ru/help.html

If your files are packed by bgzip you should use the option
--bgzip               BGZIP packed files workaround

AnCorrW can work in chromosome-wide (default) or in genome-wide modes. This is
controlled by the equivalent options:
--corrtype      -ct   correlations processing type: 0-chromosome-wide, 1-genome-wide
--gw            -gw   genome-wide correlations processing type

When you analyze the datasets for the first time, you should assess the both pair
statistics (ABA/BAB and AABB/BBAA) independently. It can be done with the options
--pairtype      -pt   correlation pairs type: 0-ABA/BAB, 1-AABB/BBAA, 2-both

Statistics for ABA/BAB and AABB/BBAA correlation pairs can be quite different,
and therefore these datasets should be analyzed separately. The final results
(overlapping/asymmetry indices and their statistical significances) depend
upon the proportion between ABA-BAB and AABB-BBAA sets in the source data.
It is expedient in every particular case to study the colocalizations both for
the ABA-BAB and AABB-BBAA sets; if the results diverge, the final decision is
to be made on the basis of which of these two colocalization classes represents
a larger share of the smaller source dataset.

The maximum correlation pair size can be controlled by the following options:
--pairlimit     -pl   correlation pairs above pairlimitsize (default: 10000) will be omitted
--pairlimitsize -ps   set maximum pair limit length
This parameter is extremely important for the AABB/BBAA pair type because of
pericentromeric and/or long repeats regions that can hamper statistics 
significantly.  There is no pair limit size control by default.

Output files should be set by the following options:
--outfile       -o    output file
--statfile      -s    output file for comprehensive statistics. if omitted print to file with .stat extension
You can omit the second one so comprehensive statistics will be written to the
file with the same name but the .stat extension.

In the case of very large datasets (more than a million in the case of genome-
wide analysis) you should have the computer with the fairly large RAM amount
(>128 GB). If you don't have such RAM amount you can disable covariations
computation to get coarse-grained results:
--nocov         -n    don't calculate covariations (for very large datasets)
If the z (and p) is far beyond threshold values (i.e. |z|>>2.58) you can
accept the IO/IC as statistically significant.

AnCorrW output data is the TAB-formatted text by default. If you are
planning to use AnCorrW as bionformatic pipeline element at the web-
server you can force output in HTML format:
--of                  type of output file format: 0-text, 1-HTML
--html                output to HTML

--version       -v    Show AnCorrW version

Note for MacOS users. AnCorrW works under MacOS from Catalina and to Monterey
at least. The gatekeeper control of MacOS should be disabled however for
AnCorrW by the following command (assuming that AnCorrW located in the home
subdirectory GTCA):
sudo xattr -rd com.apple.quarantine ~/GTCA/AnCorrW

If you have any questions concerning GTCA/AnCorrW installation and/or usage, 
please, mail to Yuri V. Kravatsky, jiri@eimb.ru

If you use this script in your scientific projects please cite:
Kravatsky YV, Chechetkin VR, Tchurikov NA, Kravatskaya GI
Genome-wide Study of Colocalization between Genomic Stretches:
A Method and Applications to the Regulation of Gene Expression
DOI: XX.XXXX/XXXX, PMID: XXXXXX

GTCA/AnCorrW is released under Creative Commons Attribution-NonCommercial-ShareAlike license (CC BY-NC-SA 3.0).

Copyright (C) 2022 Yuri V. Kravatsky, jiri@eimb.ru - All Rights Reserved
