inconsistent bedtools error
1
0
Entering edit mode
2.2 years ago
tnminh89 ▴ 10

Hi everyone,

I am trying to do bedtools coverage with my .bed and .bam files; however, only half of the .bed files worked, while the other half had this error:

Error: unable to open file or unable to determine types for file SRR14194209_minus_bottom_sorted_removed_opposite_gene_6kb.bed
- Please ensure that your file is TAB delimited (e.g., cat -t FILE).
- Also ensure that your file has integer chromosome coordinates in the expected columns (e.g., cols 2 and 3 for BED).

When I checked for tab delimited, cat -t FILE, here was the output example for all the files:

chr4^I119280127^I119286127^IID=FL_L1-1635^I.^I-^I119274114^I119280127^IL1.3_300bp5NoF^I6^I593^I6013^I0.0986197

Any insights of what might be happening? Thank you so much in advance!

bedtools bash • 1.3k views
ADD COMMENT
0
Entering edit mode

what is the output of the following commands:

file SRR14194209_minus_bottom_sorted_removed_opposite_gene_6kb.bed

awk -F '\t' '(NF < 3 || $1=="" || int($2)<0 ||  int($3)<=0 || int($2)>int($3) )' SRR14194209_minus_bottom_sorted_removed_opposite_gene_6kb.bed | head

cut -f 1 SRR14194209_minus_bottom_sorted_removed_opposite_gene_6kb.bed | uniq | sort | uniq -c
ADD REPLY
0
Entering edit mode

Here is the output:

awk -F '\t' '(NF < 3 || $1=="" || int($2)<0 ||  int($3)<=0 || int($2)>int($3) )' SRR14194209_minus_bottom_sorted_removed_opposite_gene_6kb.bed | head

chrX    74040075        31097677        ID=FL_L1-5481   .       -       74033944        74040075        L1.3_300bp5NoF  457     6067    6131    0.9895613000000001
chr9    116515133       41061290        ID=FL_L1-3498   .       -       116509016       116515133       L1.3_300bp5NoF  108     5207    6117    0.8512343000000001
chr3    75489612        45755449        ID=FL_L1-1010   .       -       75483459        75489612        L1.3_300bp5NoF  91      4456    6153    0.7241996
chr2    40238627        28751640        ID=FL_L1-0457   .       -       40232601        40238627        L1.3_300bp5NoF  88      3982    6026    0.6608031999999999
chr1    49122342        26432282        ID=FL_L1-0045   .       -       49116226        49122342        L1.3_300bp5NoF  84      4525    6116    0.7398627
chr11   86830636        13921450        ID=FL_L1-3967   .       -       86824479        86830636        L1.3_300bp5NoF  77      3580    6157    0.5814520000000001
chr9    70212755        41061290        ID=FL_L1-3413   .       -       70206630        70212755        L1.3_300bp5NoF  55      3195    6125    0.5216327000000001
chr3    139571485       45755449        ID=FL_L1-1181   .       -       139565365       139571485       L1.3_300bp5NoF  54      3689    6120    0.6027778
chr19   37054500        1505022 ID=FL_L1-5098   .       -       37048722        37054500        L1.3_300bp5NoF  44      2851    5778    0.4934233
chr1    169257591       26432282        ID=FL_L1-0269   .       -       169251562       169257591       L1.3_300bp5NoF  33      2162    6029    0.3586001


cut -f 1 SRR14194209_minus_bottom_sorted_removed_opposite_gene_6kb.bed | uniq | sort | uniq -c
      5 chr1
      3 chr10
     11 chr11
      6 chr12
      2 chr13
      3 chr14
      3 chr15
      1 chr17
      3 chr19
     10 chr2
      1 chr21
      5 chr3
     10 chr4
      2 chr5
      4 chr7
      6 chr8
      4 chr9
      4 chrX
ADD REPLY
0
Entering edit mode

the output of the file command is missing;

ADD REPLY
0
Entering edit mode

Yes, so sorry, my bad. Here is the output:

SRR14194209_minus_bottom_sorted_removed_opposite_gene_6kb.bed: ASCII text
ADD REPLY
1
Entering edit mode
2.2 years ago

all your START positions are greater than the END positions. This is invalid for BED.

https://samtools.github.io/hts-specs/BEDv1.pdf

chromEnd: End position of the feature on the chromosome. chromEnd must be an integer greater than or equal to the value of chromStart ...

ADD COMMENT
0
Entering edit mode

Ah I see, thank you so much!

ADD REPLY
1
Entering edit mode

Please accept the answer so the question is marked solved on the website. To do that, click on the green check mark on the left side of the answer.

ADD REPLY

Login before adding your answer.

Traffic: 2264 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