-
Notifications
You must be signed in to change notification settings - Fork 0
Implement Feature/finding marker genes to develop #32
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
Open
happymealinthebuilding
wants to merge
19
commits into
develop
Choose a base branch
from
feature/finding_marker_genes
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement marker gene expression visualization Introduces the `visualize_marker_genes` function for visualizing marker gene expression across cell clusters in an AnnData object. This function: - Accepts an `adata` object, a list/dict of `marker_genes`, and a `cluster_key` (defaulting to 'leiden') from `adata.obs` for grouping. - Generates a dot plot using `sc.pl.dotplot` to show average expression and the percentage of cells expressing each marker gene per cluster. - Additionally, creates a stacked violin plot using `sc.pl.stacked_violin` to display the distribution of marker gene expression within each cluster. - Facilitates comprehensive visual identification and validation of potential marker genes.
…ies_chosen_algorithm_new_cluster_names
…lgorithm_new_cluster_names Standardize cluster categories and names Implements the `rename_clusters` function to update cluster labels within an AnnData object. This function: - Takes an `adata` object, a `cluster_algo` key (e.g., 'leiden', 'louvain' from `adata.obs`), and a list of `new_cluster_names`. - Validates that the `cluster_algo` key exists in `adata.obs` and that the number of `new_cluster_names` matches the existing number of clusters. - Utilizes `adata.rename_categories()` to perform the renaming in-place. - Ensures consistent and interpretable cluster labeling for downstream marker gene analysis.
Extract top N ranked marker genes and p-values
Implements the `extract_top_genes` function to retrieve top-ranked
genes and their associated p-values from pre-computed `rank_genes_groups`
results stored in an AnnData object. This function:
- Takes an `adata` object and an optional `n_top` parameter (defaulting to 5)
to specify the number of top genes per group.
- Validates the presence of `adata.uns['rank_genes_groups']` before processing.
- Parses the `names` and `pvals` fields from the `rank_genes_groups` results.
- Returns a tuple containing two pandas DataFrames:
1. A DataFrame of top gene names per cluster/group.
2. A combined DataFrame with top gene names and their corresponding
p-values for each cluster/group.
- Provides a structured and quantitative list of candidate marker genes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This Pull Request integrates the finding marker genes branch into develop. This integration provides a foundational set of tools and a demonstrated workflow for identifying and working with marker genes. The utility functions offer flexibility for analyzing clustering results and visualizing gene expression patterns, which will be crucial for ongoing and future research requiring cell type characterization and biomarker discovery.