Skip to content

Commit

Permalink
Merge branch 'master' of github.com:malariagen/malariagen-data-python
Browse files Browse the repository at this point in the history
  • Loading branch information
alimanfoo committed Jul 29, 2021
2 parents e5a8a8a + b27624b commit f3c3404
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 149 deletions.
3 changes: 3 additions & 0 deletions malariagen_data/ag3.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,9 @@ def snp_allele_frequencies(
for coh, query in cohorts.items():
# locate samples
loc_coh = df_meta.eval(query).values
n_samples = np.count_nonzero(loc_coh)
if n_samples == 0:
raise ValueError(f"no samples for cohort {coh!r}")
gt_coh = np.compress(loc_coh, gt, axis=1)
# count alleles
ac_coh = allel.GenotypeArray(gt_coh).count_alleles(max_allele=3)
Expand Down
Loading

0 comments on commit f3c3404

Please sign in to comment.