Python (original) (raw)

Install

The easiest way to install is via pip:

 python3 -m pip install hic-straw

Straw uses the requests library for support of URLs. Be sure it is installed.

After importing, you can always see usage via help(straw)

Examples

See an example with Google Colab here: notebook

the values returned are in x / y / counts

for i in range(len(result[0])):
print("{0}\t{1}\t{2}".format(result[0][i], result[1][i], result[2][i]))

the values returned are in results

for i in range(len(result[0])):
print("{0}\t{1}\t{2}".format(result[0][i], result[1][i], result[2][i]))

See the script straw.py for an example of how to print the results to a file.

Read header

See the file read_hic_header.py for a Python script that reads the header of a hic file and outputs the information (including resolutions).