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 22 months ago
Netherlands

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 • 1.6k views
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode
@zhenfengliu1-21576
Last seen 4.9 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) {
    tocheckforreads <- 1000
    readlength = round(mean(width(temp[1:tocheckforreads])))

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.

ADD COMMENT

Login before adding your answer.

Traffic: 458 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6