RahmanTeam / DECoN

50 stars 29 forks source link

DECoN v2.0.1 installation error, Rscript error and question. #45

Open thomaslin0426 opened 1 year ago

thomaslin0426 commented 1 year ago

I was trying to use DECoN for my target panel CNV analysis. It had lots of error. Thanks to wcarre, fishcakess and emunte in #40, #41 and #44, these issues helped me a lot. In order to help other when they using DECoN V2.0.1 first time. I would like to record the steps I took to fix these errors.

1. Installation

I downloaded the R 4.2.0 from CRAN and compiled it on CentOS. Then I clone DECoN and run the setup.sh as Documentation said.

But in setup.log, I got a error message. image The error was from the full version control, and there isn't old version package in CRAN. As #41 describe, I needed to modify the version control file which is named renv.lock. (For Windows should be same as linux, but I didn' t try it. If it was wrong, please write commen blow.) path of renv.lock : /DECoN/Linux/renv.lock or /DECoN/Windows/renv.lock Change the line 118 "Version": "1.1.15" to "Version": "1.1.16". image After re-running the setup.sh, the installation log showed it installed successfully.

2. Running with test datafiles

The R scripts need to be run under the path of DECoN Next, I tried to run the DECoN with DECoN .

  1. ReadInBams.R Command : cd $DECoN_path $Rscript_path ReadInBams.R --bams $rawdata_path --bed $rawdata_path/test_Target_Regions.bed --fasta $reference_path --out $output_path/1.ReadInBAM/test And got [1] "END ReadInBams.R" on screen.

  2. IndentifyFailures.R Command : cd $DECoN_path $Rscript_path IdentifyFailures.R **--RData** $output_path/1.ReadInBAM/test.RData --exons rawdata_path/test_customNumbering.txt --mincorr .98 --mincov 100 --custom TRUE --out $output_path/2.IdentifyFailures/testFailures Here the option of Summary RData file, should be --RData not the --Rdata which is describe in both Document and README in test datafiles. And you should got [1] "END IdentifyFailures.R" on screen.

  3. makeCNVcall.R Command : cd $DECoN_path $Rscript_path makeCNVcalls.R --RData $output_path/1.ReadInBAM/test.RData --exons $rawdata_path/test_customNumbering.txt --custom TRUE --out $output_path/3.makeCNVcalls/testCalls --plot All --plotFolder $output_path/3.makeCNVcalls/testPlots Remeber, the option of Summary RData file is same as IndentifyFailures. Should be --RData not the --Rdata. After that you got [1] "END makeCNVCalls.R".

But when I checked the "testCalls_custom.txt", it was totally differnet from the README in test datafiles. image As the README, should only be a sample 207 BRCA1 deletion.

Thank for wcarre, fishcakess corrected the bug in IndentifyFailures.R and makeCNVcall.R. I corrected the colnames(ExomeCount)[1:length(sample.names)+4]=sample.names to colnames(ExomeCount)[1:length(sample.names)+5]=sample.names For IndentifyFailures.R, change colnames(ExomeCount)[1:length(sample.names)+4]=sample.names to colnames(ExomeCount)[1:length(sample.names)+5]=sample.names in line 57. For makeCNVcall.R, change colnames(ExomeCount)[1:length(sample.names)+4]=sample.names to colnames(ExomeCount)[1:length(sample.names)+5]=sample.names in line 69. And re-run all command above. Finally, I got the results as same as the README. image image Hope this page can help others who getting to use this package.

3. Question

Lastly, I have a question about my analysis. I have around 900 target panel NGS data. They are from the same panel but different batches. And they can be categorized into two main groups: normal group (may contain some unknown CNV) and known CNV group.

My first question is what analysis strategy should I use? Analyze them in a single run or analyze them separately? My second question is some of the interesting genes are on the X chromosome. For this scenario, should I separate the samples by sex and analyze them separately?

tomdrake commented 1 year ago

Hello

Just to add to this issue so others know!

Installing this package does not work according to the instructions and the code is full of errors as outlined above. I installed as per instructions into the correct version of R, >4.2.0, but there have been underlying changes to other packages. For example ExomeDepth will add a GC column when a FASTA is specified, but DECoN will then erroneously label this as a sample count column (So make sure to use the 1.15 release of ExomeDepth if you get this working or edit the code to avoid the FASTA argument...).

Using the packrat version of DECoN may be a better work around.

As DECoN appears to be a wrapper for ExomeDepth, I have had far more success with ExomeDepth for calling CNVs and getting them in the right shape. The package is well maintained and has good vignettes for how to analyse specific chromosomal CNVs. It works without having to rewrite or edit code.

https://cran.r-project.org/web/packages/ExomeDepth/index.html

For X chromosome copy number, that's more tricky! Would split by sex to begin, or you could even sum/ merge your counts in your BAM file and treat it as one (so if you have overall any amplification/deletion).

Hope this helps

Tom

emunte commented 1 year ago

Hello,

Thanks for your comments, I think they are very useful. I just want to add a suggestion: Instead of replacing colnames(ExomeCount)[1:length(sample.names)+4]=sample.names for colnames(ExomeCount)[1:length(sample.names)+5]=sample.names

I would put the following:

if(names(ExomeCount)[5]=="GC"){ colnames(ExomeCount)[1:length(sample.names)+5]=sample.names #assigns the sample names to each column }else{ colnames(ExomeCount)[1:length(sample.names)+4]=sample.names }

The thing is that if you leave the --fasta parameter NULL in ReadInBams.R then RData dataframe generated has 1 less column because GC content is not computed, so GC column does not exist.

Again thank you for your comments!

Best regards,

Eli

mcollodetti commented 1 year ago

Hi guys!

I am relieved to know that other had issues as well. Installing DECoN became a challenge. Is anyone considering recording a video on how to install it on Windows?

SaitouAsuka commented 8 months ago

Hello

Just to add to this issue so others know!

Installing this package does not work according to the instructions and the code is full of errors as outlined above. I installed as per instructions into the correct version of R, >4.2.0, but there have been underlying changes to other packages. For example ExomeDepth will add a GC column when a FASTA is specified, but DECoN will then erroneously label this as a sample count column (So make sure to use the 1.15 release of ExomeDepth if you get this working or edit the code to avoid the FASTA argument...).

Using the packrat version of DECoN may be a better work around.

As DECoN appears to be a wrapper for ExomeDepth, I have had far more success with ExomeDepth for calling CNVs and getting them in the right shape. The package is well maintained and has good vignettes for how to analyse specific chromosomal CNVs. It works without having to rewrite or edit code.

https://cran.r-project.org/web/packages/ExomeDepth/index.html

For X chromosome copy number, that's more tricky! Would split by sex to begin, or you could even sum/ merge your counts in your BAM file and treat it as one (so if you have overall any amplification/deletion).

Hope this helps

Hello, the 1.15 release of ExomeDepth has been removed from CRAN. I can't finish the installation while using the packrat version. Where can I get the 1.15 release of ExomeDepth? Thanks a lot!