.autolab/acquired_skills/scanpy/SKILL.md
Single-cell RNA-seq analysis with Scanpy. QC, normalization, clustering, visualization, marker gene identification.
npx skillsauth add albert-ying/autonomous-lab scanpyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
import scanpy as sc
import anndata as ad
# Read 10X data
adata = sc.read_10x_mtx('path/to/data/', var_names='gene_symbols')
# QC
sc.pp.filter_cells(adata, min_genes=200)
sc.pp.filter_genes(adata, min_cells=3)
adata.var['mt'] = adata.var_names.str.startswith('MT-')
sc.pp.calculate_qc_metrics(adata, qc_vars=['mt'], inplace=True)
adata = adata[adata.obs.pct_counts_mt < 20].copy()
# Normalize and log-transform
sc.pp.normalize_total(adata, target_sum=1e4)
sc.pp.log1p(adata)
# HVG selection
sc.pp.highly_variable_genes(adata, n_top_genes=2000, batch_key='batch')
# Scale, PCA, neighbors, clustering
sc.pp.scale(adata, max_value=10)
sc.tl.pca(adata, n_comps=50)
sc.pp.neighbors(adata, n_pcs=30)
sc.tl.leiden(adata, resolution=0.5)
sc.tl.umap(adata)
# Marker genes
sc.tl.rank_genes_groups(adata, 'leiden', method='wilcoxon')
development
Critically review AI-agent-conducted scientific analyses for correctness, rigor, and completeness. Use this skill whenever an analysis session has completed and needs validation, when a user asks to "review," "validate," "check," or "audit" a computational analysis, or when an agent pipeline produces scientific results that require quality control before reporting. Also trigger when the user references an execution trace, notebook, or conversation history from a prior analysis session. This skill should run as the final step of any autonomous scientific analysis pipeline.
tools
# Variant Calling Skill ## When to Use Use when calling SNPs and indels from aligned BAM files against a reference. ## Standard Workflow 1. Mark duplicates (optional): `samtools markdup` 2. Call variants with freebayes: `freebayes -f reference.fasta -p 1 sample.bam > variants.vcf` OR with bcftools: `bcftools mpileup -f ref.fa sample.bam | bcftools call -mv -Oz -o variants.vcf.gz` 3. Filter variants: `bcftools filter -s LowQual -e 'QUAL<20' variants.vcf` ## Key Decisions - For haploid organ
tools
# Trimmomatic - Read Quality Trimming ## When to Use Use Trimmomatic to trim adapter sequences and low-quality bases from Illumina sequencing reads. ## Standard Workflow 1. Install: `conda install -c bioconda trimmomatic` 2. Run: `trimmomatic PE <input_R1.fastq.gz> <input_R2.fastq.gz> <output_R1_paired.fastq.gz> <output_R1_unpaired.fastq.gz> <output_R2_paired.fastq.gz> <output_R2_unpaired.fastq.gz> ILLUMINACLIP:<adapters.fa>:2:30:10 LEADING:3 TRAILING:3 SLIDINGWINDOW:4:15 MINLEN:36` ## Key Pa
testing
# SPAdes Assembly Skill ## When to Use Use for de novo genome assembly when no reference genome is available. ## Standard Workflow 1. Run SPAdes: `spades.py -1 R1.fastq.gz -2 R2.fastq.gz -o assembly_output --careful` 2. Check assembly stats: look at scaffolds.fasta or contigs.fasta 3. Use assembled genome as reference for read mapping ## Key Decisions - Use `--careful` flag for bacterial genomes to reduce misassemblies - For small bacterial genomes, default k-mer sizes work well - Output scaf