ay-lab / FitHiChIP

Statistically Significant loops from HiChIP data
MIT License
39 stars 20 forks source link

Use of `histdata$dist` is discouraged. Use `dist` instead. #73

Closed poflawless closed 2 years ago

poflawless commented 2 years ago

Hello ay-lab,

Recently issues occurred when using FitHiChIP and I have confirmed that I have installed the necessary libraries

In the step of "Within function of plotting distance vs contact count", FitHiChIP uses Analysis/Distance_vs_CC.r script to calculate,

but when I am testing with example data, it gave me the error:

1: Use of histdata$dist is discouraged. Use dist instead. 2: Use of histdata$dist is discouraged. Use dist instead. 3: Use of histdata$dist is discouraged. Use dist instead. 4: Removed 1 rows containing missing values (geom_bar).

which caused "Within function of plotting distance vs contact count " step before"summarizing FitHiChIP results in the HTML file" and after "Merge filtering of adjacent loops is enabled", Notice message: In mean.default(DistVec): the argument is neither numeric nor logical: return NA Notice message: In min(DistVec): no argument found for min; Inf is returned Notice message: In max(DistVec): no argument for max; -Inf is returned Notice message: In min(DistVec): no argument found for min; Inf is returned Notice message: In max(DistVec): no argument for max; -Inf is returned Error in hist.default(histdata$dist, breaks = seq(min_dist, max_dist,: 'x' must be numeric Calls: hist -> hist.default Execution stopped

I examined the script of Distance_vs_CC.r, For these lines are fine min_dist <- min(20000, min(DistVec)) max_dist <- max(2000000, max(DistVec)) histdata <- data.frame(dist=DistVec)

But for this line

max_hist_freq <- max(hist(histdata$dist, breaks=seq(min_dist, max_dist, by=10000), plot=FALSE)$counts) it raised an error and histdata$dist is not exist.

Could you please check this?.

Thanks

ay-lab commented 2 years ago

Hi @poflawless Thanks for your e-mail. I have updated the code (specifically Analysis/Distance_vs_CC.r). Please use the latest code and run once again. Please let me know for any queries. Thanks.