sciskillhub/sciskill / community/infercnvpy-skill
infercnvpy-skill
VerifiedscRNA-seq CNV analysis with infercnvpy. Infer copy number variation (CNV) from scRNA-seq data. Plays nicely with Scanpy and AnnData.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.6 KB |
| references/annotation_heuristics.md | markdown | 2.0 KB |
| references/feature_definitions.md | markdown | 1.1 KB |
| references/genomic_positions.md | markdown | 2.0 KB |
| scripts/check_preflight.py | script | 9.6 KB |
| scripts/run_infercnvpy.py | script | 18.9 KB |
references/genomic_positions.md
View on GitHub# Genomic Positions
Before running `infercnv`, check whether `adata.var` already contains genomic coordinates:
- `chromosome`
- `start`
- `end`
If any of these are missing, add them before CNV analysis.
## Preferred order
1. Prefer `infercnvpy.io.genomic_position_from_gtf`
2. Fall back to `infercnvpy.io.genomic_position_from_biomart`
Use the GTF route first whenever a matching annotation file is available. It is the more reproducible path and avoids network dependence.
## `genomic_position_from_gtf`
API:
`infercnvpy.io.genomic_position_from_gtf(gtf_file, adata=None, *, gtf_gene_id='gene_name', adata_gene_id=None, inplace=True)`
Key notes:
- the GTF must match the genome annotation used for the dataset
- currently only tested with GENCODE GTFs
- if `adata_gene_id` is not set, matching uses `adata.var_names`
- if `inplace=True`, genomic coordinates are added directly into `adata.var`
Typical usage:
```python
cnv.io.genomic_position_from_gtf(
gtf_file="path/to/genes.gtf",
adata=adata,
gtf_gene_id="gene_name",
adata_gene_id=None,
inplace=True,
)
```
## `genomic_position_from_biomart`
API:
`infercnvpy.io.genomic_position_from_biomart(adata=None, *, adata_gene_id=None, biomart_gene_id='ensembl_gene_id', species='hsapiens', inplace=True, **kwargs)`
Key notes:
- use this when no suitable GTF is available
- gene identifiers between `adata` and Biomart must match
- default `biomart_gene_id` is `ensembl_gene_id`, but symbol-based matching can also work when configured correctly
- this route depends on Biomart availability and network access
Typical usage:
```python
cnv.io.genomic_position_from_biomart(
adata=adata,
adata_gene_id=None,
biomart_gene_id="ensembl_gene_id",
species="hsapiens",
inplace=True,
)
```
## Recommended check
Use this check before CNV analysis:
```python
required = {"chromosome", "start", "end"}
missing = required.difference(adata.var.columns)
```
If `missing` is non-empty:
- first try `genomic_position_from_gtf`
- otherwise use `genomic_position_from_biomart`
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |