divbrowse.lib.variant_calls_slice

Module Contents

Functions

with_gd()

divbrowse.lib.variant_calls_slice.with_gd()
class divbrowse.lib.variant_calls_slice.VariantCallsSlice
gd :GenotypeData
type_of_slice :str = range
positional_lookup_success :bool = True
sliced_variant_calls :numpy.ndarray
positions :numpy.ndarray
positions_indices :numpy.ndarray
positions_not_found :numpy.ndarray
location_start :int
location_end :int
samples_mask :numpy.ndarray
samples_selected_mapped :list
variant_filter_settings :dict
calls_metadata :dict
calc_summary_stats :bool = False
__post_init__()
static calculate_mean(slice_of_variant_calls: numpy.ndarray) numpy.ndarray

Calculate the mean for each variant of a variant matrix array holding the number of alternate alleles

Note

Missing variant calls are excluded from the mean calculation

Parameters

slice_of_variant_calls (numpy.ndarray) – Numpy array representing a variant matrix holding the number of alternate allele calls

Returns

Numpy array holding the means per variant

Return type

numpy.ndarray

count_alternate_alleles()

Returns a tupel consisting of a boolean mask for found sample Ids and a list of mapped sample IDs

Parameters

sliced_variant_calls (numpy.ndarray) – variant matrix array holding the allele calls (0/0 0/1 1/1)

Returns

variant matrix array holding the number of alternate allele calls

Return type

numpy.ndarray

calculate_minor_allele_freq()

Calculates minor allele frequency

Returns

Numpy array (1d) holding the calculated minor allele frequencies per each variant

Return type

numpy.ndarray

calc_variants_summary_stats()
calc_variants_summary_stats_numpy()
calc_variants_summary_stats_scikitallel()
apply_variant_filter_settings()
add_stats()
get_stats_dict()
get_data()