This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bedtools intersect error in record file

I keep getting an error with bedtools intersect when comparing a .bed file to a .gff, e.g.

Error: Invalid record in file /home/u1983390/Fusarium_data/MIMPS/MIMP_Searches/IntersectBED/GFFS_SameNameFormula/AGND.SNF.gff. Record is 
JH658272    ena PROMOTER    0   0   .   +    ID=gene:FOIG_00001;biotype=protein_coding;description=hypothetical 

I think that the problem is in the labelling in column 1 in the .bed file doesn't match that of the labelling in column 1 of the gff:

.bed file

AGND01000115.1  654599  658809  .   .   +
AGND01000115.1  654599  658809  .   .   +
AGND01000115.1  654599  658634  .   .   -
AGND01000115.1  654774  658809  .   .   +
AGND01000218.1  289972  294170  .   .   +
AGND01000218.1  289972  294170  .   .   +
AGND01000218.1  289972  294170  .   .   +
AGND01000218.1  289972  294170  .   .   -
AGND01000243.1  34534   38759   .   .   +
AGND01000243.1  34534   38759   .   .   +

.gff

JH658272    ena PROMOTER    0   0   .   +   .   ID=gene:FOIG_00001;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    0   1338    .   +   .   ID=gene:FOIG_00002;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    5777    6538    .   -   .   ID=gene:FOIG_00003;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    6692    7297    .   -   .   ID=gene:FOIG_00004;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    4062    5109    .   +   .   ID=gene:FOIG_00005;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    5522    6494    .   +   .   ID=gene:FOIG_00006;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    7461    9101    .   +   .   ID=gene:FOIG_00007;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    13652   15129   .   -   .   ID=gene:FOIG_00008;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    15366   16052   .   -   .   ID=gene:FOIG_00009;biotype=protein_coding;description=hypothetical
JH658272    ena PROMOTER    13017   14774   .   +   .   ID=gene:FOIG_00010;biotype=protein_coding;description=hypothetical

Is this the case? And if so, how might I go about fixing it?

bedtools intersect

1 answer

A GFF is by definition 1-based so a start coordinate of 0 is an invalid record. Your GFF has at least two 0 start coordinate.

Great! This fixed it, thanks!

Log in to answer this question.