
A. The tREX.txt or tPAM can be run using the command :

bash tREX.txt
bash tPAM.txt


B. Command Example
=======================================================================================
counts=demo.txt
bias=bias.txt
put=./


./Poisson tREX ns 43 $counts $bias $put burn 70000 N 70000 proposals: s 0.0002 b1 0.02 x 0.16 u 0.12 efl 0.0 gc 0.0 HALF_BETA0 1.5
=======================================================================================


C. General Arguments
=======================================================================================

1. tREX
tREX is the name of the engine. You can select one of tREX or tPAM.


2. ns 43
43 is the number of loci fragments. In the demo file, 43-fragments was assumed.


3. $counts
User can specify the location of the file where the contact counts is residing.

The contact counts file is formatted as following:

1st column 		2nd column 		3rd column
i-fragment_id 	j-fragment_id 	interaction counts

- fragment_id is supposed to be consecutive number from 1.
- i is supposed to be less than 2
- The row of the file should be ns*(ns-1)/2.


4. $bias
User can specify the location of the file where the bias information is residing.
Bias file consists of the 4 columns.

The bias file is formatted as following:

1st column 		2nd column 				3rd column			4th column
fragment_id 	fragment length score 	gc contents score	mappability score


5. $put
User can specify the location to place the output file.


6. burn 70000
Specify the number of burn.


7. N 70000
Specify the number of iterations of MCMC sampling. This number should be a multiple of 10000. 
Suppose N is set to 70000. Then thinning will take place to yield 10000 samples out of 70000 iterations.


D. Arguments for Proposal
=======================================================================================
1. s 0.0002
The proposal for coordinates in the 3-dimensional space. Change the number as users wish.


2. b1 0.02
The proposal for beta1. Change the number as users wish.


3. x 0.16
The proposal for random effect X. Necessary  only for tREX. Change the number as users wish.


4. u 0.12
The proposal for random effect U. Necessary only for tREX. Change the number as users wish.


5. efl 0.0
The proposal for fragment length. Necessary only for tPAM. Change the number as users wish.


6. gc 0.0
The proposal for GC contents. Necessary only for tPAM. Change the number as users wish.


7. HALF_BETA0 1.5
Arbitrary setting of beta0. User needs to specify half of Beta0. Change the number as users wish.



E. output
=======================================================================================
1. S.txt

MCMC samples for coordinates of the each loci fragment. The number of row is 10000 and the number of column is 3*ns(the number of loci fragments).
Suppose we want a MCMC sample for 10th loci fragment. 

28th column = 10000 MCMC samples of x-coordinate
29th column = 10000 MCMC samples of y-coordinate
30th column = 10000 MCMC samples of z-coordinate  

Note that the all the coordinates are not isometric transformed.
To estimate the unique coordinates, users need to apply a composites of isometric transformations described in the paper.


2. AcceptanceRate.txt
The information about acceptance rate is provided.
