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: unsupported operand type(s) for +: 'int' and 'NoneType' #30

Open
Janehol opened this issue Jul 18, 2024 · 0 comments
Open

TypeError: unsupported operand type(s) for +: 'int' and 'NoneType' #30

Janehol opened this issue Jul 18, 2024 · 0 comments

Comments

@Janehol
Copy link

Janehol commented Jul 18, 2024

Hi! I am trying to use the krisp_vcf command but I am running into the below error message over and over again no matter how I alter my VCF file.

$ krisp_vcf krisp_metadata.csv Race_1.masked.fa --vcf SNPs_exclude_nonetype_merged_DNAs.vcf.gz --groups NA2 NA3 NA4 NA5 NA6 OTHR --out_csv krisp_SNPs_diagnostic_variants.csv
Traceback (most recent call last):
File "/home/holmesj/data/miniconda3/envs/py311/bin/krisp_vcf", line 8, in
sys.exit(main())
^^^^^^
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/krisp_vcf.py", line 1393, in main
run_all()
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/krisp_vcf.py", line 1383, in run_all
for result in report_diag_region(args.vcf, contig, groups, reference, args,
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/krisp_vcf.py", line 1193, in report_diag_region
for region in find_diag_region(variants, groups, reference, **kwargs):
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/krisp_vcf.py", line 791, in find_diag_region
for region in windower:
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/krisp_vcf.py", line 204, in sliding_window
for index, variant in enumerate(variants):
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/find_diag_var.py", line 196, in from_vcf
out = cls(var, groups, check_groups=False, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/find_diag_var.py", line 169, in init
self.allele_counts = self._allele_counts(variant, self.groups,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/find_diag_var.py", line 304, in _allele_counts
output[group] = GroupedVariant._count_genotypes(variant,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/holmesj/genomics/2-MISC-BY-USER/Janesse/krisp/src/krisp/krisp_vcf/find_diag_var.py", line 256, in _count_genotypes
min_depth = sum(data['AD']) * min_freq
^^^^^^^^^^^^^^^
TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

According to Google, "The NoneType object is a special type in Python that represents the absence of a value. In other words, NoneType is the type for the None object, which is an object that contains no value or defines a null value. It is used to indicate that a variable or expression does not have a value or has an undefined value."

So, I tried to filter out any undefined/missing data with the following command (I specified to keep MQ values as I received a previous error message saying "KeyError: 'invalid FORMAT: MQ"):

$vcftools --gzvcf SNPs_filtered_merged_DNAs.vcf.gz --max-missing 1.00 --recode --recode-INFO MQ --stdout | bgzip -c > SNPs_exclude_nonetype_merged_DNAs.vcf.gz

Even after the data is filtered, I still keep getting the "TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" message whenever I use the above krisp_vcf command. I am at a loss for how to fix this error. Can anyone provide some advice on what I am doing wrong?

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

1 participant