From c52f90b371ca03a410251d269bc4bb4e170c9c8e Mon Sep 17 00:00:00 2001 From: Shadi Date: Thu, 21 Sep 2023 18:36:41 -0400 Subject: [PATCH 1/7] Update setup.py Adding explicit flag for `language_level="3"`. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 00f7c7c..e2a1a3e 100644 --- a/setup.py +++ b/setup.py @@ -26,6 +26,6 @@ packages=[name], include_package_data=True, url='https://github.com/23andme/' + name, - ext_modules=cythonize([Extension('phasedibd.*', ['phasedibd/*.pyx'], include_dirs=[np.get_include()])]), + ext_modules=cythonize([Extension('phasedibd.*', ['phasedibd/*.pyx'], include_dirs=[np.get_include()])], language_level="3"), include_dirs=[np.get_include()] ) From e2e58246a651d9aee5dc2028fd6b073cb77fefa4 Mon Sep 17 00:00:00 2001 From: Shadi Date: Thu, 21 Sep 2023 18:37:04 -0400 Subject: [PATCH 2/7] Update compressed_haplotype_alignment.pxd Added absolute path --- phasedibd/compressed_haplotype_alignment.pxd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phasedibd/compressed_haplotype_alignment.pxd b/phasedibd/compressed_haplotype_alignment.pxd index a167366..8e1d912 100644 --- a/phasedibd/compressed_haplotype_alignment.pxd +++ b/phasedibd/compressed_haplotype_alignment.pxd @@ -1,6 +1,6 @@ from libc.stdint cimport uint8_t, uint16_t, uint32_t from libc.stdio cimport * -from haplotype_alignment cimport HaplotypeAlignment +from .haplotype_alignment cimport HaplotypeAlignment cdef class CompressedHaplotypeAlignment(HaplotypeAlignment): From dc5614c9e15b91e183a3118bf1615ba2818c0914 Mon Sep 17 00:00:00 2001 From: Shadi Date: Thu, 21 Sep 2023 18:37:52 -0400 Subject: [PATCH 3/7] Update templated_pbwt_analysis.pxd Added absolute paths --- phasedibd/templated_pbwt_analysis.pxd | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phasedibd/templated_pbwt_analysis.pxd b/phasedibd/templated_pbwt_analysis.pxd index 8600512..064151b 100644 --- a/phasedibd/templated_pbwt_analysis.pxd +++ b/phasedibd/templated_pbwt_analysis.pxd @@ -1,8 +1,8 @@ from libc.stdio cimport * -from haplotype_alignment cimport HaplotypeAlignment -from compressed_haplotype_alignment cimport CompressedHaplotypeAlignment -from vcf_haplotype_alignment cimport VcfHaplotypeAlignment +from .haplotype_alignment cimport HaplotypeAlignment +from .compressed_haplotype_alignment cimport CompressedHaplotypeAlignment +from .vcf_haplotype_alignment cimport VcfHaplotypeAlignment from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t From 1cd711352789fe298d0a5381d0791c3e9ffcf276 Mon Sep 17 00:00:00 2001 From: Shadi Date: Thu, 21 Sep 2023 18:38:17 -0400 Subject: [PATCH 4/7] Update vcf_haplotype_alignment.pxd Added absolute paths --- phasedibd/vcf_haplotype_alignment.pxd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phasedibd/vcf_haplotype_alignment.pxd b/phasedibd/vcf_haplotype_alignment.pxd index 19dec4e..2e1c9ef 100644 --- a/phasedibd/vcf_haplotype_alignment.pxd +++ b/phasedibd/vcf_haplotype_alignment.pxd @@ -2,7 +2,7 @@ from libc.stdint cimport uint8_t, uint32_t from libc.stdio cimport * from libc.stdlib cimport * from libc.string cimport * -from haplotype_alignment cimport HaplotypeAlignment +from .haplotype_alignment cimport HaplotypeAlignment cdef class VcfHaplotypeAlignment(HaplotypeAlignment): From 07505c3551b49384c28f85ff19ac4200828898e5 Mon Sep 17 00:00:00 2001 From: Shadi Date: Thu, 21 Sep 2023 18:38:33 -0400 Subject: [PATCH 5/7] Update vcf_haplotype_alignment.pyx Added absolute paths --- phasedibd/vcf_haplotype_alignment.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phasedibd/vcf_haplotype_alignment.pyx b/phasedibd/vcf_haplotype_alignment.pyx index f591a01..f5f76dc 100644 --- a/phasedibd/vcf_haplotype_alignment.pyx +++ b/phasedibd/vcf_haplotype_alignment.pyx @@ -1,7 +1,7 @@ # cython: profile=True from libc.stdlib cimport malloc, free -from haplotype_alignment cimport HaplotypeAlignment +from .haplotype_alignment cimport HaplotypeAlignment import numpy as np cimport numpy as np import pandas as pd From bca2b47cd6a14602bccbddd80684706860c7df21 Mon Sep 17 00:00:00 2001 From: Shadi Date: Thu, 21 Sep 2023 18:40:14 -0400 Subject: [PATCH 6/7] Update templated_pbwt_analysis.pyx Making sure division of integers remains an integer. --- phasedibd/templated_pbwt_analysis.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phasedibd/templated_pbwt_analysis.pyx b/phasedibd/templated_pbwt_analysis.pyx index a4863d6..2340667 100644 --- a/phasedibd/templated_pbwt_analysis.pyx +++ b/phasedibd/templated_pbwt_analysis.pyx @@ -90,7 +90,7 @@ cdef class TPBWT: free(self.segments_end_bp) cdef uint32_t num_cols if self.current_matches_start != NULL: - num_cols = sizeof(self.current_matches_start)/sizeof(self.current_matches_start[0]) + num_cols = sizeof(self.current_matches_start)//sizeof(self.current_matches_start[0]) for i in xrange(num_cols): free(self.current_matches_start[i]) free(self.current_matches_end[i]) @@ -162,7 +162,7 @@ cdef class TPBWT: # first free any already allocated memory if self.current_matches_start != NULL: - num_rows = sizeof(self.current_matches_start)/sizeof(self.current_matches_start[0]) + num_rows = sizeof(self.current_matches_start)//sizeof(self.current_matches_start[0]) for i in xrange(num_rows): free(self.current_matches_start[i]) free(self.current_matches_end[i]) From c663adf6a3e50f0d47ec7e2adeb21ee0e6d26acc Mon Sep 17 00:00:00 2001 From: Shadi Date: Thu, 21 Sep 2023 18:52:30 -0400 Subject: [PATCH 7/7] Create requirements.txt Added package requirements. --- requirements.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..4e66cbf --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +pandas==1.2.3 +numpy==1.20.2 +cython==0.29.23