管理用於單細胞基因組學分析的大型註釋數據矩陣相當複雜。本技能提供 AnnData 函式庫的完整文檔,能夠有效處理 h5ad 文件、元數據註釋以及與 scverse 生態系統的整合。
스킬 ZIP 다운로드
Claude에서 업로드
설정 → 기능 → 스킬 → 스킬 업로드로 이동
토글을 켜고 사용 시작
테스트해 보기
"anndata" 사용 중입니다. How do I create an AnnData object with cell type annotations and gene metadata?
예상 결과:
- Create the expression matrix (X) with shape (observations, variables)
- Create observation metadata DataFrame with cell-level annotations (cell_type, sample, condition)
- Create variable metadata DataFrame with gene-level information (gene_name, chromosome, highly_variable status)
- Pass all components to ad.AnnData constructor with X, obs, and var parameters
- Access n_obs and n_vars properties to verify dimensions match your metadata
"anndata" 사용 중입니다. What are the best practices for handling large AnnData files?
예상 결과:
- Use backed mode (backed='r') to access data without loading entire matrix into memory
- Convert sparse data to sparse matrix format (csr_matrix) for 10-100x memory reduction
- Convert string columns to categorical type using astype('category') or strings_to_categoricals()
- Store raw data before filtering using adata.raw = adata.copy()
- Use compression='gzip' when writing h5ad files for smaller storage
보안 감사
안전Documentation-only skill containing markdown reference files. No executable code, scripts, network operations, or file system access. All static findings are false positives from a pattern-matching scanner that misinterprets documentation content. Python code examples shown in markdown are illustrative only and never executed.
위험 요인
⚙️ 외부 명령어 (349)
품질 점수
만들 수 있는 것
單細胞 RNA-seq 工作流程
使用 AnnData 作為 scanpy 工作流程的核心數據結構,加載、處理和分析單細胞基因表達數據
大型註釋數據集
有效管理具有豐富元數據註釋、嵌入和多模態測量的高維數據集
批次整合管道
結合多個實驗批次或模態,並進行適當的元數據追蹤和磁碟串聯,以支援大規模研究
이 프롬프트를 사용해 보세요
如何從 numpy 數組和 pandas DataFrame 創建 AnnData 對象,用於觀察和變量元數據?
展示如何在後台模式下讀取 h5ad 文件以處理大型數據集,並在不解載整個矩陣的情況下訪問觀察元數據
如何在追蹤批次來源的標籤情況下,串聯來自不同實驗批次的多個 AnnData 對象?
處理大型 AnnData 對象的最佳實踐有哪些?包括稀疏矩陣、後台模式和分類數據類型。
모범 사례
- 對稀疏基因組數據使用稀疏矩陣,以實現 10-100 倍的內存減少
- 在過濾前使用 adata.raw = adata.copy() 存儲原始數據,以保留對原始測量數據的訪問
- 處理超過可用 RAM 的數據集時使用後台模式(backed='r'),以避免內存不足錯誤
피하기
- 在調用 .copy() 之前修改 AnnData 視圖可能會意外修改原始數據
- 在後台模式足夠的情況下將整個大型數據集加載到內存中會造成不必要的內存壓力
- 添加外部元數據時忽略索引對齊可能導致數據對齊錯誤和不正確的結果