ay-lab / HiCtrans

HiCtrans is a pipeline to call translocations from Hi-C data
15 stars 5 forks source link

The Error exist when I run example data #8

Closed caokai001 closed 4 years ago

caokai001 commented 4 years ago

Dear the author:

Thanks for developing such an useful tool. I want to use this software to detect translocations, so when i run example data, it tell me path argument is invalid, I donot sure which path is mistake.

(R_env) [16:33:02] kcao@comput53:~/tools/HiC_Translocations/HiCtrans/example
$ Rscript ../hictrans.v3.R --mat T47D_20Kb_chr10_chr20.matrix \
--bed T47D_20Kb_chr10_chr20_abs.bed \
--chrA chr10 --chrB chr20 --prefix T47D_20Kb_chr10_chr20 \
--resolutions 2,3,4,5,6,8,10 --covq 0.1 

Warning message:
package 'hashmap' was built under R version 3.6.3 
Warning message:
package 'Rcpp' was built under R version 3.6.3 
Loading required package: nnet
Loading required package: MASS
Loading required package: Rsolnp
Loading required package: nlme
Error in path.expand(path) : invalid 'path' argument
Calls: normalizePath -> path.expand
Execution halted

I will be very grateful if you could give me some valuable advice. I am looking forward to your help.

Very thanks.

ay-lab commented 4 years ago

Probably this is coming from the "buildMatrixPath". Have you changed this "buildMatrixPath" variable?

caokai001 commented 4 years ago

Hi I'm very happy to have received your response. I need to declare that there is an error when I directly compile build_matrix.cpp.

(R_env) [16:10:28] kcao@login:~/tools/HiC_Translocations/HiCtrans
$ g++ build_matrix.cpp -o build_matrix
In file included from /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/unordered_map:35,
                 from build_matrix.cpp:11:
/usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/c++0x_warning.h:31:2: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
build_matrix.cpp:208: error: ISO C++ forbids declaration of ‘unordered_map’ with no type
build_matrix.cpp:208: error: invalid use of ‘::’
build_matrix.cpp:208: error: expected ‘;’ before ‘<’ token
build_matrix.cpp: In constructor ‘Chromosome::Chromosome(const std::string&, chrsize_t, chrsize_t, chrsize_t, bool, const ChrRegions*)’:
build_matrix.cpp:225: error: ‘chr_map’ was not declared in this scope
build_matrix.cpp: In static member function ‘static chrsize_t Chromosome::getCount()’:
build_matrix.cpp:240: error: ‘chr_map’ was not declared in this scope
build_matrix.cpp: In static member function ‘static Chromosome* Chromosome::getByName(const std::string&)’:
build_matrix.cpp:244: error: ‘chr_map’ was not declared in this scope
build_matrix.cpp: At global scope:
build_matrix.cpp:330: error: ISO C++ forbids declaration of ‘unordered_map’ with no type
build_matrix.cpp:330: error: invalid use of ‘::’
build_matrix.cpp:330: error: expected ‘;’ before ‘<’ token
build_matrix.cpp:331: error: ISO C++ forbids declaration of ‘unordered_map’ with no type
build_matrix.cpp:331: error: invalid use of ‘::’
build_matrix.cpp:331: error: expected ‘;’ before ‘<’ token
build_matrix.cpp:335: error: ‘std::unordered_map’ has not been declared
build_matrix.cpp:335: error: expected ‘,’ or ‘...’ before ‘<’ token
build_matrix.cpp:337: error: expected unqualified-id before ‘<’ token
build_matrix.cpp:337: error: expected ‘)’ before ‘<’ token
build_matrix.cpp:337: error: expected ‘;’ before ‘<’ token
build_matrix.cpp:1037: error: expected ‘;’ at end of input
build_matrix.cpp:1037: error: expected ‘}’ at end of input
build_matrix.cpp:1037: error: expected unqualified-id at end of input

so I copy the buildmatrix file in the HiC-pro tool to the HiCtrans folder. Maybe this is ok?

help information

(R_env) [16:15:16] kcao@login:~/tools/HiC_Translocations/HiCtrans
$ /public/home/kcao/tools/HiC_Translocations/HiCtrans/build_matrix 

/public/home/kcao/tools/HiC_Translocations/HiCtrans/build_matrix: missing --binsize or --binfile option

usage: /public/home/kcao/tools/HiC_Translocations/HiCtrans/build_matrix --binsize BINSIZE|--binfile --chrsizes FILE --ifile FILE
       --oprefix PREFIX [--binadjust] [--step STEP] [--binoffset OFFSET]
       [--matrix-format asis|upper|lower|complete][--chrA CHR... --chrB CHR...] [--quiet] [--progress] [--detail-progress]

usage: /public/home/kcao/tools/HiC_Translocations/HiCtrans/build_matrix --version

usage: /public/home/kcao/tools/HiC_Translocations/HiCtrans/build_matrix --help

Then ,I modify the "buildMatrixPath" of hictrans.v3.R . like this:

## Change the path of build_matrix program when running from different folder##
buildMatrixPath <- "/public/home/kcao/tools/HiC_Translocations/HiCtrans/build_matrix"
buildMatrixPath <- normalizePath(buildMatrixPath) 

Next, I encountered an error, such as the first issue.

Thanks.

ay-lab commented 4 years ago

Thanks for your debugging and yes the HiC-pro tool script will be fine. A few prechecks were missing in the last update, I have updated the help file. Please use this updated file and run with this command

Rscript ../hictrans.v3.R --mat T47D_20Kb_chr10_chr20.matrix --bed T47D_20Kb_chr10_chr20_abs.bed --chrA chr10 --chrB chr20 --prefix T47D_20Kb_chr10_chr20 --resolutions 2,3,4,5,6,8,10 --covq 0.1 --chromsize chrom_hg19.sizes

caokai001 commented 4 years ago

Hi I'm very happy to have received your response.

Just Now I have downloaded the new HiCtrans git ,It seems that the previous problem disappeared.
Now there is a new error. But I get this result T47D_20Kb_chr10_chr20_hictrans.chr10_chr20.MultiResolution_Filtered.Translocation.txt .

The content of the file is as follows

chrA    BoundaryAS  BoundaryAE  chrB    BoundaryBS  BoundaryBE  zscore  count   resolution  class
chr10   57840000    57860000    chr20   53900000    53920000    23.5499097031764    10  20000   BreakPoint
chr10   57860000    57880000    chr20   54440000    54460000    23.5499097031764    11  20000   BreakPoint
chr10   57780000    57800000    chr20   54660000    54680000    23.5499097031764    13  20000   BreakPoint
chr10   57840000    57860000    chr20   54660000    54700000    23.5499097031764    10  20000   BreakPoint
chr10   58080000    58100000    chr20   54660000    54680000    23.5499097031764    11  20000   BreakPoint

So can this error be ignored? maybe bacause I donot provied the Validpair files ?

My command to run the example file is as follows:

(R_env) [15:11:08] kcao@login:~/tools/HiCTranslocations/HiCtrans/example
$ Rscript ../hictrans.v3.R --mat T47D_20Kb_chr10_chr20.matrix --bed T47D_20Kb_chr10_chr20_abs.bed --chrA chr10 --chrB chr20 --prefix T47D_20Kb_chr10_chr20 --resolutions 2,3,4,5,6,8,10 --covq 0.1 --chromsize chrom_hg19.sizes
Warning message:
package ‘hashmap’ was built under R version 3.6.3 
Warning message:
package ‘Rcpp’ was built under R version 3.6.3 
Loading required package: nnet
Loading required package: MASS
Loading required package: Rsolnp
Loading required package: nlme
[1] 6777 3152
Max count of highest resolution Hi-C matrix is significant. HiCtrans will go-ahead to search translocation.
Shrinking Matrix to lower resolution
Shrinking Matrix to lower resolution
Shrinking Matrix to lower resolution
Shrinking Matrix to lower resolution
Shrinking Matrix to lower resolution
Shrinking Matrix to lower resolution
Shrinking Matrix to lower resolution
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function
Error in x$.self$finalize() : attempt to apply non-function

Thanks.

ay-lab commented 4 years ago

I can see the final file is generated and I think you can safely ignore this error. But I haven't seen this error until now, and I think the x$.self$finalize() function is called just before the object is removed from the R environment. This may be related to some internal R related issues rather than the script.

caokai001 commented 4 years ago

Thanks for your explanation!