robinjugas/CNproScan

Error in cnvDeletions(CONTIG_coverage, peakDistanceThreshold) : object 'DEL_DF' not found

miniluphy opened this issue · 17 comments

Hello,Thank you for your tools.
I am running the following code in RStudio for CNproScan:

devtools::install_github("robinjugas/CNproScan")
library("CNproScan")
# Working directory with files
setwd("D:\\R\\CNproScan_project")
# File paths
fasta_file <- "reference.fasta"
bam_file <- "file.bam"
coverage_file <- "file.coverage"
bedgraph_file <- "mapp_genmap.bedgraph"

# For only GC normalization
DF <- CNproScanCNV(coverage_file, bam_file, fasta_file, 
                   GCnorm=TRUE, MAPnorm=FALSE, cores=4)

Then, the error occurred as follow:

Error in cnvDeletions(CONTIG_coverage, peakDistanceThreshold) : 
  object 'DEL_DF' not found

The link contains my files. Hope this helps.
https://drive.google.com/file/d/1RBgW4xe2SAS8kLyMdWV1lGkXn9qr0C14/view?usp=sharing
Thank you very much.

Hi, thank you for using the package. ľll look into it in the evening and reply you.
Cheers!

Hi, try to install the latest version commited to GitHub as
devtools::install_github("robinjugas/CNproScan",force = TRUE,ref = "main")

and then try to rerun it again. I made some exceptions handling so it could work. I got 23 events detected so you should have the same amount. Let me know if it works.

Cheers.

Thank you for your reply.
I have updated my script according to your advice:

devtools::install_github("robinjugas/CNproScan",force = TRUE,ref = "main")
library("CNproScan")
# Working directory with files
setwd("D:\\R\\CNproScan_project\\CNproScan_project")
# File paths
fasta_file <- "reference.fasta"
bam_file <- "file.bam"
coverage_file <- "file.coverage"
bedgraph_file <- "mapp_genmap.bedgraph"

# For only GC normalization
DF1 <- CNproScanCNV(coverage_file, bam_file, fasta_file, 
                   GCnorm=TRUE, MAPnorm=FALSE, cores=4)

However, there is still an error about GC:
Error in if (GC_act == 0 | GC_tab[GC_act, "GC"] == 0 | is.na(GC_tab[GC_act, : argument is of length zero
It seems that the "GC_act" argument matters. Sorry to bother you again.
Thank you.

That's okay, I am happy someone discovered new bug which should be repaired.
So, I debugged it and you can try reinstall repaired version again. It seems it works, I run it without GC normalization before thats why.

Thank you most sincerely.
I have completed it and got 57 events with the GC normalization condition.
Thank you!

Hello,Thank you for your tools.
I am running the following code in RStudio for CNproScan:
`devtools::install_github("robinjugas/CNproScan",force = TRUE,ref = "main")
library(CNproScan)
setwd("D:/educational/CNV")
fasta_file <- "./K+N.fasta"
bam_file <- "./N_VS_K+N.sort.bam"
coverage_file <- "./N_VS_K+N.coverage"
bedgraph_file <- "./mapp_genmap.bedgraph"

For only GC normalization

DF <- CNproScanCNV(coverage_file, bam_file, fasta_file, GCnorm=TRUE, MAPnorm=FALSE, ORICnorm=FALSE, cores=4)`

Then, the error occurred as follow:

> DF <- CNproScanCNV(coverage_file, bam_file, fasta_file, GCnorm=TRUE, MAPnorm=FALSE, ORICnorm=FALSE, cores=4) Error in CNproScanCNV(coverage_file, bam_file, fasta_file, GCnorm = TRUE, : object 'CNV_DF' not found
I followed you suggestion to install the latest version commited to GitHub as
devtools::install_github("robinjugas/CNproScan",force = TRUE,ref = "main")
but the error still occurred.
I have tried many ways to solve this error, I really need your help. Looking forward for your reply.

Hello,
I will look into it.
Would you please share your files with me, over cloud or something?
Best regards Robin

Thank you very much for your reply despite your busy schedule.

Hey, unfortunately the link doesnt work...

Can I send it to you by email?

Yeah, robinjugas at gmail.com

This seems to be a special usecase the tool can't handle.
In FASTA you have 412 sequences.
In coverage file you have 162 sequences / contigs.
In BAM there is zero. I use BAM RNAME tag to scan the BAM file alignments and this one is empty.

So, you could process your files as recommended (should work I guess) or you can try ProcaryaSV. There you start with sequencing reads and everything is taken care of.

Did you use the recommended way? Or maybe, the condition I assume that
numberOfFastaContigs == numberOfCoverageContigs == numberOfBAMContigs
is wrong, and some contigs can have zero coverage.
But still, the BAM is an issue.

Best regards, Robin

Oh, I’m back again, encountering the same issue as Sylviasmu. Following the advice, I’ve generated a series of files, which I’ve already sent to your email.

However, when I input the command: DF <- CNproScanCNV(coverage_file, bam_file, fasta_file, GCnorm=TRUE, MAPnorm=FALSE, ORICnorm=FALSE, cores=4), an error occurs: Error in CNproScanCNV(coverage_file, bam_file, fasta_file, GCnorm = TRUE, : object 'CNV_DF' not found.

Looking forward to your response. Thank you!

I will look into it.

Hello, thanks for using the package.
I uploaded the modified code, so reinstall the package:
devtools::install_github("robinjugas/CNproScan",force = TRUE,ref = "main")

Also, sort and index your BAM file...
And try to run it again. It's testing commit, so we will see.
However, your coverage shows there are only zeroes.

Thank you for your response, the issue has been successfully resolved.