ATACseqQC icon indicating copy to clipboard operation
ATACseqQC copied to clipboard

splitGAlignmentsByCut Error in value[[3L]](cond) : 'mergeBam' 'destination' exists, 'overwrite' is FALSE destination: splitBam/NucleosomeFree.bam

Open rafet2005 opened this issue 3 years ago • 8 comments

Hi, I know this is an old error, but I have the same problem. I'm using ATACseqQC 1.8.5 and R 3.6.1, and I get the same error when I run more than one chromosome. It works with no problems for one chromosome but not for multiple chromosomes. Any help is appreciated. the error message Error in value[3L] : 'mergeBam' 'destination' exists, 'overwrite' is FALSE destination: splitBam/NucleosomeFree.bam

My code:

load the library

rm(list=ls()) library(ChIPpeakAnno) library(ATACseqQC) library(GenomicRanges) library(EnsDb.Hsapiens.v75) library(AnnotationDbi) library(Rsamtools) library(BSgenome.TroutArrlyShort.NCBI.PRJNA623027)

setwd("/localstorage/ATACseq/result/") trout_txdb <-makeTxDbFromGFF("/localstorage/TroutNewGenome/OmyArlee_1_1/OmyArrlyShort/GCF_013265735.2_USDA_OmykA_1.1_genomic_Short.gff") saveDb(trout_txdb, file="Trout.sqlite") trout_Annota <- loadDb("Trout.sqlite") txs <- transcripts(trout_txdb)

read bam file

bamfile <- ("/localstorage/ATACseq/fastq_Adapter_cut/alignments_ARl/F1B_Arlsorted_RMmitDup_short.bam") bamfile.labels <- gsub(".bam", "", basename(bamfile)) #bam file status #bamQC(bamfileT, outPath = NULL)

generate fragement size distribution

fragSize <- fragSizeDist(bamfile, bamfile.labels)

#bamfile tags to be read in possibleTag <- combn(LETTERS, 2) possibleTag <- c(paste0(possibleTag[1, ], possibleTag[2, ]), paste0(possibleTag[2, ], possibleTag[1, ]))

bamTop100 <- scanBam(BamFile(bamfile, yieldSize = 100), param = ScanBamParam(tag=unlist(possibleTag)))[[1]]$tag tags <- names(bamTop100)[lengths(bamTop100)>0] tags tags <- tags[tags!="PG"]

outPath <- "splitBam" if (dir.exists(outPath)) { unlink(outPath, recursive = TRUE, force = TRUE) } dir.create(outPath)

seqlev <-(c( "NC_048565.1","NC_048566.1"))

which <- as(seqinfo(RainbowTroutArrly)[seqlev], "GRanges") gal <- readBamFile(bamfile, tag=tags, which=which, asMates=TRUE, bigFile=TRUE)

shiftedBamfile <- file.path(outPath, "shifted.bam") gal1 <- shiftGAlignmentsList(gal, outbam=shiftedBamfile) objs <- splitGAlignmentsByCut(gal1, txs=txs, genome=RainbowTroutArrly, outPath=outPath ) dir(outPath)

rafet2005 avatar Mar 30 '21 19:03 rafet2005

Hi, Thank you for reporting this error. Is it possible to update your ATACseqQC to current release version or development version By following method? BiocManager::install("jianhong/ATACseqQC@RELEASE_3_12") Let me know if it does not work for you.

Jianhong.

jianhong avatar Mar 30 '21 19:03 jianhong

Hi, Thank you for your reply. Yes, I was able to install it, and it works. I have one question about the TSS plot; I only get one-half of the data plotted, as shown in the figure below. Do you have an idea what could cause that? [image: image.png]

On Tue, Mar 30, 2021 at 2:12 PM JIANHONG OU @.***> wrote:

Hi, Thank you for reporting this error. Is it possible to update your ATACseqQC to current release version or development version By following method? BiocManager::install("jianhong/ATACseqQC@RELEASE_3_12") Let me know if it does not work for you.

Jianhong.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jianhong/ATACseqQC/issues/41#issuecomment-810511473, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHF4PQ2SHKAZTTNGBBZVITTGIPBXANCNFSM42CXSAKA .

-- Rafet Al-Tobasei, Ph.D. Assistant Professor Middle Tennessee State University Department of Computer Science Box 48 Murfreesboro, TN 37132 Office: 615-898-5848 @.***

rafet2005 avatar Mar 31 '21 17:03 rafet2005

Hi, The image are not available for me. could you resent image by a url? Jianhong.

jianhong avatar Mar 31 '21 18:03 jianhong

Thank you for your help. This is a link to the image https://www.cs.mtsu.edu/~raltobasei/TSS.png

On Wed, Mar 31, 2021 at 1:16 PM JIANHONG OU @.***> wrote:

Hi, The image are not available for me. could you resent image by a url? Jianhong.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jianhong/ATACseqQC/issues/41#issuecomment-811303361, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHF4PR2I2FPIPOANUA7CDDTGNRGPANCNFSM42CXSAKA .

-- Rafet Al-Tobasei, Ph.D. Assistant Professor Middle Tennessee State University Department of Computer Science Box 48 Murfreesboro, TN 37132 Office: 615-898-5848 @.***

rafet2005 avatar Mar 31 '21 19:03 rafet2005

Thank you for reporting the bug. Could you please share me the minimized sample file and code to repeat the error?

Jianhong.

jianhong avatar Mar 31 '21 19:03 jianhong

Hi, I can share the Bam file with you, but the genome is not part of the Database. I used GenomicRange to create a reference and AnnotationDb to create a transcript list from the gff file. So I don know if you can reproduce the output with just the Bam file! I'm getting this warning message "Warning message: In max(tt, na.rm = TRUE) : no non-missing arguments to max; returning -Inf" when I run these <- TSSEscore(gal1, txs). I'm using tsse$TSSEscore to get the score "10.02921" and plot(100*(-9:10-.5), tsse$values, type="b", xlab="distance to TSS", ylab="aggregate TSS score") to plot the result

On Wed, Mar 31, 2021 at 2:32 PM JIANHONG OU @.***> wrote:

Thank you for reporting the bug. Could you please share me the minimized sample file and code to repeat the error?

Jianhong.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jianhong/ATACseqQC/issues/41#issuecomment-811379635, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHF4PUM7RC3557FVINDVVDTGN2ELANCNFSM42CXSAKA .

-- Rafet Al-Tobasei, Ph.D. Assistant Professor Middle Tennessee State University Department of Computer Science Box 48 Murfreesboro, TN 37132 Office: 615-898-5848 @.***

rafet2005 avatar Mar 31 '21 19:03 rafet2005

Hi, Very useful information. I think I can locate where the issue is. I will fix this soon. Jianhong

jianhong avatar Mar 31 '21 20:03 jianhong

Hi, The bug should be fixed in the development version. Please try to install the development version via BiocManager::install("jianhong/ATACseqQC") Let me know if it does not work for you.

jianhong avatar Mar 31 '21 21:03 jianhong