This is a test version of Biostars. For the public version, visit https://www.biostars.org.
X chromosome in bedtoolsIntersect

I wanted to get the intersection from a set of bam files that I have and a bed file that I made of some genes that I'm interested in. I made the bedfile using gtf2bed with no error messages.

when I use bedtools intersect -a sample.bam -b reference.bed between a bam file and the bed file of the genes I'm interested in, I keep getting the error:

***** ERROR: illegal character 'X' found in integer conversion of string "X". Exiting...

I greped the bed file and it looks like they're coming from the X chromosome...

Including a subset of the bed file here:

479:MTMR1   X   150692971   150765103   +   gene
480:FAM58A  X   153587919   153600045   -   gene
481:RENBP   X   153935263   153944691   -   gene
482:RPL10   X   154389955   154409168   +   gene

I don't get this error (e.g. the command runs) if I run with bedtools intersect -a sample.bam -b reference.gtf but the outputted file is gibberish.

I'm not sure what to do here because these are genes on the X chromosome and I've seen nothing like this in the cases online.

Would be grateful for any/all suggestions here.

bedtools

1 answer

That's NOT a bed file.

A bed file is chrom/start/end and your file is name/chrom/start/end

Log in to answer this question.