Git Product home page Git Product logo

hic1dmetrics's Introduction

HiC1Dmetrics

This repository contain code and basic tutorial for "HiC1Dmetrics"

figure1

Important Update

(Feb 2024) Now h1d v0.2.8 support the user-difined juicertools. You can use your own version of juicer tool by the --juicertool parameter

Installation

HiC1Dmetrics was based on python3 and released on PyPI, it could be installed by

pip install h1d

After installation, try:

$ h1d -V
h1d version 0.1.0

Documents

For detailed usage, please refer to h1d Documents

Web application

Please click hic1d webapp

Citation

Wang J, Nakato R. HiC1Dmetrics: framework to extract various one-dimensional features from chromosome structure data. Briefings in Bioinformatics, bbab509,2021.

hic1dmetrics's People

Contributors

wangjk321 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

hic1dmetrics's Issues

Test h1d using in-house Hi-C dataset cause error

Hi:
This is Linhua Sun. I have read h1d after reading recently published BIB paper. When I tried to used, it caused errors. I have tried two different cooler files (each with chromosome name 1 2 3, another with chromosome name Gm01 Gm02). Both are failed.
I have attached the command lines and errors.
CML:
h1d one -o PP.txt --datatype cool --gt Gm.size ISC 40K.cool 20000 Gm01

Error:

Start dump matrix from cool file
Traceback (most recent call last):
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Gm01'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/cooler/util.py", line 170, in parse_region
    clen = chromsizes[chrom] if chromsizes is not None else None
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/series.py", line 853, in __getitem__
    return self._get_value(key)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/series.py", line 961, in _get_value
    loc = self.index.get_loc(label)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc
    raise KeyError(key) from err
KeyError: 'Gm01'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/linhua/anaconda3/bin/cooler", line 8, in <module>
    sys.exit(cli())
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/cooler/cli/_util.py", line 197, in decorated
    func(*args, **kwargs)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/cooler/cli/dump.py", line 339, in dump
    parse_region(range, c.chromsizes),
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/cooler/util.py", line 172, in parse_region
    raise ValueError("Unknown sequence label: {}".format(chrom))
ValueError: Unknown sequence label: Gm01
Traceback (most recent call last):
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'Gm01'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/h1d/extract/convert_JuicerDump_to_dense.py", line 35, in <module>
    chrlen = genometable.loc[chr]
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/indexing.py", line 895, in __getitem__
    return self._getitem_axis(maybe_callable, axis=axis)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/indexing.py", line 1124, in _getitem_axis
    return self._get_label(key, axis=axis)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/indexing.py", line 1073, in _get_label
    return self.obj.xs(label, axis=axis)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/generic.py", line 3739, in xs
    loc = index.get_loc(key)
  File "/home/linhua/anaconda3/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc
    raise KeyError(key) from err
KeyError: 'Gm01'
Finish dump
Calculating 1D metrics for one sample
Error: Please use the right mode

Genome table

GM01	56831624
GM02	48577505
GM03	45779781
GM04	52389146
GM05	42234498
GM06	51416486
GM07	44630646
GM08	47837940
GM09	50189764
GM10	51566898
GM11	34766867
GM12	40091314
GM13	45874162
GM14	49042192
GM15	51756343
GM16	37887014
GM17	41641366
GM18	58018742
GM19	50746916
GM20	47904181

How should I set the parameters to obtain all chromosome TADs

Hello author, I would like to obtain stripTAD information for all chromosomes at once. However, it seems that your software only provides calculations for individual chromosomes at a time. Could you please advise on how to set the parameters to obtain TAD information for all chromosome numbers in one go?

Error when use rawhic input

My command is:
h1d one CI {sample}.cis10kb.hic ${res_h1d} chr19
-p {sample}_CI --datatype rawhic --msi fithic2 --gt {ppn}
The error message is:
Start dump matrix from hic file
Could not read hic file: Index 0 out of bounds for length 0
rm: cannot delete 'pluscol.chr194c9fa7d7.temp': no such file or directory
rm: cannot delete '././MatrixTemp0.5919967965865072/50000/observed.KR.chr19.txt': no such file or directory
Finish dump
Calculating 1D metrics for one sample
File does not exist, please check your file path

My .hic file is create through juicer_tools pre without normalization.

Errow when used rawhic input: "File does not exist, please check your file path"

Hi !

My command is:
h1d call TAD ./carmeli.30.hic 25000 Chr29 -o test --datatype rawhic --gt ./carmeli.length

The error message is:
Start dump matrix from hic file
Finish dump
File does not exist, please check your file path

I saw a similar error at "#2", but I found a folder called ‘MatrixTemp0.05099345739986205’ created after running the command line.
It generates the file "observed.KR.chrChr29.matrix.gz", which means "Juicer_tools dump" is working.

When I calculated the PC1 value, my command is "h1d one PC1 ./carmeli.30.hic 50000 Chr29 -o test --datatype rawhic --gt ./carmeli.length -p ./carmeli.geneDensity.txt"
I encountered a similar error report:
Start dump matrix from hic file
Finish dump
Calculating 1D metrics for one sample
File does not exist, please check your file path

My h1d version is 0.1.29;
My Linux system is CentOS Stream release 8

plot TAD

image
Dear Professor: Hello, I have two questions

① I want to draw a similar picture, but I can't find the code in the reference documentation

② Why does the matrix I drew have a row of white squares under the ground

Looking forward to your reply!
h1d one CI ./dabai.hic
50000 1 -p 300000 -o dabai_CI_chr1 --datatype rawhic
--gt ./scrofa.fa.sizes --draw -s 26000000 -e 33000000

get observed.KR.chr1.matrix.gz

h1d one CI ./observed.KR.chr1.matrix.gz
50000 1 -p 300000 -o Control_CI_chr21 --datatype matrix
--draw -s 26000000 -e 33000000

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.