<commit_before>#FISH-MDS: Multidimensional scaling (MDS) For Chromosome Structure Inference With Constraints From FISH
## Tutorial By <NAME> and <NAME>
Email: [<EMAIL>](mailto:<EMAIL>)
Email: [<EMAIL>](mailto:<EMAIL>)

## Dependencies
FISH_MDS.jl is a Julia package that models 3D structure from Hi-C contact matrices. To use the package please first download Julia and the following libraries.  The companion viewer for the package is Hi-Brow.

[Julia](http://julialang.org/)

Julia libraries:

[Ipopt.jl](https://github.com/JuliaOpt/Ipopt.jl)  
[Grid.jl](https://github.com/timholy/Grid.jl) (for 3D interpolation)  
[ArgParse.jl](https://github.com/carlobaldassi/ArgParse.jl) (for the command-line interface)  

Visualization: add link to Hi-Brow

## Usage

    usage: main.jl [-f FISH] [-r RADIUS] [-o OUTPUT] [-i INIT] [--interp]
        [--auto-scale] [--shortest-paths] [-h] filename
    
    positional arguments:
       filename             CSV file containing HiC counts

    optional arguments:
        -f, --fish FISH      FISH constraints file (default: "")
        -r, --radius RADIUS  Radius of chromosome (determined via imaging) (type: Number, default: 1)
        -o, --output OUTPUT  Output file name (default: "")
        -i, --init           Initial starting coords file (in same format as output) (default: "")
        --interp             Flag: use interpolation
        --auto-scale         Flag: automatically infer the scaling factor (requires FISH constraints)
        --shortest-paths     Flag: use shortest paths reconstruction
        -h, --help           show this help message and exit


##FISH_MDS.jl installation:

First, in the command-line open interactive Julia, run 

    julia
    julia> Pkg.clone("https://github.com/yjzhang/FISH_MDS.jl.git")

Then, create a "main.jl" file with the following commands:

    julia> using FISH_MDS
    julia> mds_main()

##Input files

1) The first required file the running main.jl is the normalized Hi-C interaction contact matrix.
In the following examples the file is:  
`HiC_matrix_chr4_condition1.csv`

This file is a comma seperate csv file with no headers or row names.  The file must be normalized contacts and not raw counts.  Raw signal from Hi-C experiments has inherent biases that are disruptive to MDS procedure.
Example lines from HiC_matrix_chr4_condition1.csv:

    104.6821,150.2740,146.4277,0.0000,0.0000,0.0000,...
    995.8,127.0956,137.6080,136.1468,60.2406,53.2425,...
    ...

2) A second useful file to maintain is:  
    `HiC_chr4_bins.bed.` 
    
This is a bed format tab-delimited text file that contains the positions of the bins used by the Hi-C contact matrix.  For example, if the bin size is 200000 (0.2 Mb) then this file will contain:

    chr1    0       200000
    chr1    200000  400000
    chr1    400000  600000

And the file will correspond to the rows of the HiC_matrix_chr4_condition1.csv signal.  Therefore, the number of rows in the Hi-C matrix and the bins file should be identical.  This bed file is not needed by main.jl, but is useful to build optional file 3 and additional tracks for viewing together with the 3D model.
<commit_msg>fixed readme<commit_after>#FISH-MDS: Multidimensional scaling (MDS) For Chromosome Structure Inference With Constraints From FISH
## Tutorial By <NAME> and <NAME>
Email: [<EMAIL>](mailto:<EMAIL>)
Email: [<EMAIL>](mailto:<EMAIL>)

## Dependencies
FISH_MDS.jl is a Julia package that models 3D structure from Hi-C contact matrices. To use the package please first download Julia and the following libraries.  The companion viewer for the package is Hi-Brow.

[Julia](http://julialang.org/)

Julia libraries:

[Ipopt.jl](https://github.com/JuliaOpt/Ipopt.jl)  
[Grid.jl](https://github.com/timholy/Grid.jl) (for 3D interpolation)  
[ArgParse.jl](https://github.com/carlobaldassi/ArgParse.jl) (for the command-line interface)  

Visualization: add link to Hi-Brow

## Usage

    usage: main.jl [-f FISH] [-r RADIUS] [-o OUTPUT] [-i INIT] [--interp]
        [--auto-scale] [--shortest-paths] [-h] filename
    
    positional arguments:
       filename             CSV file containing HiC counts

    optional arguments:
        -f, --fish FISH      FISH constraints file (default: "")
        -r, --radius RADIUS  Radius of chromosome (determined via imaging) (type: Number, default: 1)
        -o, --output OUTPUT  Output file name (default: "")
        -i, --init           Initial starting coords file (in same format as output) (default: "")
        --interp             Flag: use interpolation
        --auto-scale         Flag: automatically infer the scaling factor (requires FISH constraints)
        --shortest-paths     Flag: use shortest paths reconstruction
        -h, --help           show this help message and exit


##FISH_MDS.jl installation:

First, in the command-line open interactive Julia, run 

    julia
    julia> Pkg.clone("https://github.com/yjzhang/FISH_MDS.jl.git")

Then, create a "main.jl" file with the following commands:

     using FISH_MDS
     mds_main()

##Input files

1) The first required file the running main.jl is the normalized Hi-C interaction contact matrix.
In the following examples the file is:  
`HiC_matrix_chr4_condition1.csv`

This file is a comma seperate csv file with no headers or row names.  The file must be normalized contacts and not raw counts.  Raw signal from Hi-C experiments has inherent biases that are disruptive to MDS procedure.
Example lines from HiC_matrix_chr4_condition1.csv:

    104.6821,150.2740,146.4277,0.0000,0.0000,0.0000,...
    995.8,127.0956,137.6080,136.1468,60.2406,53.2425,...
    ...

2) A second useful file to maintain is:  
    `HiC_chr4_bins.bed.` 
    
This is a bed format tab-delimited text file that contains the positions of the bins used by the Hi-C contact matrix.  For example, if the bin size is 200000 (0.2 Mb) then this file will contain:

    chr1    0       200000
    chr1    200000  400000
    chr1    400000  600000

And the file will correspond to the rows of the HiC_matrix_chr4_condition1.csv signal.  Therefore, the number of rows in the Hi-C matrix and the bins file should be identical.  This bed file is not needed by main.jl, but is useful to build optional file 3 and additional tracks for viewing together with the 3D model.

{'fraction_non_alphanumeric': 0.09118347895154885, 'fraction_numerical': 0.04098490865766481, 'mean_word_length': 3.1096605744125325, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6997866', 'n_tokens_mistral': 2147, 'n_tokens_neox': 1882, 'n_words': 739}