This is a test version of Biostars. For the public version, visit https://www.biostars.org.
CNV Calling- CopywriteR

Hello,

I am trying to perform CNV calling on two BAM files. I entered:

CopywriteR(sample.control = sample.control,
+ destination.folder = file.path(data.folder),
+ reference.folder = file.path(data.folder, "hg38_20kb"),
+ bp.param = bp.param, capture.regions.file="ngCGH_genomic_loci.bed")

It then said that the following samples will be analyzed, however after some time I receive this error message:

Error: BiocParallel errors
  element index: 1, 2
  first error: seqlevels(param) not in BAM header:
    seqlevels: '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', 'X', 'Y'
    file: sorted_aln_pe_tumor_properreads.bam
    index: sorted_aln_pe_tumor_properreads.bam

I am not sure how to resolve the error, and was hoping someone on here would have some suggestions.

Thanks,

Julia

rstudio copywriter bam

I think there is issue with chromosome naming, can you please show the bam header samtools view -H your_bam_file.bam

also check how they are named in the refernce I think they will be named ch1, ch2 ....

I added code markup to your post for increased readability. You can do this by selecting the text and clicking the 101010 button. When you compose or edit a post that button is in your toolbar, see image below:

101010 Button

I resolved the problem by mannually modify the blacklist.rda and GC_mappability.rda in following command. This lead to match "chr" definition in hg19. However, in plotCNV step, I encountered another problem that not all the .bam (control files) were processed by CopewriteR. I don't know what's the problem then.

outDir<-"."
binSize<-20000
refGeno<-"hg19"

outHelperDir<-paste(refGeno,"_",binSize/1000,"kb",sep="")
load(file.path(outDir,outHelperDir,"blacklist.rda"))
load(file.path(outDir,outHelperDir,"GC_mappability.rda"))
seqlevels(blacklist.grange)<-paste("chr",seqlevels(blacklist.grange),sep="")
seqlevels(GC.mappa.grange)<-paste("chr",seqlevels(GC.mappa.grange),sep="")
save(blacklist.grange,file.path(outDir,outHelperDir,"blacklist.rda"))
save(GC.mappa.grange,file.path(outDir,outHelperDir,"GC_mappability.rda"))

1 answer

you can add a parameter prefix = "chr",at the preCopywriteR step to avoid this problem.

Log in to answer this question.