This is a test version of Biostars. For the public version, visit https://www.biostars.org.
error with bedtools slop

Hi,

I am trying to run a bedtools slop on my bed file and hg19.genome

bedtools slop -i H3K27me3.bed -g hg19.genome -b 30

I get the following error:

Less than the req'd two fields were encountered in the genome file (genomes/hg19.genome) at line 2.  Exiting.

Any suggestions?

Thanks in advance
Samad

bedtools chip-seq

3 answers

The problem was with my hg19.genome file, the correct form has to be as follow (2 columns):

chrom    size
chr1    249250621
chr2    243199373
chr3    198022430
chr4    191154276
chr5    180915260
chr6    171115067
chr7    159138663
chrX    155270560
chr8    146364022
....

To create a new hg19.genome from ucsc, use this:

mysql --user=genome --host=genome-mysql.cse.ucsc.edu -A -e "select chrom, size from hg19.chromInfo"  > hg19.genome

Thank you for the suggestions

You might also try bedops --range, which doesn't require any genome table, e.g.:

$ bedops --range 30 --everything H3K27me3.bed > answer.bed

<Deleted as OP edited his question>

Sorry, I just forgot to put -g in my post, the error comes with :

bedtools slop -i H3K27me3.bed -g hg19.genome -b 30

Thank you

Post example of your genome file.

Log in to answer this question.