From 8569e0ccd949d4d7109171964e09825f615c1680 Mon Sep 17 00:00:00 2001 From: fellen31 Date: Thu, 14 Nov 2024 11:49:26 +0100 Subject: [PATCH] Fix sorting of variants --- CHANGELOG.md | 2 +- genmod/vcf_tools/sort_variants.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c845c5..ba04150 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ Try to use the following format: - The optional fields Source and Version are allowed in the VCF header([#106](https://github.com/Clinical-Genomics/genmod/pull/106)) - Released the constraint on Python 3.8 (collections, pkg_resources to importlib, tests) ([#142](https://github.com/Clinical-Genomics/genmod/pull/142)) - Update annotation examples ([#144](https://github.com/Clinical-Genomics/genmod/pull/144)) - +- Fixed sorting of variants ([#152](https://github.com/Clinical-Genomics/genmod/pull/152)) ## [3.9] - Fixed wrong models when chromosome X was named `chrX` and not `X` ([#135](https://github.com/Clinical-Genomics/genmod/pull/135)) diff --git a/genmod/vcf_tools/sort_variants.py b/genmod/vcf_tools/sort_variants.py index 3c90220..69e954d 100755 --- a/genmod/vcf_tools/sort_variants.py +++ b/genmod/vcf_tools/sort_variants.py @@ -40,9 +40,8 @@ def sort_variants(infile, mode='chromosome'): 'sort', ] if mode == 'chromosome': - command.append('-n') - command.append('-k1') - command.append('-k3') + command.append('-k1,1V') # Version sorting to deal with e.g. Un_* contigs + command.append('-k3,3n') # Sorting positions numerically elif mode == 'rank': command.append('-rn')