RGT TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'
0
0
Entering edit mode
5.6 years ago

Hi,

I am having troubles with RGT package. When I run

rgt-hint footprinting --atac-seq --paired-end --organism=SC SC1.bam SC1_peaks.bed --output-prefix=SC1

I get the error

Traceback (most recent call last):
  File "/home/ghovhannisyan/.local/bin/rgt-hint", line 11, in <module>
    sys.exit(main())
  File "/home/ghovhannisyan/.local/lib/python2.7/site-packages/rgt/HINT/Main.py", line 89, in main
    args.func(args)
  File "/home/ghovhannisyan/.local/lib/python2.7/site-packages/rgt/HINT/Footprinting.py", line 105, in footprinting_run
    atac_seq(args)
  File "/home/ghovhannisyan/.local/lib/python2.7/site-packages/rgt/HINT/Footprinting.py", line 252, in atac_seq
    min_length=None, max_length=145, strand=True)
  File "/home/ghovhannisyan/.local/lib/python2.7/site-packages/rgt/HINT/signalProcessing.py", line 935, in get_bc_signal_by_fragment_length
    cut_site = read.aend + reverse_shift - 1
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

I have added the organism as described here: https://groups.google.com/forum/#!category-topic/rgtusers/general-discussion--rgt-core-classes/6ioEaNXEeeA

Did anybody have this before? I suspect this could be because of the mapper - I used bwa, while in the example files they use bowtie2.

Disclaimer: cross-posted to RGT google group, which does not seem very active.

RGT TF-footprinting ATAC-seq • 3.2k views
ADD COMMENT
1
Entering edit mode

The error suggests that read.aend is, for some reason, None. I'll assume pysam is used under the hood, and that attribute is deprecated, but that should not be the problem. My first thought is that you have unmapped reads in your bam file, you could try filtering on that and see if the error is reproduced..

ADD REPLY
0
Entering edit mode

Yes it somehow should be related to pysam... thanks, I will give it a try.

ADD REPLY
0
Entering edit mode

Hi Wouter, your suggestion worked, thank you! But now I get another one

Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
Traceback (most recent call last):
  File "/home/ghovhannisyan/.local/bin/rgt-hint", line 11, in <module>
    sys.exit(main())
  File "/home/ghovhannisyan/.local/lib/python2.7/site-packages/rgt/HINT/Main.py", line 89, in main
    args.func(args)
  File "/home/ghovhannisyan/.local/lib/python2.7/site-packages/rgt/HINT/Footprinting.py", line 105, in footprinting_run
    atac_seq(args)
  File "/home/ghovhannisyan/.local/lib/python2.7/site-packages/rgt/HINT/Footprinting.py", line 252, in atac_seq
    min_length=None, max_length=145, strand=True)
ValueError: too many values to unpack

Any thoughts?

ADD REPLY
0
Entering edit mode

My first thought is that you and they should be using python 3 ;-)
Not sure if that is going to make any difference though.

I downloaded the code, and my second thought is that they should follow PEP8 style guidelines. Also not going to make any differences :-D

the error is caused by a construct like this:

a, b = my_function(args)

However, since my_function in this case only returns one value there is not enough data to 'fill' both a an b. And indeed, if I search for that function (defined in rgt/HINT/signalProcessing.py) that function conditionally returns one or two values. That's some odd design, but whatever. I'm not going further down the rabbit hole here and see why it errors... no time for that. But perhaps you should stick to bowtie?

ADD REPLY
0
Entering edit mode

agreed on python 3 :) Thanks anyways, I will post here if I find workaround.

ADD REPLY
0
Entering edit mode

So the first warning message is fixed by downgrading numpy. The main error still persists even when using bowtie2. Will try to email a developer and hope its not one of numerous abandoned bioinformatics packages...

ADD REPLY
0
Entering edit mode

I wouldn't worry too much about that warning. The last update on PyPI was made in July, so you might be lucky.

ADD REPLY

Login before adding your answer.

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