Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing read depth mean after filter_entries() #3573

Open
iris-garden opened this issue May 6, 2024 · 0 comments
Open

Missing read depth mean after filter_entries() #3573

iris-garden opened this issue May 6, 2024 · 0 comments
Labels
discourse migrated from discuss.hail.is

Comments

@iris-garden
Copy link
Owner

Note

The following post was exported from discuss.hail.is, a forum for asking questions about Hail which has since been deprecated.

(Dec 18, 2023 at 14:38) barioux said:

Hi all,

Just wondered if you had a way to calculate the distribution of the mean read depth across all loci. I get ‘nan’ for dp_stats.mean at mean and std dev as follows after applying filter_entries.

mt_filtered = mt.filter_entries(
((hl.is_snp(mt.alleles[0], mt.alleles[1]) & (mt.DP >= snv_min_coverage)) |
(hl.is_indel(mt.alleles[0], mt.alleles[1]) & (mt.DP >= indel_min_coverage)))
)

mt_filtered.variant_qc.dp_stats.summarize()

dp_stats.mean (float64 ):

Non-missing 63103 (100.00%)
Missing 0
Minimum 7.58
Maximum 91.90
Mean nan
Std Dev nan

Thanks in advance!

(Dec 18, 2023 at 19:29) danking said:

Hi barioux !

This means that dp_stats.mean is NaN for at least one variant. You can use hl.is_nan with filter_rows to filter to a variant with a NaN for its dp_stats.mean.

dp_stats.mean is defined as hl.agg.stats(mt.DP). hl.agg.stats(...).mean is usually NaN when every entry is filtered or has a missing DP field. compute_entry_filter_stats can provide insight into which rows contain only filtered entries.

In particular, you probably have a SNP or INDEL where none of the entries have the minimum coverage.

@iris-garden iris-garden added the discourse migrated from discuss.hail.is label May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discourse migrated from discuss.hail.is
Projects
None yet
Development

No branches or pull requests

1 participant