😊
pipseekerでtdtomatoを検出する方法
手順概要
- TdTomatoのFASTAファイルを作る
- TdTomatoのGTFファイルを作る(ここが重要!)
- マウスのリファレンスと結合する
pipseeker buildmaprefを実行する
Step 1: TdTomatoのFASTAファイル作成 (tdtomato.fa)
まず、TdTomatoの配列だけのFASTAファイルを用意します。ヘッダー(>の後の名前)はシンプルに tdtomato とするのがおすすめです。
例 (tdtomato.fa):
>tdtomato
ATGGTGAGCAAGGGCGAGGAGGTCATCAA... (TdTomatoの配列) ...
Step 2: TdTomatoのGTFファイル作成 (tdtomato.gtf)
ここが最大のポイントです。PIPseekerのマニュアルにはこう書かれています。
Note: Only the exon lines (lines with "exon" as the third field) are used by STAR to generate the reference. [cite_start]All other lines are ignored. [cite: 1230]
[cite_start]つまり、「exon」行を含まないと無視されてしまいます。 また、gene_id と transcript_id も必須です [cite: 1231]。
10xのチュートリアルと同様の計算で、以下のようなGTFファイルを作成してください。
例 (tdtomato.gtf):
- 以下の例は、配列長が1428bpの場合です。ご自身の配列長に合わせて終了位置(以下の例では1428)を変えてください。
- 3列目は必ず
exonにしてください。
gtfの作り方
# シングルクォート版(これでエラー回避できます)
printf 'tdtomato\tunknown\tgene\t1\t1518\t.\t+\t.\tgene_id "tdtomato"; gene_name "tdtomato"; gene_biotype "protein_coding";\n' > tdtomato.gtf
printf 'tdtomato\tunknown\ttranscript\t1\t1518\t.\t+\t.\tgene_id "tdtomato"; transcript_id "tdtomato"; gene_name "tdtomato"; gene_biotype "protein_coding";\n' >> tdtomato.gtf
printf 'tdtomato\tunknown\texon\t1\t1518\t.\t+\t.\tgene_id "tdtomato"; transcript_id "tdtomato"; gene_name "tdtomato"; gene_biotype "protein_coding"; exon_number "1";\n' >> tdtomato.gtf
printf 'tdtomato\tunknown\tCDS\t7\t1437\t.\t+\t0\tgene_id "tdtomato"; transcript_id "tdtomato"; gene_name "tdtomato"; gene_biotype "protein_coding"; exon_number "1";\n' >> tdtomato.gtf
※ タブ区切りであることに注意してください。
Step 3: ファイルの結合
[cite_start]PIPseekerのマニュアルによると、FASTAファイルはカンマ区切りで複数指定できますが [cite: 1227][cite_start]、GTFファイルについては単一ファイルを指定する書き方になっています [cite: 1229]。
トラブルを避けるために、Cell Rangerのやり方と同様、事前にファイルを結合してしまうのが一番安全です。
# FASTAの結合
cat mouse_genome.fa tdtomato.fa > genome_with_tdtomato.fa
# GTFの結合
cat mouse_annotation.gtf tdtomato.gtf > annotation_with_tdtomato.gtf
Step 4: PIPseeker buildmapref の実行
結合したファイルを使って、リファレンス作成コマンドを実行します。
# 出力先ディレクトリなどを適宜変更してください
/path/to/pipseeker buildmapref \
--fasta genome_with_tdtomato.fa \
--gtf annotation_with_tdtomato.gtf \
--output-path ./mouse_tdtomato_ref \
--threads 16
[cite_start]※ --threads はお使いの環境に合わせて調整してください [cite: 1251]。
💡 うまくいくためのコツ
- [cite_start]GTFの「exon」: 何度も言いますが、GTFの3列目が
exonになっているか確認してください。ここがgeneやCDSだけだと、PIPseeker(内部のSTAR)が読み込んでくれません [cite: 1230]。 - [cite_start]フィルタリング設定: もしコマンドに
--include-typesや--exclude-typesオプションを追加する場合、TdTomatoに付けたgene_biotype(例:protein_coding)が含まれるように気をつけてください [cite: 1237]。デフォルト(指定なし)であれば問題ありません。
Discussion