Skip to content

Commit

Permalink
Merge pull request #331 from leehart/GH313_Af1_haplotypes
Browse files Browse the repository at this point in the history
Refactor haplotypes functions to support Af1
  • Loading branch information
leehart authored Feb 6, 2023
2 parents 6e951d1 + 1e0573b commit 0927836
Show file tree
Hide file tree
Showing 9 changed files with 2,572 additions and 2,632 deletions.
18 changes: 10 additions & 8 deletions malariagen_data/af1.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
PCA_RESULTS_CACHE_NAME = "af1_pca_v1"
SNP_ALLELE_COUNTS_CACHE_NAME = "af1_snp_allele_counts_v2"
FST_GWSS_CACHE_NAME = "af1_fst_gwss_v1"
H12_CALIBRATION_CACHE_NAME = "af1_h12_calibration_v1"
H12_GWSS_CACHE_NAME = "af1_h12_gwss_v1"
H1X_GWSS_CACHE_NAME = "af1_h1x_gwss_v1"

DEFAULT_SITE_MASK = "funestus"


Expand Down Expand Up @@ -101,10 +105,16 @@ class Af1(AnophelesDataResource):
_pca_results_cache_name = PCA_RESULTS_CACHE_NAME
_snp_allele_counts_results_cache_name = SNP_ALLELE_COUNTS_CACHE_NAME
_fst_gwss_results_cache_name = FST_GWSS_CACHE_NAME
_h12_calibration_cache_name = H12_CALIBRATION_CACHE_NAME
_h12_gwss_cache_name = H12_GWSS_CACHE_NAME
_h1x_gwss_cache_name = H1X_GWSS_CACHE_NAME
site_mask_ids = ("funestus",)
_default_site_mask = DEFAULT_SITE_MASK
_site_annotations_zarr_path = SITE_ANNOTATIONS_ZARR_PATH
_cohorts_analysis = None
_site_filters_analysis = None
phasing_analysis_ids = ("funestus",)
_default_phasing_analysis = "funestus"

def __init__(
self,
Expand Down Expand Up @@ -256,14 +266,6 @@ def _transcript_to_gene_name(self, transcript):

return parent_name

def _site_mask_ids(self):
if self._site_filters_analysis == "dt_20200416":
return ["funestus"]
elif self._site_filters_analysis == "sc_20220908":
return ["funestus"]
else:
raise ValueError

def genome_features(
self, region=None, attributes=("ID", "Parent", "Note", "description")
):
Expand Down
Loading

0 comments on commit 0927836

Please sign in to comment.