changlabtw / hicmaptools

5 stars 1 forks source link

Juicer .hic file input #2

Closed 14stutzmanav closed 2 years ago

14stutzmanav commented 2 years ago

Hi there,

I am experiencing an issue when I try to use Juicer-generated .hic files. For some reason, it seems hicmaptools does not recognize -in_hic as an option. Is there any assistance you can provide?

Command entered: hicmaptools -in_hic inter_30.hic -in_hic_norm VC_SQRT -bait baitlist.bed -output baitTest.tsv -ner_bin

Output:

Usage: hicmaptools [options] -in_map in.binmap -in_bin in.bins -loop|-TAD|-bat|-submap query.bed -output out_file.tsv
inputs:
    -in_map      binary .binmap generate from .n_contact 3CONET-build 
    -in_bin      the bin file for contact map, .bins

queries:
    -loop        loci gene: chr strat   end
    -output      contact between two ends, ie. gene 5' 3'

    -TAD         loci interval: chr strat   end
    -output      sum/ave contact of the TAD, ie. TAD

    -bat         loci bat: chr  strat   end
    -output      neighboring ave contact of the bat, ie. PcG binding site

    -submap      genome region to extract: chr  strat   end
    -output      sub contact map, ie. 3R:10~15MB

    -site        interesting sites: chr strat   end
    -output      contact between those sites

    -local       interval: chr  strat   end
    -output      all contacts inside interval

    -couple      pair sites: chr1   strat1  end1    chr2    strat2  end2
    -output      output pair contacts

query parameters:
    -random N    random sampling corresponding N contacts. No random sampling if N = 0 [default: 100 contacts]
    -ner_bin N   consider within +- N bins [default: 10 bins]

For instance:
    hicmaptools -in_map nm_none_1000_reduced.bimap -in_bin nm_none_1000.bins -TAD data/10000_40000_top5.epi_domains -output 10000_40000_top5-contact.tsv

Thanks so much! I'm very excited to try out this tool.

14stutzmanav commented 2 years ago

Hi @jamesong1012 @jmchangTW, can you comment on this issue? I suspect the version of hicmaptools I downloaded from github just isn't the most up-to-date. Can you help me access a version of this tool that takes .hic files as input?

jmchangTW commented 2 years ago

Your commend seems not complete where the number of bins is missing "hicmaptools -in_hic inter_30.hic -in_hic_norm VC_SQRT -bait baitlist.bed -output baitTest.tsv -ner_bin"

should be hicmaptools -in_hic inter_30.hic -in_hic_norm VC_SQRT -bait baitlist.bed -output baitTest.tsv or hicmaptools -in_hic inter_30.hic -in_hic_norm VC_SQRT -bait baitlist.bed -output baitTest.tsv -ner_bin 10

For example, the commend of the paper works (cmd1) but it would show the usage information with additional "-ner_bin" (cmd2).

cmd1: hicmaptools -in_hic D0_mm10.hic -bait Tox_mm10.bed -random 0 -output Tox_bait_D0.tsv cmd2: hicmaptools -in_hic D0_mm10.hic -bait Tox_mm10.bed -random 0 -output Tox_bait_D0.tsv -ner_bin

14stutzmanav commented 2 years ago

Hi @jmchangTW. Thanks for your response! For some reason, it giving me the error that -in_hic is an unknown option and then prints the usage information.

Input $ hicmaptools -in_hic inter_30.hic -in_hic_norm VC_SQRT -bait baitlist.bed -output baitTest.tsv

Output

unknown option:-in_hic
Usage: hicmaptools [options] -in_map in.binmap -in_bin in.bins -loop|-TAD|-bat|-submap query.bed -output out_file.tsv
inputs:
    -in_map      binary .binmap generate from .n_contact 3CONET-build 
    -in_bin      the bin file for contact map, .bins

queries:
    -loop        loci gene: chr strat   end
    -output      contact between two ends, ie. gene 5' 3'

    -TAD         loci interval: chr strat   end
    -output      sum/ave contact of the TAD, ie. TAD

    -bat         loci bat: chr  strat   end
    -output      neighboring ave contact of the bat, ie. PcG binding site

    -submap      genome region to extract: chr  strat   end
    -output      sub contact map, ie. 3R:10~15MB

    -site        interesting sites: chr strat   end
    -output      contact between those sites

    -local       interval: chr  strat   end
    -output      all contacts inside interval

    -couple      pair sites: chr1   strat1  end1    chr2    strat2  end2
    -output      output pair contacts

query parameters:
    -random N    random sampling corresponding N contacts. No random sampling if N = 0 [default: 100 contacts]
    -ner_bin N   consider within +- N bins [default: 10 bins]

For instance:
    hicmaptools -in_map nm_none_1000_reduced.bimap -in_bin nm_none_1000.bins -TAD data/10000_40000_top5.epi_domains -output 10000_40000_top5-contact.tsv
jmchangTW commented 2 years ago

It seems that you are running a old version of HiCmapTools. Would you mind to try install it again? (details in https://hicmaptools.readthedocs.io/en/latest/install.html)

  1. download zip file @ https://github.com/changlabtw/hicmaptools/archive/refs/heads/master.zip
  2. compile a version by making under ./src
  3. simply type hicmaptools and it should show the following usage which include -in_hic option.

... input: -in_map text .n_contact or binary .bimap by genBiMap commend -in_bin the bin file for contact map, .bins or -in_hic .hic file generated by Juicer -in_hic_norm optional, a normalization method (NONE|VC|VC_SQRT|KR, default: NONE) -in_hic_resol optional, a resolution used to bin .hic (default: 10000) .....

14stutzmanav commented 2 years ago

It seems that this version does not have all the contents of the ./bin directory so I am unable to compile the version by making under ./src.

jmchangTW commented 2 years ago

Sorry, would you mind to describe "unable to compile" in details? After downloading the zip file of the project and unzipping it, ./bin is empty. You would get an executable commend "hicmaptools" inside./bin after make under ./src folder.
The following is the snapshot of the above procedure. (There are couple compile warnings which are fine.)

jiaming@iMac hicmaptools-master % pwd /Users/jiaming/Downloads/hicmaptools-master jiaming@iMac hicmaptools-master % ls bin jiaming@iMac hicmaptools-master % cd src jiaming@iMac src % make g++ -Wall -DNDEBUG -O2 --std=c++0x -c genBinMap.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c binmap.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x genBinMap.o binmap.o -o genBinMap -lcurl -lz mv -f genBinMap ../bin/. g++ -Wall -DNDEBUG -O2 --std=c++0x -c formatmap.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c index.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x formatmap.o binmap.o index.o -o formatmap -lcurl -lz mv -f formatmap ../bin/. g++ -Wall -DNDEBUG -O2 --std=c++0x -c hicmaptools.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c query.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c interval.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c bat.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c region.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c couple.cpp g++ -Wall -DNDEBUG -O2 --std=c++0x -c straw.cpp straw.cpp:204:8: warning: unused variable 'nviPosition' [-Wunused-variable] long nviPosition = readLongFromFile(fin); ^ straw.cpp:205:8: warning: unused variable 'nviLength' [-Wunused-variable] long nviLength = readLongFromFile(fin); ^ straw.cpp:243:14: warning: unused variable 'nBytes' [-Wunused-variable] long nBytes = readLongFromFile(fin); ^ straw.cpp:245:13: warning: unused variable 'nBytes' [-Wunused-variable] int nBytes = readIntFromFile(fin); ^ straw.cpp:258:13: warning: unused variable 'sizeinbytes' [-Wunused-variable] int sizeinbytes = readIntFromFile(fin); ^ straw.cpp:315:33: warning: variable 'v' is uninitialized when used here [-Wuninitialized] it = it / v; ^ straw.cpp:307:21: note: initialize the variable 'v' to silence this warning double v; ^ = 0.0 straw.cpp:530:8: warning: unused variable 'c1' [-Wunused-variable] int c1 = readIntFromFile(bufin); ^ straw.cpp:531:9: warning: unused variable 'c2' [-Wunused-variable] int c2 = readIntFromFile(bufin); ^ straw.cpp:558:9: warning: unused variable 'c2' [-Wunused-variable] int c2 = readIntFromFile(fin); ^ straw.cpp:557:9: warning: unused variable 'c1' [-Wunused-variable] int c1 = readIntFromFile(fin); ^ 10 warnings generated. g++ -Wall -DNDEBUG -O2 --std=c++0x hicmaptools.o binmap.o index.o query.o interval.o bat.o region.o couple.o straw.o -o hicmaptools -lcurl -lz mv -f hicmaptools ../bin/. jiaming@iMac src %

14stutzmanav commented 2 years ago

I followed your instructions (download hicmaptools-master, make under ./src). The issue is that I now don't have a command for hicmaptools, as shown here:

$ hicmaptools
zsh: command not found: hicmaptools

In an attempt to solve that problem, I tried to follow the instructions for installation in the README.md and tried to do make install from ./src. That lead to the following error and provoked my thinking that ./bin should not be empty:

$ make install
mv -f ../bin/genBinMap /bin/.
mv: rename ../bin/genBinMap to /bin/./genBinMap: Operation not permitted
make: *** [install] Error 1
14stutzmanav commented 2 years ago

Hi @jmchangTW, I have tried to use the .bin contents from the previous version of hicmaptools. Unfortunately, the hicmaptools command still does not work. Do you have any suggestions for how I can proceed?

jmchangTW commented 2 years ago

$ hicmaptools zsh: command not found: hicmaptools => you should specify the path to the "hicmaptools" file instead of typing the file name directly.

After trying "make under ./src", do you get a file "hicmaptools" in ./src or ./bin folder? If yes, try to run with the full path.

14stutzmanav commented 2 years ago

Aha! That worked. Thank you so much for all your help! I really appreciate it!