Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuoqing Fang committed Dec 12, 2017
1 parent 0b6a8f9 commit 8d7a498
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions gseapy/algorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def enrichment_score(gene_list, gene_set, weighted_score_type=1, correl_vector=N
equal to the permutation number.
:param rs: Random state for initialize gene list shuffling. Default: np.random.RandomState(seed=None)
:return:
:return:
ES: Enrichment score (real number between -1 and +1)
hit_index: index of a gene in gene_list, if gene included in gene_set.
Hits_Indices: index of a gene in gene_list, if gene included in gene_set.
RES: Numerical vector containing the running enrichment score for all locations in the gene list .
Expand Down Expand Up @@ -94,12 +94,12 @@ def enrichment_score_tensor(gene_mat, cor_mat, gene_sets, weighted_score_type, n
:param bool single: If True, use ssGSEA algorithm, otherwise use GSEA.
:param rs: Random state for initialize gene list shuffling.
Default: np.random.RandomState(seed=None)
:return:
ES: Enrichment score (real number between -1 and +1), it's true for ssGSEA, when only scaled
by gene number.
ESNULL: Enrichment score calcualted from random permutation.
Hits_Indices: Indices of genes if genes are included in gene_set.
RES: The running enrichment score for all locations in the gene list.
:return: a tuple contains::
|ES: Enrichment score (real number between -1 and +1), for ssGSEA, set scale eq to True.
|ESNULL: Enrichment score calcualted from random permutation.
|Hits_Indices: Indices of genes if genes are included in gene_set.
|RES: The running enrichment score for all locations in the gene list.
"""
# gene_mat -> 1d: prerank, ssSSEA or 2d: GSEA
Expand Down Expand Up @@ -179,22 +179,23 @@ def enrichment_score_tensor(gene_mat, cor_mat, gene_sets, weighted_score_type, n
def ranking_metric_tensor(exprs, method, permutation_num, pos, neg, classes,
ascending, rs=np.random.RandomState()):
"""Build shuffled ranking matrix when permutation_type eq to phenotype.
:param exprs: gene_expression DataFrame, gene_name indexed.
:param str method: calculate correlation or ranking. methods including:
1. 'signal_to_noise'
2. 't_test'
1. 'signal_to_noise'.
2. 't_test'.
3. 'ratio_of_classes' (also referred to as fold change).
4. 'diff_of_classes'
5. 'log2_ratio_of_classes'
4. 'diff_of_classes'.
5. 'log2_ratio_of_classes'.
:param int permuation_num: how many times of classes is being shuffled
:param str pos: one of lables of phenotype's names.
:param str neg: one of lable of phenotype's names.
:param list classes: a list of phenotype labels, to specify which column of
dataframe belongs to what catogry of phenotype.
:param bool ascending: bool. Sort ascending vs. descending.
:return: returns two 2d ndarry with shape (nperm, gene_num).
:return:
returns two 2d ndarry with shape (nperm, gene_num).
genes_mat: sorted and permuated (exclude last row) gene name matrix.
cor_mat: sorted and permuated (exclude last row) ranking matrix.
Expand Down

0 comments on commit 8d7a498

Please sign in to comment.