morrislab / qapa

RNA-seq Quantification of Alternative Polyadenylation
GNU General Public License v3.0
42 stars 10 forks source link

Error in qapa build using custom BED file #35

Closed snosna closed 4 years ago

snosna commented 4 years ago

Attempting to annotate 3' UTRs with a BED file using qapa build with the -o option returns the following warning and error messages:

***** WARNING: File /var/folders/ng/2l4wjzzs7c791d8jtzqwlgvc0000gn/T/pybedtools.gkh89j50.tmp has inconsistent naming convention for record:
chrI    8377576 8378427 T19A6.1c.1_WBGene00011827.1 704 -   8378304 8378427 WBGene00011827.1    8377600,8379136,8379705,8380329,8388027,8388140,8388785,8389915,8392594 8378427,8379239,8379815,8380445,8388092,8388209,8388909,8390027,8392768

***** WARNING: File /var/folders/ng/2l4wjzzs7c791d8jtzqwlgvc0000gn/T/pybedtools.gkh89j50.tmp has inconsistent naming convention for record:
chrI    8377576 8378427 T19A6.1c.1_WBGene00011827.1 704 -   8378304 8378427 WBGene00011827.1    8377600,8379136,8379705,8380329,8388027,8388140,8388785,8389915,8392594 8378427,8379239,8379815,8380445,8388092,8388209,8388909,8390027,8392768

qapa.qapa     - 2020-06-01 23:36:07,307 - ERROR    - Error occurred in build:
Traceback (most recent call last):
  File "//anaconda3/lib/python3.7/site-packages/qapa-1.3.1-py3.7.egg/qapa/qapa.py", line 244, in build
    annotate.main(args, tf1.name, tf2)
  File "//anaconda3/lib/python3.7/site-packages/qapa-1.3.1-py3.7.egg/qapa/annotate.py", line 240, in main
    o=['collapse'] * 4, delim="|")\
  File "//anaconda3/lib/python3.7/site-packages/pybedtools/bedtool.py", line 917, in decorated
    result = method(self, *args, **kwargs)
  File "//anaconda3/lib/python3.7/site-packages/pybedtools/bedtool.py", line 401, in wrapped
    decode_output=decode_output,
  File "//anaconda3/lib/python3.7/site-packages/pybedtools/helpers.py", line 455, in call_bedtools
    raise BEDToolsError(subprocess.list2cmdline(cmds), stderr)
pybedtools.helpers.BEDToolsError: 
Command was:

bedtools groupby -o collapse,collapse,collapse,collapse -i /var/folders/ng/2l4wjzzs7c791d8jtzqwlgvc0000gn/T/pybedtools.riweb0ho.tmp -g 1,2,3,6,7,8,9 -delim | -c 4,5,10,11

Error message was:

*****
***** ERROR: Requested column 4, but database file /var/folders/ng/2l4wjzzs7c791d8jtzqwlgvc0000gn/T/pybedtools.riweb0ho.tmp only has fields 1 - 0.

Does this have to do with the format of the BED file I supplied? For reference, I am trying to build my reference collection of 3' UTRs with the 3' UTR sequences provided for the C. elegans genome from https://polyasite.unibas.ch/atlas

snosna commented 4 years ago

After messing around with the BED file a bit, I think I managed to solve this issue. When calling the -o option in qapa build, the BED file has to be in a specific format. Example header of a BED file compatible with qapa build -o is as follows:

chr1 3741 3770 polyA_site 0 -

I tried running qapa build -o with just the chrom, chromStart and chromEnd information and it gives the same warnings and error messages. I just want to clarify: what is the expected format of BED files parsed by -o? Thanks.

kcha commented 4 years ago

Hi, -o expects a 6 column BED format. With regards to the error you're seeing, can you check in all of your input files that the chromosome naming convention is consistent throughout (e.g. either they all begin with chr or don't)?

snosna commented 4 years ago

Great thanks so much! And yes, I made sure the chromosome naming convention was consistent throughout.

NJU-Bio-Info commented 2 years ago

So how do you solve this problem, I have also met such problem... Thanks!