When trying to build, I'm getting an error from within malariagen_data - not quite sure whats going on...
I am using the new environment. Have tried removing the previous cache and the old build/ folder. The error also occurs with both joined contigs (2RL) and not joined (2R).
CacheMiss Traceback (most recent call last)
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anopheles.py:5846, in AnophelesDataResource.h12_calibration(self, contig, analysis, sample_query, sample_sets, cohort_size, min_cohort_size, max_cohort_size, window_sizes, random_seed)
5845 try:
-> 5846 calibration_runs = self.results_cache_get(name=name, params=params)
5848 except CacheMiss:
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anopheles.py:853, in AnophelesDataResource.results_cache_get(self, name, params)
852 if not results_path.exists():
--> 853 raise CacheMiss
854 results = np.load(results_path)
CacheMiss:
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
Cell In[13], line 1
----> 1 ag3.plot_h12_calibration(
2 contig=h12_calibration_contig,
3 analysis=phasing_analysis,
4 sample_sets=sample_sets,
5 sample_query=sample_query,
6 min_cohort_size=min_cohort_size,
7 max_cohort_size=max_cohort_size,
8 window_sizes=window_sizes,
9 );
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anopheles.py:5915, in AnophelesDataResource.plot_h12_calibration(self, contig, analysis, sample_query, sample_sets, cohort_size, min_cohort_size, max_cohort_size, window_sizes, random_seed, title, show)
5889 @doc(
5890 summary="Plot h12 GWSS calibration data for different window sizes.",
5891 parameters=dict(
(...)
5913 ) -> gplt_params.figure:
5914 # get H12 values
-> 5915 calibration_runs = self.h12_calibration(
5916 contig=contig,
5917 analysis=analysis,
5918 sample_query=sample_query,
5919 sample_sets=sample_sets,
5920 window_sizes=window_sizes,
5921 cohort_size=cohort_size,
5922 min_cohort_size=min_cohort_size,
5923 max_cohort_size=max_cohort_size,
5924 random_seed=random_seed,
5925 )
5927 # compute summaries
5928 q50 = [np.median(calibration_runs[str(window)]) for window in window_sizes]
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anopheles.py:5849, in AnophelesDataResource.h12_calibration(self, contig, analysis, sample_query, sample_sets, cohort_size, min_cohort_size, max_cohort_size, window_sizes, random_seed)
5846 calibration_runs = self.results_cache_get(name=name, params=params)
5848 except CacheMiss:
-> 5849 calibration_runs = self._h12_calibration(**params)
5850 self.results_cache_set(name=name, params=params, results=calibration_runs)
5852 return calibration_runs
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anopheles.py:5867, in AnophelesDataResource._h12_calibration(self, contig, analysis, sample_query, sample_sets, cohort_size, min_cohort_size, max_cohort_size, window_sizes, random_seed)
5854 def _h12_calibration(
5855 self,
5856 contig,
(...)
5865 ):
5866 # access haplotypes
-> 5867 ds_haps = self.haplotypes(
5868 region=contig,
5869 sample_sets=sample_sets,
5870 sample_query=sample_query,
5871 analysis=analysis,
5872 cohort_size=cohort_size,
5873 min_cohort_size=min_cohort_size,
5874 max_cohort_size=max_cohort_size,
5875 random_seed=random_seed,
5876 )
5878 gt = allel.GenotypeDaskArray(ds_haps["call_genotype"].data)
5879 with self._dask_progress(desc="Load haplotypes"):
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anopheles.py:5717, in AnophelesDataResource.haplotypes(self, region, analysis, sample_sets, sample_query, inline_array, chunks, cohort_size, min_cohort_size, max_cohort_size, random_seed)
5715 debug("normalise parameters")
5716 sample_sets = self._prep_sample_sets_param(sample_sets=sample_sets)
-> 5717 resolved_region = self.resolve_region(region)
5718 del region
5720 if isinstance(resolved_region, Region):
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anopheles.py:1736, in AnophelesDataResource.resolve_region(self, region)
1731 @doc(
1732 summary="Convert a genome region into a standard data structure.",
1733 returns="An instance of the `Region` class.",
1734 )
1735 def resolve_region(self, region: base_params.region) -> Region:
-> 1736 return resolve_region(self, region)
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/util.py:436, in resolve_region(resource, region)
433 raise TypeError("The region parameter must be a string or Region object.")
435 # check if region is a whole contig
--> 436 if region in _valid_contigs(resource):
437 return Region(region, None, None)
439 # check if region is a region string providing coordinates
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/util.py:406, in _valid_contigs(resource)
404 def _valid_contigs(resource):
405 """Determine which contig identifiers are valid for the given data resource."""
--> 406 valid_contigs = resource.contigs
407 # allow for optional virtual contigs
408 valid_contigs += getattr(resource, "virtual_contigs", ())
File ~/projects/selection-atlas/.snakemake/conda/becd6af5994f9e79c1329307d32adf4a_/lib/python3.10/site-packages/malariagen_data/anoph/genome_sequence.py:23, in AnophelesGenomeSequenceData.contigs(self)
21 @property
22 def contigs(self) -> Tuple[str, ...]:
---> 23 return tuple(self.config["CONTIGS"])
KeyError: 'CONTIGS'