Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rafet2005 opened this issue Mar 30, 2021 · 8 comments

Comments

@rafet2005
Copy link

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)

@jianhong
Copy link
Owner

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.

@rafet2005
Copy link
Author

rafet2005 commented Mar 31, 2021 via email

@jianhong
Copy link
Owner

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

@rafet2005
Copy link
Author

rafet2005 commented Mar 31, 2021 via email

@jianhong
Copy link
Owner

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

Jianhong.

@rafet2005
Copy link
Author

rafet2005 commented Mar 31, 2021 via email

@jianhong
Copy link
Owner

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

@jianhong
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants