ase#

ASE data analysis with expression bias calculation

class ase.ASEAnalysis#

Base class for ASE data analysis

get_a_t()#

Returns the alternative and the total counts

get_all(genes, min_t=0)#

Returns multiple calculated parameters

Parameters#

genes: list(dict)

A list of gene dictionaries with elements ‘id’, ‘seq_region_name’, ‘start’ and ‘end’, like the ones obtained from Ensembl requests

min_t: int

The minimum total count for SNPs considered for a cell

Returns#

a, t: pd.DataFrame, pd.DataFrame

The alternative and the total counts per SNP (rows) and cell (cloumns)

bij: pd.DataFrame

The calculated expression bias per SNP (rows) and cell (columns)

snps: pd.DataFrame

The SNP chromosomes and positions

bj: pd.DataFrame

The calculated expression bias per gene (rows) and cell (columns)

bj_t: pd.DataFrame

The totac counts per gene (rows) and cell (columns)

get_altcount_totcount()#

Returns the alternative and the total counts

get_bias_per_gene(genes, min_t=0)#

Returns the calculated expression bias per gene and cell

Parameters#

genes: list(dict)

A list of gene dictionaries with elements ‘id’, ‘seq_region_name’, ‘start’ and ‘end’, like the ones obtained from Ensembl requests

min_t: int

The minimum total count for SNPs considered for a cell

Returns#

bj: pd.DataFrame

The calculated expression bias per gene (rows) and cell (columns)

bj_t: pd.DataFrame

The sum of weights per gene (rows) and cell (columns), which is the sum of total counts for the SNPs considered for a gene

get_bias_per_snp()#

Returns the calculated expression bias per SNP and cell

get_bij()#

Returns the calculated expression bias per SNP and cell

get_bj(genes, min_t=0)#

Returns the calculated expression bias per gene and cell

Parameters#

genes: list(dict)

A list of gene dictionaries with elements ‘id’, ‘seq_region_name’, ‘start’ and ‘end’, like the ones obtained from Ensembl requests

min_t: int

The minimum total count for SNPs considered for a cell

Returns#

bj: pd.DataFrame

The calculated expression bias per gene (rows) and cell (columns)

bj_t: pd.DataFrame

The sum of weights per gene (rows) and cell (columns), which is the sum of total counts for the SNPs considered for a gene

get_snps()#

Returns the SNP chromosomes and positions

class ase.ASEMultipleDonorsAnalysis(analyses, n_cpu=None)#

Analyse ASE data for multiple donors

get_a_t()#

Returns the alternative and the total counts

get_bij()#

Returns the calculated expression bias per SNP and cell

get_bj(genes, min_t=0)#

Returns the calculated expression bias per gene and cell

Parameters#

genes: list(dict)

A list of gene dictionaries with elements ‘id’, ‘seq_region_name’, ‘start’ and ‘end’, like the ones obtained from Ensembl requests

min_t: int

The minimum total count for SNPs considered for a cell

Returns#

bj: pd.DataFrame

The calculated expression bias per gene (rows) and cell (columns)

bj_t: pd.DataFrame

The sum of weights per gene (rows) and cell (columns), which is the sum of total counts for the SNPs considered for a gene

get_snps()#

Returns the SNP chromosomes and positions

class ase.ASESingleDonorAnalysis(a_file_paths, t_file_paths)#

Analyse ASE data for one donor

get_a_t()#

Returns the alternative and the total counts

get_bij()#

Returns the calculated expression bias per SNP and cell

get_bj(genes, min_t=0)#

Returns the calculated expression bias per gene and cell

Parameters#

genes: list(dict)

A list of gene dictionaries with elements ‘id’, ‘seq_region_name’, ‘start’ and ‘end’, like the ones obtained from Ensembl requests

min_t: int

The minimum total count for SNPs considered for a cell

Returns#

bj: pd.DataFrame

The calculated expression bias per gene (rows) and cell (columns)

bj_t: pd.DataFrame

The sum of weights per gene (rows) and cell (columns), which is the sum of total counts for the SNPs considered for a gene

get_snps()#

Returns the SNP chromosomes and positions

ase.get_bias(bj, bj_t, cell_populations, min_t=0)#

Calculates mean and average expression bias

Parameters#

bj: pd.DataFrame

The expression bias per gene (rows) and cell (columns)

bj_t: pd.DataFrame

The total counts for the SNPs considered for a gene per gene (rows) and cell (columns)

cell_poulations: dict(key: list(str))

A dictionary of cell populations with arbitrary keys and the cell ids of the cell populations as values

min_t: int

The minimum total count for cells considered for the calculation of mean and average expression bias

Returns#

b_mean: pd.DataFrame

The mean expression bias per gene (rows) and cell population (columns)

b_variance: pd.DataFrame

The variance of mean expression bias per gene (rows) and cell population (columns)

b_n: pd.DataFrame

The number of cells considered per gene (rows) and cell population (columns)

b_average: pd.DataFrame

The average expression bias per gene (rows) and cell population (columns)

b_t: pd.DataFrame

The total counts for the SNPs considered per gene (rows) and cell population (columns)

b_cell_populations: dict(key: list(str))

A dictionary of cell populations with only the cells considered (after the cut on ‘min_t’)