Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: 'NonType object has no attribute '__getitem__' #8

Open
stefandiederich opened this issue Jun 29, 2017 · 2 comments
Open

Comments

@stefandiederich
Copy link

stefandiederich commented Jun 29, 2017

Hi,

I try to use clamms to do CNV calling on our cohort of WES patients. At the annotate_windows.sh step I get the following error

Traceback (most recent call last): File "/media/Berechnungen/clamms/calc_window_mappability.py", line 54, in <module> while value[0] != window[0]: TypeError: 'NoneType' object has no attribute '__getitem__'

The script does its job until one specific entry in my regions.bed file. Here are the last lines processed:
6 170890177 170892276
6 170892593 170892835
6 170893143 170893314
6 170893387 170893780
6 170948694 170949624

The next lines would have been

6 171054606 171055065
7 182935 183108
7 183648 183814
7 192969 193804
7 193948 194180

When I delete the last entry of chromosome 6 (6 171054606 171055065) the script works until a position on chromosome 9. Is there any other way than deleting the error causing entrys to avoid this error?

Thanks in advance
Stefan

@rgcgithub
Copy link
Owner

Based on the fact that you have a target region @ 6:171054606-171055065, I'm guessing you are on hg19/Grch37 (Grch38 chr6 ends at 170805979). Are all of your input file parameters to annotate_windows on the same reference? Given failure at calc_window_mappability, it would specifically be one of the first three parameters (targets.bed, genome.fa, and/or mappability.bed). I'm curious if your chr9 offending region is also at the end.

The error is likely the result of regions where one of your input files has a region not represented in the other(s). If it's not a reference mismatch problem, make sure that a) all BED regions match up and are contained in the genome.fa index, and b) that only standard chromosomes (1-22,X,Y) are represented. Sometimes having e.g. a decoy chromosome in one file could break this script, so make sure cut -f 1 <file> | uniq gives similar output on each bed file (see "Troubleshooting windows.bed file generation" in the README for more details). Let me know if none of these solves the problem.

Thanks,
Evan

@thedam
Copy link

thedam commented May 30, 2018

Hi,
I have the same error, it stops on this value:
('7', 10000, 10011, 0.00218818)

I use such files:

my target.bed:
grep "^6" -A 2 -B 2 main.chroms.bed | tail -5
6 171048916 171049033
6 171054580 171054700
6 171054778 171055067
7 13744 14042
7 19784 19904

clamms.bed (from "data" folder):
grep -A 2 -B 3 -P "^6" clamms_special_regions.hg19.bed | tail -5
6 148978998 148994723 6
6 161243390 161268788 6
6 161276243 161282459 6
7 6900602 6923090 6
7 29692579 29740677 -1

UCSC's mappability.bed
grep "^6" -A 2 -B 2 mappability.bed | tail -5
6 171054932 171054994 0.1
6 171054994 171054995 0.166667
6 171054995 171055043 0.5
7 10000 10011 0.00218818
7 10011 10012 0.333333

part of the reference: hs37d5.fa.fai
6 171115067 1080251307 60 61
7 159138663 1254218344 60 61
8 146364022 1416009371 60 61

Which file is actually wrong?
the error says:

Traceback (most recent call last):
  File "/mnt/ssd_01/CNV/clamms/calc_window_mappability.py", line 54, in <module>
    while value[0] != window[0]:
TypeError: 'NoneType' object has no attribute '__getitem__'

and the last two printed variables, "value" and "window" are:

('6', 171054995, 171055043, 0.5), ('6', 171054778, 171055067, '\t6:171054778-171055067\t87\t0.437')
('7', 10000, 10011, 0.00218818), ('6', 171054778, 171055067, '\t6:171054778-171055067\t87\t0.437')

Thanks for any help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants