infercnvpy-skill — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited infercnvpy-skill (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Use this skill for general scRNA-seq CNV analysis with infercnvpy, especially when:
AnnDataadata.obsThis skill provides:
infercnv reference cellsadata.obscnv_score_cellcnv_normal_distancecnv_segment_score.h5ad inputAnnData is already quality-controlledinfercnvpyadata.obs.h5ad.infercnvpy prerequisites:adata.varadata.obsX dtype, value range, nonzero-per-cell counts, and normalization/log1p hints in adata.uns or adata.layerschromosome, start, or end are missing from adata.var, add genomic positions first:infercnvpy.io.genomic_position_from_gtfinfercnvpy.io.genomic_position_from_biomartadata.obs[annotation_col] labels and their counts.adata.obs, stop and ask for confirmationcnv.tl.infercnv(...) with explicit --reference-cats and --suspect-cats.cnv_score_cell)tumor_likecnv_segment_score to promote high-confidence tumor cellsAnnData.For most scRNA-seq datasets, automatic CNV analysis is only as good as the normal reference set. Existing cell annotations usually contain enough information to build a reasonable first-pass reference:
The same annotation column should therefore drive both:
In this skill, that decision is made by the agent after inspecting the actual labels in adata.obs. The bundled script does not do keyword-based auto-matching.
mean + 2*sd on baseline normalsq99 on baseline normalsmean + 2*sd on baseline normalsThese are defaults, not universal truths. Use stricter thresholds when false positives are more costly than false negatives.
The bundled workflow writes three automatic labels:
normaltumor_candidatetumor_high_cnvInterpretation:
normal: not clearly outside the normal baselinetumor_candidate: abnormal but not yet high-confidence CNV tumortumor_high_cnv: abnormal and supported by contiguous CNV segment structure in suspect malignant lineagesThe bundled script writes these standard figures into --output-dir:
01_global_baseline_distribution.png02_candidate_feature_scatter.png03_segment_score_distribution.png04_expression_umap_labels.png when X_umap exists05_expression_umap_scores.png when X_umap exists06_chromosome_heatmap_all_by_cnv_status.png07_chromosome_heatmap_all_by_annotation.pngreferences/genomic_positions.md when adata.var is missing genomic coordinates and positions must be added from GTF or Biomart.references/annotation_heuristics.md when deciding which labels should be normal references and which labels should be suspect malignant lineages.references/feature_definitions.md when tuning the automatic CNV features or justifying the method.Example:
python \
./scripts/check_preflight.py \
--input-h5ad /path/to/input.h5ad \
--annotation-col cell_type \
--check-mode warn
PYTHONPATH=/data20T/dev/agenticbioinfo/sciskillhub/infercnvpy/src \
python \
./scripts/run_infercnvpy.py \
--input-h5ad /path/to/input.h5ad \
--annotation-col cell_type \
--reference-cats "T cell CD4,T cell CD8,B cell,NK cell,Fibroblast,Endothelial cell" \
--suspect-cats "Epithelial cell,Ciliated" \
--output-dir /path/to/output_dir
# Optional: skip heatmaps for large datasets
python \
./scripts/run_infercnvpy.py \
--input-h5ad /path/to/input.h5ad \
--annotation-col cell_type \
--reference-cats "T cell CD4,T cell CD8,B cell,NK cell,Fibroblast,Endothelial cell" \
--suspect-cats "Epithelial cell,Ciliated" \
--output-dir /path/to/output_dir \
--skip-heatmapsFirst inspect adata.obs[annotation_col] directly, then choose categories explicitly and pass them to the script. The agent should not rely on keyword matching inside the script.
Use the separate preflight script first when checking a new dataset. It reports:
annotation_col exists in adata.obsadata.var contains complete chromosome/start/end coordinatesX looks more like normalized/log-transformed expression or suspicious raw/scaled inputThe main infercnv script reuses the same preflight logic before CNV inference. If X looks like raw counts or scaled data, it will warn by default. Use --expression-check-mode fail when you want the run to stop on suspicious input.
Important reminder: If no suspect malignant labels can be justified from the annotation column, stop and ask for explicit confirmation instead of silently continuing.
The main script now also writes whole-dataset cnv.pl.chromosome_heatmap(...) outputs. These heatmaps use all cells in the supplied AnnData, grouped by:
cnv_status_2stageannotation_colUse --skip-heatmaps when the dataset is large enough that full-cell heatmaps would be too slow or too large to inspect comfortably.
Override or refine the initial category choice when:
If no suspect malignant categories can be justified from adata.obs, stop and ask the user to confirm them explicitly before continuing. In scripted runs, fail fast and require both --reference-cats and --suspect-cats.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.