zhpn1024 / ribotish

Ribo-seq TIS Hunter, predicting translation initiation sites and ORFs using riboseq data
http://dx.doi.org/10.1038/s41467-017-01981-8
GNU General Public License v3.0
24 stars 7 forks source link

TypeError: '>=' not supported between instances of 'NoneType' and 'float' #23

Closed ericmalekos closed 1 year ago

ericmalekos commented 2 years ago

Hi, I ran the following command and it got through the background estimation and part of the prediction step before ending on the TypeError as seen below.

Also, my GTF is produced by cuffmerge, which only determines exons, I then inserted the CDS's from the Gencode GTF. It throws the warnings as seen below, but ran without issue when I did not include the TIS information for the predict function, so I don't think that's the problem?

ribotish predict -b ./merge.bam -g ./merged_nanopore_Gen25_primary_with_CDS.gtf \
 -t ./LTM.bam --longest --tispara ./LTM.out.bam.para.py \
-e ./LTM_TIbackround.txt -f ./GRCm38.primary_assembly.genome.fa --geneformat gtf \
--ribopara ./riboquality_merge.bam.para.py --alt --minaalen 15 --seq -v

No offset parameter file found for LTM.bam. Using default offset (12).
Sat Sep 25 08:00:11 2021 Loading genome...
Sat Sep 25 08:00:11 2021 Estimating TIS background parameters...
TIS background estimation result will be saved to LTM_TIbackround.txt
...
Group data...
[7.185980623969726, 8.281739445973116, 9.203102783507383, 10.172378067164596, 11.06840648061946, 12.107621280053845, 13.12517452951367, 15.740720641276173, 15.740720641276173, None]
Estimate NB parameters...
Sun Sep 26 04:30:41 2021 Predicting...
...
chr12
Wrong CDS annotation: XLOC_006674 TCONS_00026339 214 1028 1666
Wrong CDS annotation: XLOC_006952 TCONS_00027793 305 2682 3539
Wrong CDS annotation: XLOC_007091 TCONS_00028533 553 1535 2076
Traceback (most recent call last):
  File "/public/home/emalekos/miniconda3/bin/ribotish", line 56, in <module>
    main()
  File "/public/home/emalekos/miniconda3/bin/ribotish", line 34, in main
    commands[cmd].run(args)
  File "/public/home/emalekos/miniconda3/lib/python3.9/site-packages/ribotish/run/predict.py", line 236, in run
    for result in pred_iter:
  File "/public/home/emalekos/miniconda3/lib/python3.9/site-packages/ribotish/run/predict.py", line 398, in _pred_gene
    if score is not None: ip = ribo.pidx(score, slp)
  File "/public/home/emalekos/miniconda3/lib/python3.9/site-packages/ribotish/zbio/ribo.py", line 403, in pidx
    if s >= value : break
TypeError: '>=' not supported between instances of 'NoneType' and 'float'
zhpn1024 commented 2 years ago

TIS group has None value. Does your GTF have only part of genes? If so, try to use full annotation. Another warning problem is that the para file was not loaded with --tispara. Try the default name of LTM.bam.para.py. What's your -b bam data?

ericmalekos commented 2 years ago

Does your GTF have only part of genes?

The GTF has all of the genes and includes exons and CDS. It does not have Gene or Transcript entries. When I did the original alignment I used a different GTF in STAR. Could this be problematic?

Another warning problem is that the para file was not loaded with --tispara.

Ah yes I passed the wrong file name. Thanks!

What's your -b bam data

I mapped multiple fastqs from cycloheximide treated samples. Then I merged with samtools merge to get "merge.bam" which I use as input

zhpn1024 commented 2 years ago

GTF with only exons and CDSs should be OK. You can use -a option to provide gene annotation other than prediction objects. Why you used a different GTF? You can try to use smaller number of groups, for example option --nparts 5, and the None type may disappear.