Skip to content

Commit

Permalink
🐛 fix various type annotation bugs (intersphinx linking)
Browse files Browse the repository at this point in the history
need to be valid types (typos) or module.objects (missing module name)
  • Loading branch information
enryH committed Sep 4, 2024
1 parent 18b6751 commit 38a66f0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions acore/correlation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def calculate_correlations(x, y, method='pearson'):
"""
Calculates a Spearman (nonparametric) or a Pearson (parametric) correlation coefficient and p-value to test for non-correlation.
:param ndarray x: array 1
:param ndarray y: array 2
:param numpy.ndarray x: array 1
:param numpy.ndarray y: array 2
:param str method: chooses which kind of correlation method to run
:return: Tuple with two floats, correlation coefficient and two-tailed p-value.
Expand All @@ -37,8 +37,8 @@ def run_correlation(df, alpha=0.05, subject='subject', group='group', method='pe
:param str subject: name of column containing subject identifiers.
:param str group: name of column containing group identifiers.
:param str method: method to use for correlation calculation ('pearson', 'spearman').
:param floar alpha: error rate. Values velow alpha are considered significant.
:param string correction: type of correction see apply_pvalue_correction for methods
:param float alpha: error rate. Values velow alpha are considered significant.
:param str correction: type of correction see apply_pvalue_correction for methods
:return: Pandas dataframe with columns: 'node1', 'node2', 'weight', 'padj' and 'rejected'.
Example::
Expand Down Expand Up @@ -83,7 +83,7 @@ def run_multi_correlation(df_dict, alpha=0.05, subject='subject', on=['subject',
:param list on: column names to join dataframes on (must be found in all dataframes).
:param str method: method to use for correlation calculation ('pearson', 'spearman').
:param float alpha: error rate. Values velow alpha are considered significant.
:param string correction: type of correction see apply_pvalue_correction for methods
:param str correction: type of correction see apply_pvalue_correction for methods
:return: Pandas dataframe with columns: 'node1', 'node2', 'weight', 'padj' and 'rejected'.
Example::
Expand Down Expand Up @@ -131,7 +131,7 @@ def run_rm_correlation(df, alpha=0.05, subject='subject', correction='fdr_bh'):
:param df: pandas dataframe with samples as rows and features as columns.
:param str subject: name of column containing subject identifiers.
:param float alpha: error rate. Values velow alpha are considered significant.
:param string correction: type of correction type see apply_pvalue_correction for methods
:param str correction: type of correction type see apply_pvalue_correction for methods
:return: Pandas dataframe with columns: 'node1', 'node2', 'weight', 'pvalue', 'dof', 'padj' and 'rejected'.
Example::
Expand Down
6 changes: 3 additions & 3 deletions acore/differential_regulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def run_repeated_measurements_anova(
:param df: pandas dataframe with samples as rows and protein identifiers as columns (with additional columns 'group', 'sample' and 'subject').
:param str subject: column with subject identifiers
:param srt within: column with within factor identifiers
:param str within: column with within factor identifiers
:param list drop_cols: column labels to be dropped from the dataframe
:param float alpha: error rate for multiple hypothesis correction
:param int permutations: number of permutations used to estimate false discovery rates
Expand Down Expand Up @@ -488,8 +488,8 @@ def run_mixed_anova(
:param df: pandas dataframe with samples as rows and protein identifiers as columns (with additional columns 'group', 'sample' and 'subject').
:param str subject: column with subject identifiers
:param srt within: column with within factor identifiers
:param srt between: column with between factor identifiers
:param str within: column with within factor identifiers
:param str between: column with between factor identifiers
:param list drop_cols: column labels to be dropped from the dataframe
:param float alpha: error rate for multiple hypothesis correction
:param int permutations: number of permutations used to estimate false discovery rates
Expand Down
4 changes: 2 additions & 2 deletions acore/exploratory_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def calculate_coefficient_variation(values):
deviation to the mean, in percentage. For more information
visit https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.variation.html.
:param ndarray values: numpy array
:param numpy.ndarray values: numpy array
:return: The calculated variation along rows.
:rtype: ndarray
:rtype: numpy.ndarray
Example::
Expand Down
2 changes: 1 addition & 1 deletion acore/imputation_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def imputation_KNN(data, drop_cols=['group', 'sample', 'subject'], group='group'
:param str group: column label containing group identifiers.
:param list drop_cols: column labels to be dropped. Final dataframe should only have gene/protein/etc identifiers as columns.
:param float cutoff: minimum ratio of missing/valid values required to impute in each column.
:param boolean alone: if True removes all columns with any missing values.
:param bool alone: if True removes all columns with any missing values.
:return: Pandas dataframe with samples as rows and protein identifiers as columns.
Example::
Expand Down
8 changes: 4 additions & 4 deletions acore/multiple_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def apply_pvalue_correction(pvalues, alpha=0.05, method='bonferroni'):
"""
Performs p-value correction using the specified method. For more information visit https://www.statsmodels.org/dev/generated/statsmodels.stats.multitest.multipletests.html.
:param ndarray pvalues: et of p-values of the individual tests.
:param numpy.ndarray pvalues: et of p-values of the individual tests.
:param float alpha: error rate.
:param str method: method of p-value correction:
- bonferroni : one-step correction
Expand Down Expand Up @@ -42,7 +42,7 @@ def apply_pvalue_fdrcorrection(pvalues, alpha=0.05, method='indep'):
"""
Performs p-value correction for false discovery rate. For more information visit https://www.statsmodels.org/devel/generated/statsmodels.stats.multitest.fdrcorrection.html.
:param ndarray pvalues: et of p-values of the individual tests.
:param numpy.ndarray pvalues: et of p-values of the individual tests.
:param float alpha: error rate.
:param str method: method of p-value correction ('indep', 'negcorr').
:return: Tuple with two arrays, boolen for rejecting H0 hypothesis and float for adjusted p-value.
Expand All @@ -60,7 +60,7 @@ def apply_pvalue_twostage_fdrcorrection(pvalues, alpha=0.05, method='bh'):
"""
Iterated two stage linear step-up procedure with estimation of number of true hypotheses. For more information visit https://www.statsmodels.org/dev/generated/statsmodels.stats.multitest.fdrcorrection_twostage.html.
:param ndarray pvalues: et of p-values of the individual tests.
:param numpy.ndarray pvalues: et of p-values of the individual tests.
:param float alpha: error rate.
:param str method: method of p-value correction ('bky', 'bh').
:return: Tuple with two arrays, boolen for rejecting H0 hypothesis and float for adjusted p-value.
Expand Down Expand Up @@ -139,7 +139,7 @@ def get_counts_permutation_fdr(value, random, observed, n, alpha):
Calculates local FDR values (q-values) by computing the fraction of accepted hits from the permuted data over accepted hits from the measured data normalized by the total number of permutations.
:param float value: computed p-value on measured data for a feature.
:param ndarray random: p-values computed on the permuted data.
:param numpy.ndarray random: p-values computed on the permuted data.
:param observed: pandas Series with p-values calculated on the originally measured data.
:param int n: number of permutations to be applied.
:param float alpha: error rate. Values velow alpha are considered significant.
Expand Down
2 changes: 1 addition & 1 deletion acore/normalization_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def normalize_data(data, method='median', normalize=None):
This function normalizes the data using the selected method
:param data: DataFrame with the data to be normalized (samples x features)
:param string method: normalization method to choose among: median_polish, median,
:param str method: normalization method to choose among: median_polish, median,
quantile, linear
:param str normalize: whether the normalization should be done by 'features' (columns) or 'samples' (rows) (default None)
:return: Pandas dataframe.
Expand Down

0 comments on commit 38a66f0

Please sign in to comment.