Question: ChIPQC gives Bam file has 297 contigs Error: subscript contains out-of-bounds indices
1
6 months ago by
star10
star10 wrote:

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

chipqc qc chip-seq • 151 views
modified 8 days ago by zhenfeng.liu110 • written 6 months ago by star10

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

Answer: ChIPQC gives Bam file has 297 contigs Error: subscript contains out-of-bounds in
0
8 days ago by
zhenfeng.liu110 wrote:

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.