This is a test version of Biostars. For the public version, visit https://www.biostars.org.
1 is not found in chromosome sizes file

I am trying to convert bedGraph to bigWig file with bedGraphToBigWig. but I always get "1 is not found in chromosome sizes file". I used the following script

macs2 callpeak -c SRRc_sorted.bam -t SRRe_sorted.bam -B --nomodel --extsize 200 --SPMR -q 0.01 -f BAM -g hs -n SRR
sort -k1,1 -k2,2n SRR_treat_pileup.bdg > SRR_treat_input.sorted.bdg
bedGraphToBigWig SRR_treat_pileup.bdg hg19.chrom.sizes  SRR_treat_pileup.bw

Do you have any solutions?

chip-seq bedgraphtobigwig

Is your chromosome name in the bedgraph, the same as the chrom.sizes file? I.e. is it also named '1' or 'chr1' ?

This happens when the genome reference you align your reads to and the chomosome sizes file come from different sources. In this case my suspecion is that you aligned to the Ensembl genome reference (which labels chromosomes 1,2,3 etc) but hg19.chrom.sizes comes from UCSU (which labels chromosomes chr1, chr2, chr3 etc).

1 answer

You can use samtools idxstats your.bam | cut -f1,2 to make the size file directly from your bam file, thereby ensuring that chr names match.

Thank you ATpoint! great

Log in to answer this question.