ChIPQC gives Bam file has 297 contigs Error: subscript contains out-of-bounds indices
1
1
Entering edit mode
star ▴ 10
@star-15676
Last seen 2.7 years ago

I like to use ChIPqc packages, so I used output of Bowtie2 (after deduplicating using Picards) as Bam file and used narrowPeak file as output of MACS2, but I faced with below Error.

sample = ChIPQCsample("align-path/undup_uniqu_SRR5339509_ENCSR890NXD_control_2.bam", peaks="peak path/GSM2534593_SRR5339509_H3K4me1_narrow_peaks.narrowPeak")

Bam file has 297 contigs
Error: subscript contains out-of-bounds indices

ChIP-seq ChIPQC QC • 758 views
0
Entering edit mode

I am running into the same error. Did you figure out the cause of the error?

1
Entering edit mode
@zhenfengliu1-21576
Last seen 2.0 years ago

After some research, I think I've found the cause of this bug. In ChIPQC:::sampleQC function, there is code to check for read length with the first 1000 reads of the first chromosome. Code follows:

if (k == 1) {


However, often the first chromosome is ChrM, a very small one. When there are less than 1000 reads on the first chromosome, this will throw a out-of-bounds error. This should a easy fix in the code. To get around this without changing the code, you can specify the chromosomes to check in ChIPQCsample, and not include ChrM.