Fastq Analysis Pipeline 标志

Fastq Analysis Pipeline

组织
omicverse
fastq-analysis-pipeline

介绍 omicverse 的比对模块,涵盖 SRA 下载、FASTQ 质量控制、STAR 比对、基因定量,以及单细胞 kallisto/bustools 流程,适用于 bulk 和单细胞 RNA-seq 工作流。

概览

发布者omicverse
代码仓库omicclaw
技能名称fastq-analysis-pipeline
星标数
33
复刻数
5
附带文件
1
许可协议GPL-3.0
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 omicverse 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Fastq Analysis Pipeline AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/omicverse/omicclaw/tree/main/src/omicverse_skills/skills/fastq-analysis
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/omicverse/omicclaw.git /tmp/omicclaw
mkdir -p .claude/skills
cp -r /tmp/omicclaw/src/omicverse_skills/skills/fastq-analysis .claude/skills/fastq-analysis-pipeline
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Fastq Analysis Pipeline,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Fastq Analysis Pipeline。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Fastq Analysis Pipeline 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Overview

OmicVerse provides a complete FASTQ-to-count-matrix pipeline via the ov.alignment module. This skill covers:

  • SRA data acquisition: prefetch and fqdump (fasterq-dump wrapper)
  • Quality control: fastp for adapter trimming and QC reports
  • RNA-seq alignment: STAR aligner with auto-index building
  • Gene quantification: featureCount (subread featureCounts wrapper)
  • Single-cell path: ref and count via kb-python (kallisto/bustools)
  • Parallel SRA download: parallel_fastq_dump

All functions share a common CLI infrastructure (_cli_utils.py) that handles tool resolution, auto-installation via conda/mamba, parallel execution, and streaming output.

Instructions

  1. Environment setup

    • Bioinformatics tools are resolved automatically from PATH or the active conda environment.
    • If auto_install=True (default), missing tools are installed via mamba/conda on demand.
    • Supported tools: prefetch, vdb-validate, fasterq-dump, fastp, STAR, samtools, featureCounts, pigz, gzip.
    • For the single-cell path, ensure kb-python is installed: pip install kb-python.
  2. SRA data download (ov.alignment.prefetch + ov.alignment.fqdump)

    • Use prefetch first for reliable downloads with integrity validation (vdb-validate).
    • Then convert to FASTQ with fqdump. It auto-detects single-end vs paired-end.
    • fqdump can also work directly from SRR accessions without prefetch.
    • Both support retry with exponential backoff for network errors.
    python
    import omicverse as ov
    
    # Step 1: Prefetch SRA files (optional but recommended)
    pre = ov.alignment.prefetch(['SRR1234567', 'SRR1234568'], output_dir='prefetch', jobs=4)
    
    # Step 2: Convert to FASTQ
    fq = ov.alignment.fqdump(['SRR1234567', 'SRR1234568'],
                              output_dir='fastq', sra_dir='prefetch',
                              gzip=True, threads=8, jobs=4)
  3. FASTQ quality control (ov.alignment.fastp)

    • Runs fastp for adapter trimming, quality filtering, and QC reporting.
    • Supports single-end and paired-end reads.
    • Produces per-sample JSON and HTML QC reports.
    • Sample format: tuple of (sample_name, fq1_path, fq2_path_or_None).
    python
    samples = [
        ('S1', 'fastq/SRR1234567/SRR1234567_1.fastq.gz', 'fastq/SRR1234567/SRR1234567_2.fastq.gz'),
        ('S2', 'fastq/SRR1234568/SRR1234568_1.fastq.gz', 'fastq/SRR1234568/SRR1234568_2.fastq.gz'),
    ]
    clean = ov.alignment.fastp(samples, output_dir='fastp', threads=8, jobs=2)
  4. STAR alignment (ov.alignment.STAR)

    • Aligns FASTQ reads using the STAR aligner.
    • Auto-index building: set auto_index=True (default) with genome_fasta_files and gtf to build index automatically if missing.
    • Produces coordinate-sorted BAM files.
    • Handles gzip-compressed FASTQs automatically (uses pigz/gzip/zcat).
    • Use strict=False (default) for graceful error handling per sample.
    python
    # Prepare samples from fastp output
    star_samples = [
        ('S1', 'fastp/S1/S1_clean_1.fastq.gz', 'fastp/S1/S1_clean_2.fastq.gz'),
        ('S2', 'fastp/S2/S2_clean_1.fastq.gz', 'fastp/S2/S2_clean_2.fastq.gz'),
    ]
    bams = ov.alignment.STAR(
        star_samples,
        genome_dir='star_index',
        output_dir='star_out',
        gtf='genes.gtf',
        genome_fasta_files=['genome.fa'],
        threads=8,
        memory='50G',
    )
  5. Gene quantification (ov.alignment.featureCount)

    • Counts aligned reads per gene using featureCounts (subread).
    • Auto-detects paired-end from BAM headers (via pysam or samtools).
    • auto_fix=True (default) retries with corrected paired-end flag on error.
    • gene_mapping=True maps gene_id to gene_name from the GTF.
    • merge_matrix=True produces a combined count matrix across all samples.
    python
    bam_items = [
        ('S1', 'star_out/S1/Aligned.sortedByCoord.out.bam'),
        ('S2', 'star_out/S2/Aligned.sortedByCoord.out.bam'),
    ]
    counts = ov.alignment.featureCount(
        bam_items,
        gtf='genes.gtf',
        output_dir='counts',
        gene_mapping=True,
        merge_matrix=True,
        threads=8,
    )
    # counts is a pandas DataFrame (gene_id x samples)
  6. Single-cell path (ov.alignment.ref + ov.alignment.count)

    • Uses kb-python (kallisto + bustools) for single-cell RNA-seq quantification.
    • ref() builds a kallisto index and transcript-to-gene mapping.
    • count() quantifies single-cell data with barcode/UMI handling.
    • Supports technologies: 10XV2, 10XV3, BULK, and custom.
    • Output formats: h5ad, loom, cellranger MTX.
    python
    # Build reference index
    ref_result = ov.alignment.ref(
        index_path='kb_ref/index.idx',
        t2g_path='kb_ref/t2g.txt',
        fasta_paths=['genome.fa'],
        gtf_paths=['genes.gtf'],
        threads=8,
    )
    
    # Quantify 10x v3 data
    count_result = ov.alignment.count(
        index_path='kb_ref/index.idx',
        t2g_path='kb_ref/t2g.txt',
        technology='10XV3',
        fastq_paths=['sample_R1.fastq.gz', 'sample_R2.fastq.gz'],
        output_path='kb_out',
        h5ad=True,
        filter_barcodes=True,
        threads=8,
    )
  7. Wiring fastp output into STAR input

    • fastp output is a list of dicts with keys: sample, clean1, clean2, json, html.
    • Convert to STAR sample tuples:
    python
    star_samples = [
        (r['sample'], r['clean1'], r['clean2'] if r['clean2'] else None)
        for r in (clean if isinstance(clean, list) else [clean])
    ]
  8. Wiring STAR output into featureCount input

    • STAR output is a list of dicts with keys: sample, bam (or error).
    • Convert to featureCount items:
    python
    bam_items = [
        (r['sample'], r['bam'])
        for r in (bams if isinstance(bams, list) else [bams])
        if 'bam' in r
    ]
  9. Skipping completed steps

    • All functions check for existing outputs and skip if overwrite=False (default).
    • Set overwrite=True to force re-execution.
  10. Troubleshooting

    • If a tool is not found, check auto_install=True and that conda/mamba is accessible.
    • For STAR index errors, ensure genome_fasta_files points to uncompressed or gzip FASTA files.
    • For featureCounts paired-end detection errors, auto_fix=True handles most cases automatically.
    • GTF files can be gzip-compressed; they are auto-decompressed as needed.

Critical API Reference

Sample Format Convention

All alignment functions use a consistent sample tuple format:

  • FASTQ samples: (sample_name, fq1_path, fq2_path_or_None)
  • BAM items: (sample_name, bam_path) or (sample_name, bam_path, is_paired_bool)
  • Single samples can be passed as a single tuple; multiple as a list of tuples.
  • When a single tuple is passed, the return value is a single dict; for a list, a list of dicts.

Auto-installation

python
# All functions support these parameters:
auto_install=True   # Auto-install missing tools via conda/mamba
overwrite=False     # Skip if outputs already exist
threads=8           # Per-tool thread count
jobs=None           # Concurrent job count (auto-detected from CPU count)

Examples

  • Bulk RNA-seq from SRA: prefetch -> fqdump -> fastp -> STAR -> featureCount -> pandas DataFrame
  • Single-cell 10x v3: ref -> count with technology='10XV3' -> h5ad AnnData
  • Local FASTQ files: Skip download steps, start directly with fastp -> STAR -> featureCount

References

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Fastq Analysis Pipeline AI 技能有什么作用?

介绍 omicverse 的比对模块,涵盖 SRA 下载、FASTQ 质量控制、STAR 比对、基因定量,以及单细胞 kallisto/bustools 流程,适用于 bulk 和单细胞 RNA-seq 工作流。

为什么在 TypingMind 中使用 Fastq Analysis Pipeline?

因为您只需安装一次,就能搭配任何模型使用。Fastq Analysis Pipeline 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Fastq Analysis Pipeline?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/omicverse/omicclaw/tree/main/src/omicverse_skills/skills/fastq-analysis。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Fastq Analysis Pipeline?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Fastq Analysis Pipeline 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Fastq Analysis Pipeline 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Fastq Analysis Pipeline AI 技能免费吗?

是的。omicverse 已在 GitHub 上根据 GPL-3.0 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇