Reference preparation参考准备

rnaseq-index-flow

This flow builds the reusable reference contract for downstream RNA-seq analysis: standardized annotation, transcript FASTA, tx2gene.tsv, Salmon/Kallisto indexes, and optional HISAT2 genome index.

这个流程负责构建下游 RNA-seq 分析可复用的参考契约:标准化注释、转录本 FASTA、tx2gene.tsv、Salmon/Kallisto 索引,以及可选 HISAT2 基因组索引。

0.1.0-r1Before expression/alignment位于表达和比对之前GitHub

Typical command

典型命令

taf-rnaseq-index-flow \
  --genome genome.fa \
  --annotation genes.gff3 \
  --outdir ref-out \
  --indexer salmon \
  --threads 8

Add --genome-indexer hisat2 when the output will feed the alignment/count branch.

如果后续要接比对/计数分支,添加 --genome-indexer hisat2

Input requirements

输入要求

Choose exactly one input mode. Genome + annotation mode is preferred for the full RNA-seq route because it can produce standardized GTF/GFF3, transcript FASTA, tx2gene.tsv, Salmon/Kallisto indexes, and optional HISAT2 genome indexes from the same reference release. Transcript-only mode is useful when a curated transcriptome FASTA and matching tx2gene.tsv already exist.

只能选择一种输入模式。完整 RNA-seq 路线更推荐“基因组 + 注释”模式,因为它可以从同一参考版本生成标准化 GTF/GFF3、转录本 FASTA、tx2gene.tsv、Salmon/Kallisto 索引以及可选 HISAT2 基因组索引。仅转录本模式适合已经有人工确认的 transcriptome FASTA 和匹配 tx2gene.tsv 的情况。

Genome + annotation mode

基因组 + 注释模式

Provide --genome genome.fa and --annotation genes.gtf|genes.gff3. FASTA record IDs must match annotation seqids after the first whitespace-truncated token.

提供 --genome genome.fa--annotation genes.gtf|genes.gff3。FASTA 序列 ID 必须和注释中的 seqid 匹配,通常按 header 第一个空白前 token 判断。

Transcript-only mode

仅转录本模式

Provide --transcripts transcripts.fa and --tx2gene tx2gene.tsv. Do not combine these with --genome or --annotation.

提供 --transcripts transcripts.fa--tx2gene tx2gene.tsv。不要再同时传入 --genome--annotation

tx2gene.tsv

The first column is transcript ID and the second is gene ID. Transcript IDs must match the transcript FASTA records used for Salmon/Kallisto indexing.

第一列是转录本 ID,第二列是基因 ID。转录本 ID 必须和 Salmon/Kallisto 建索引使用的转录本 FASTA 记录一致。

tx_id	gene_id
YAL001C_mRNA	YAL001C
YAL002W_mRNA	YAL002W

Complete parameter reference

完整参数说明

Parameter参数Required是否必需Default默认值Meaning and when to change it含义与选择建议
--genomemode-specific按模式noneGenome FASTA for genome + annotation mode. Requires --annotation.基因组 + 注释模式的基因组 FASTA;必须和 --annotation 同时使用。
--annotationmode-specific按模式noneGTF or GFF3 annotation matching the genome FASTA. Requires --genome.与基因组 FASTA 匹配的 GTF 或 GFF3 注释;必须和 --genome 同时使用。
--transcriptsmode-specific按模式noneTranscript FASTA for transcript-only mode. Requires --tx2gene and cannot be mixed with genome mode.仅转录本模式的 transcript FASTA;必须和 --tx2gene 同时使用,不能和基因组模式混用。
--tx2genemode-specific按模式noneTranscript-to-gene TSV with tx_id and gene_id. Required only in transcript-only mode; generated automatically in genome mode.包含 tx_idgene_id 的映射表。仅转录本模式需要用户提供;基因组模式会自动生成。
--outdir, -oyesnoneDedicated output directory. Existing directories are refused unless --force is used.专用输出目录。目录已存在时默认拒绝运行,除非使用 --force
--threads, -tno1Threads for index builders. Increase for larger references.索引构建使用的线程数。参考基因组较大时可以调高。
--indexernosalmonTranscriptome index builder: salmon, kallisto, or both. Standard-flow uses Salmon; choose both when Kallisto compatibility is needed.转录组索引类型:salmonkallistoboth。标准流程使用 Salmon;需要保留 Kallisto 兼容性时选 both
--genome-indexernononehisat2 builds 03_results/hisat2_index/genome.*.ht2 for the alignment branch. Requires genome + annotation mode.设为 hisat2 时生成 03_results/hisat2_index/genome.*.ht2,供比对分支使用。只支持基因组 + 注释模式。
--kmerno31Salmon k-mer size. Keep 31 for normal data; smaller values are mainly for tiny smoke fixtures.Salmon k-mer 长度。真实数据通常保留 31;更小值主要用于极小测试数据。
--forcenooffReplace standard outputs inside an existing output directory.允许替换已有输出目录中的标准结果。

How it connects

如何接上下游

taf-rnaseq-expression-flow \
  --samples samples.tsv \
  --index ref-out/03_results/salmon_index \
  --tx2gene ref-out/03_results/tx2gene.tsv \
  --outdir expression-out

taf-rnaseq-alignment-flow \
  --samples samples.tsv \
  --index ref-out/03_results/hisat2_index/genome \
  --outdir align-out

Key outputs and limits

关键输出与边界

Key outputs are 03_results/transcripts/transcripts.fa, 03_results/tx2gene.tsv, 03_results/salmon_index/, 03_results/kallisto_index/, and optional 03_results/hisat2_index/. The flow validates and standardizes inputs, but it does not repair biologically wrong annotations or download reference databases.

关键输出包括 03_results/transcripts/transcripts.fa03_results/tx2gene.tsv03_results/salmon_index/03_results/kallisto_index/ 以及可选 03_results/hisat2_index/。流程会验证和标准化输入,但不会修复生物学上错误的注释,也不会下载参考数据库。