diff --git a/malariagen_data/af1.py b/malariagen_data/af1.py index a79b427b..f1d09ec1 100644 --- a/malariagen_data/af1.py +++ b/malariagen_data/af1.py @@ -12,7 +12,7 @@ GCS_REGION_URLS = { "us-central1": "gs://vo_afun_release_master_us_central1", } -XPEHH_GWSS_CACHE_NAME = "af1_xpehh_gwss_v1" +XPEHH_GWSS_CACHE_NAME = "af1_xpehh_gwss_v2" IHS_GWSS_CACHE_NAME = "af1_ihs_gwss_v2" TAXON_PALETTE = px.colors.qualitative.Plotly diff --git a/malariagen_data/ag3.py b/malariagen_data/ag3.py index 422726e0..09e31633 100644 --- a/malariagen_data/ag3.py +++ b/malariagen_data/ag3.py @@ -25,7 +25,7 @@ GCS_REGION_URLS = { "us-central1": "gs://vo_agam_release_master_us_central1", } -XPEHH_GWSS_CACHE_NAME = "ag3_xpehh_gwss_v1" +XPEHH_GWSS_CACHE_NAME = "ag3_xpehh_gwss_v2" IHS_GWSS_CACHE_NAME = "ag3_ihs_gwss_v2" VIRTUAL_CONTIGS = { "2RL": ("2R", "2L"), diff --git a/malariagen_data/anopheles.py b/malariagen_data/anopheles.py index 9eb26e76..15db88b9 100644 --- a/malariagen_data/anopheles.py +++ b/malariagen_data/anopheles.py @@ -1598,7 +1598,7 @@ def plot_ihs_gwss_track( ) def plot_xpehh_gwss( self, - contig: base_params.contig, + region: base_params.region, analysis: hap_params.analysis = base_params.DEFAULT, sample_sets: Optional[base_params.sample_sets] = None, cohort1_query: Optional[base_params.sample_query] = None, @@ -1635,7 +1635,7 @@ def plot_xpehh_gwss( ) -> gplt_params.optional_figure: # gwss track fig1 = self.plot_xpehh_gwss_track( - contig=contig, + region=region, analysis=analysis, sample_sets=sample_sets, cohort1_query=cohort1_query, @@ -1669,7 +1669,7 @@ def plot_xpehh_gwss( # plot genes fig2 = self.plot_genes( - region=contig, + region=region, sizing_mode=sizing_mode, width=width, height=genes_height, @@ -1812,7 +1812,7 @@ def plot_ihs_gwss( ) def xpehh_gwss( self, - contig: base_params.contig, + region: base_params.region, analysis: hap_params.analysis = base_params.DEFAULT, sample_sets: Optional[base_params.sample_sets] = None, cohort1_query: Optional[base_params.sample_query] = None, @@ -1842,7 +1842,7 @@ def xpehh_gwss( name = self._xpehh_gwss_cache_name params = dict( - contig=contig, + region=region, analysis=self._prep_phasing_analysis_param(analysis=analysis), window_size=window_size, percentiles=percentiles, @@ -1882,7 +1882,7 @@ def xpehh_gwss( def _xpehh_gwss( self, *, - contig, + region, analysis, sample_sets, cohort1_query, @@ -1904,7 +1904,7 @@ def _xpehh_gwss( inline_array, ): ds_haps1 = self.haplotypes( - region=contig, + region=region, analysis=analysis, sample_query=cohort1_query, sample_query_options=sample_query_options, @@ -1917,7 +1917,7 @@ def _xpehh_gwss( ) ds_haps2 = self.haplotypes( - region=contig, + region=region, analysis=analysis, sample_query=cohort2_query, sample_query_options=sample_query_options, @@ -1988,7 +1988,7 @@ def _xpehh_gwss( ) def plot_xpehh_gwss_track( self, - contig: base_params.contig, + region: base_params.region, analysis: hap_params.analysis = base_params.DEFAULT, sample_sets: Optional[base_params.sample_sets] = None, cohort1_query: Optional[base_params.sample_query] = None, @@ -2023,7 +2023,7 @@ def plot_xpehh_gwss_track( ) -> gplt_params.optional_figure: # compute xpehh x, xpehh = self.xpehh_gwss( - contig=contig, + region=region, analysis=analysis, window_size=window_size, percentiles=percentiles, @@ -2116,7 +2116,7 @@ def plot_xpehh_gwss_track( # tidy up the plot fig.yaxis.axis_label = "XP-EHH" - self._bokeh_style_genome_xaxis(fig, contig) + self._bokeh_style_genome_xaxis(fig, region) if show: # pragma: no cover bokeh.plotting.show(fig) diff --git a/notebooks/plot_xpehh_gwss.ipynb b/notebooks/plot_xpehh_gwss.ipynb index cd9e6758..2155ea07 100644 --- a/notebooks/plot_xpehh_gwss.ipynb +++ b/notebooks/plot_xpehh_gwss.ipynb @@ -40,7 +40,7 @@ "outputs": [], "source": [ "ag3.plot_xpehh_gwss(\n", - " contig=\"X\",\n", + " region=\"X\",\n", " window_size=1_000,\n", " analysis=\"gamb_colu\",\n", " percentiles=(50, 60, 90, 100),\n", @@ -59,7 +59,7 @@ "outputs": [], "source": [ "ag3.plot_xpehh_gwss_track(\n", - " contig=\"X\",\n", + " region=\"X\",\n", " window_size=1_000,\n", " analysis=\"gamb_colu\",\n", " cohort1_query=\"cohort_admin2_year == 'ML-2_Kati_colu_2014'\",\n", @@ -80,7 +80,7 @@ "outputs": [], "source": [ "ag3.plot_xpehh_gwss(\n", - " contig=\"X\",\n", + " region=\"X\",\n", " window_size=100,\n", " analysis=\"gamb_colu\",\n", " cohort1_query=\"cohort_admin2_year == 'ML-2_Kati_colu_2014'\",\n", @@ -98,7 +98,7 @@ "outputs": [], "source": [ "ag3.plot_xpehh_gwss(\n", - " contig=\"2RL\",\n", + " region=\"2RL\",\n", " window_size=100,\n", " analysis=\"gamb_colu\",\n", " cohort1_query=\"cohort_admin2_year == 'ML-2_Kati_colu_2014'\",\n", @@ -116,7 +116,7 @@ "outputs": [], "source": [ "ag3.plot_xpehh_gwss(\n", - " contig=\"X\",\n", + " region=\"X\",\n", " window_size=1_000,\n", " analysis=\"gamb_colu\",\n", " cohort1_query=\"cohort_admin2_year == 'ML-2_Kati_colu_2014'\",\n", @@ -145,7 +145,7 @@ "outputs": [], "source": [ "af1.plot_xpehh_gwss(\n", - " contig=\"X\",\n", + " region=\"X\",\n", " window_size=2_000,\n", " cohort1_query=\"cohort_admin1_year == 'MZ-L_fune_2018'\",\n", " cohort2_query=\"cohort_admin1_year == 'GA-2_fune_2017'\",\n", @@ -162,7 +162,7 @@ "outputs": [], "source": [ "af1.plot_xpehh_gwss(\n", - " contig=\"2RL\",\n", + " region=\"2RL\",\n", " window_size=200,\n", " cohort1_query=\"cohort_admin1_year == 'MZ-L_fune_2018'\",\n", " cohort2_query=\"cohort_admin1_year == 'GA-2_fune_2017'\",\n", @@ -182,7 +182,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "mgen_data_py3.11", "language": "python", "name": "python3" }, @@ -196,7 +196,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.11.5" }, "widgets": { "application/vnd.jupyter.widget-state+json": { diff --git a/tests/integration/test_ag3.py b/tests/integration/test_ag3.py index 40bf467b..ae3681fe 100644 --- a/tests/integration/test_ag3.py +++ b/tests/integration/test_ag3.py @@ -138,7 +138,7 @@ def test_xpehh_gwss(): window_size = 1000 x, xpehh = ag3.xpehh_gwss( - contig=contig, + region=contig, analysis=analysis, cohort1_query=cohort1_query, cohort2_query=cohort2_query,