imgag / ClinCNV

Detection of copy number changes in Germline/Trio/Somatic contexts in NGS data
MIT License
73 stars 2 forks source link

"the condition has length > 1" #30

Closed Jolleboll closed 2 years ago

Jolleboll commented 2 years ago

Hello!

Just getting started with ClinCNV. I am running the test samples unsuccessfully:

Rscript clinCNV.R --bed /home/joel/Programs/ClinCNV/samples/bed_file.bed --normal /home/joel/Programs/ClinCNV/samples/coverages_normal.cov --out test_results/ --folderWithScript $PWD

[1] "We are started with reading the coverage files and bed files 2022-05-24 14:06:07"

Error in if (substring(x, 1, nchar(prefix)) == prefix) { : 
  the condition has length > 1

Calls: startsWith
Execution halted

What's happening?

Thanks in advance!

GermanDemidov commented 2 years ago

1000 excuses, I was on vacation and missed this issue...

Could you tell me if it was resolved or not yet?

Jolleboll commented 2 years ago

I hope your vacation was excellent :-]

The issue was not resolved, I just tried it again after having upgraded R to a sensible version (4.2 from 3.5), but the error remains. :-[

GermanDemidov commented 2 years ago

Sorry, could you try now? I hope I fixed it

Jolleboll commented 2 years ago

Well done! The error does not occur, however, the testrun crashes a little later like so:


[1] "We start to estimate covariances between neighboring regions in germline data - may take some time 2022-06-13 11:59:31"
[1] "Tree of covariances (using 2 predictors - sum of regions' lengths and log2 of distance between regions) plotted in test_results/ 2022-06-13 12:00:04"
[1] "Calling started 2022-06-13 12:00:04"
[1] "Working with germline sample 0 2022-06-13 12:00:05"
Error in writeLines(c("#type=GENE_EXPRESSION", paste0("#track graphtype=points name=\"",  : 
  cannot open the connection
Calls: source ... outputSegmentsAndDotsFromListOfCNVs -> makeTrackAnnotation -> writeLines
Execution halted```
GermanDemidov commented 2 years ago

This one is due to the absence of right to write into the output folder =) check the permissions

Jolleboll commented 2 years ago

Curious. I use --out test_results/ as I run the command, and the test_results directory has 777 permissions, and is owned by the correct user (same user that starts clinCNV.R).

GermanDemidov commented 2 years ago

Could you try to specify the full path to the test results folder? So to be sure that it is this folder. cannot open the connection denotes R can not "touch" the file at all

Jolleboll commented 2 years ago

Well, the folder is created without issues, and it contains these files when the crash happens:

-rw-r--r-- 1 joel users  566 Jun 13 12:35 ontargetNormal.summary.xls
-rw-r--r-- 1 joel users  21K Jun 13 12:35 clusteringSolution.png
drwxr-xr-x 3 joel users 4.0K Jun 13 12:36 normal

The output dir itself appears to be 755 by default. I must have changed it to 777 before in an attempt to troubleshoot.

GermanDemidov commented 2 years ago

still - could you try to specify the full path? =)

Jolleboll commented 2 years ago

Using the absolute path, it works!

I suggest you change this message: [1] "We run script located in folder /home/joel/Programs/ClinCNV . All the paths will be calculated realtive to this one. If everything crashes, please, check the correctness of this path first."

as it leads one to think one should use a relative path for the output folder. Also, note the typo "realtive".

Thank you very much for your help!

GermanDemidov commented 2 years ago

Thank you =) I will change it. Indeed. R is very weird with relative-absolute paths conversions. Sometimes it works, but sometimes, as we can see, not...