fgvieira / ngsLD

Calculation of pairwise Linkage Disequilibrium (LD) under a probabilistic framework
GNU General Public License v2.0
45 stars 7 forks source link

Error in open.connection(file, "rt") : cannot open the connection #49

Closed jcaccavo closed 1 year ago

jcaccavo commented 1 year ago

Hi there,

I got the following error when trying to run the fit_LDdecay.R script: Rscript --vanilla --slave fit_LDdecay.R --ld_files /srv/public/users/jcaccavo/11_CCGA_full_seq/02_NovaSeq/02_WG/17_ngsLD/dmawsoni2021_GL1_doMaf3_doMajorMinor1_doGlf2_minMaf0.05_SNPpval1e6_minInd29_NR_depth_DS2X_LD --out dmawsoni2021_GL1_doMaf3_doMajorMinor1_doGlf2_minMaf0.05_SNPpval1e6_minInd29_NR_depth_DS2X_LD_decay.pdf

Random seed: 44999
==> Fitting r2 LD decay assuming a three (rate of decay, max LD and min LD) parameter decay model
Error in open.connection(file, "rt") : cannot open the connection
Calls: read.table -> open -> open.connection
In addition: Warning message:
In open.connection(file, "rt") :
  cannot open compressed file 'HiC_scaffold_10:79542', probable reason 'No such file or directory'
Execution halted

I'm using R/4.2.2.

Let me know if there's any further information I can provide to help troubleshoot this error.

Thanks, Jilda

fgvieira commented 1 year ago

From the error message, the input file does not exist.

jcaccavo commented 1 year ago

Thanks for your quick feedback!

Having a closer look, I realize that I was referring to the LD file itself (the output of ngsLD), not a file with the name of the input LD file, which is what the Rscript actually called for. Providing a file with the name of the input LD file (rather than the input LD file name itself) in the script allowed it to run properly and produce a plot.

Thank you very much for your quick response that helped me figure out this silly mistake!