使用處理 BAM、VCF 和 FASTQ 文件的工具來分析和處理 DNA 測序數據。提取基因組區域、計算覆蓋率統計,並整合多種文件類型以進行全面的變異分析。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「pysam」。 打開 BAM 文件並顯示染色體 1 的覆蓋率統計
預期結果:
- 染色體 1 統計信息:
- 總讀段數:1,245,678
- 已映射讀段:1,198,432 (96.2%)
- 平均覆蓋率:32.4x
- 低於 10x 覆蓋率的區域:5,234 個位置
正在使用「pysam」。 按質量和深度過濾變異
預期結果:
- 將 12,456 個變異過濾為 3,892 個高質量變異
- 應用的過濾器:QUAL > 30, DP > 10, MQ > 40
- 變異已寫入 filtered.vcf
正在使用「pysam」。 提取變異位置周圍的序列
預期結果:
- 為 847 個變異提取了 100bp 序列
- 序列已寫入 variant_contexts.fasta
- 側翼區域:每個變異位置的 +/- 50bp
安全審計
安全All 447 static findings are FALSE POSITIVES caused by bioinformatics terminology being misinterpreted as security-relevant patterns. The scanner flags 'SAM' as Windows Security Account Manager when it means Sequence Alignment/Map format, and samtools/bcftools as network scanning tools when they are legitimate bioinformatics command-line utilities. The skill contains only documentation and code examples for legitimate genomic data processing. No actual malicious code, command injection, credential access, or network exfiltration patterns exist.
風險因素
品質評分
你能建構什麼
變異分析工作流程
從 VCF 文件中提取和過濾遺傳變異,使用 BAM 文件中的讀取覆蓋率進行註釋
覆蓋率分析
計算每鹼基覆蓋率,識別低覆蓋率區域,生成用於可視化的覆蓋率軌跡
質量控制流程
驗證測序數據,檢查參考一致性,根據質量閾值過濾讀段
試試這些提示
使用 pysam 打開 example.bam 並打印重疊在 chr1 位置 1000-2000 的所有讀段
打開 variants.vcf 並打印 chr2 上所有質量分數高於 30 的變異
使用堆積分析計算染色體 1 位置 100000-200000 的每鹼基覆蓋率
打開 reference.fasta 並提取 chr5 上基因 ABC 從位置 10000 到 11000 的序列
最佳實務
- 始終為隨機存取操作使用索引 BAM 文件以提高性能
- 記住 pysam 使用 0-based 座標,而 VCF 文件使用 1-based 座標
- 使用 pileup() 進行列式覆蓋率分析,而不是重複調用 fetch()
避免
- 將整個 BAM 文件加載到內存中,而不是使用基於迭代器的處理
- 忽略 pysam 和 VCF 文件格式之間的座標系統差異
- 處理大文件而不創建索引文件以進行隨機存取