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: '<' not supported between instances of 'RecombinationEvent' and 'RecombinationEvent' #394

Closed
PengJia6 opened this issue Aug 19, 2022 · 3 comments

Comments

@PengJia6
Copy link

Hi !

I report an error when I use whatshap phase command.

  • whatshap 1.1
  • Python 3.7.10
  • command
    whatshap phase  --recombination-list  child.phased.vcf.gz.rec.list --indels -r GRCh38_full_analysis_set_plus_decoy_hla.fa --ped Quartet.ped  -o  Quartet.child.phased.vcf.gz  Quartet.minimap2.dv.pass.vcf.gz ChineseQuartet.LCL5.GRCh38.minimap2.bam ChineseQuartet.LCL6.GRCh38.minimap2.bam
    
  • Note:
    The vcf file includes a family of four samples, two daughters and their biological parents.
  • Error:
Cost accounted for by recombination events: 432
Traceback (most recent call last):
  File "/data/home/pengjia/miniconda3/envs/default/bin/whatshap", line 10, in <module>
    sys.exit(main())
  File "/data/home/pengjia/miniconda3/envs/default/lib/python3.7/site-packages/whatshap/__main__.py", line 83, in main
    module.main(args)
  File "/data/home/pengjia/miniconda3/envs/default/lib/python3.7/site-packages/whatshap/cli/phase.py", line 1107, in main
    run_whatshap(**vars(args))
  File "/data/home/pengjia/miniconda3/envs/default/lib/python3.7/site-packages/whatshap/cli/phase.py", line 565, in run_whatshap
    trios,
  File "/data/home/pengjia/miniconda3/envs/default/lib/python3.7/site-packages/whatshap/cli/phase.py", line 923, in write_recombination_list
    recombination_costs,
  File "/data/home/pengjia/miniconda3/envs/default/lib/python3.7/site-packages/whatshap/pedigree.py", line 160, in find_recombination
    event_list.sort()
TypeError: '<' not supported between instances of 'RecombinationEvent' and 'RecombinationEvent'

Thanks!

Peng Jia

@marcelm
Copy link
Contributor

marcelm commented Aug 19, 2022

Do you think you can make the data available somewhere so we can reproduce this more easily? The full dataset is fine, but even better would be a reduced dataset that still shows the error.

@marcelm
Copy link
Contributor

marcelm commented Aug 22, 2022

Hi again and thanks for the report. I have found the problem and fixed it in the development version of WhatsHap. I will release version 1.5 that contains the fix.

marcelm added a commit that referenced this issue Aug 22, 2022
This was caused by the conversion of RecombinationEvent from namedtuple to a
dataclass (first version with this change was 1.1), losing the ability to
compare instances. This is fixed by setting "order=True" on the dataclass.

Closes issue #394
@marcelm marcelm closed this as completed Aug 22, 2022
@PengJia6
Copy link
Author

Thanks!

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

2 participants