kuroの覚え書き

96の個人的覚え書き

RNAseqパイプライン3

cufflinksの結果をcuffmergeで統合し、cuffdiffでサンプル間のFPKMを比較するところまで自動化
cuffmerge_diffスクリプト

#!/bin/sh
#tophat_resultsディレクトリを引数として実行
#
cd "$@"
ls */*/transcripts.gtf > transcripts.gtf.txt

#アノテーション情報を含むgtfファイル
read -p "annotation infomation (full path) = " gtf
#リファレンスファイルの指定
read -p "reference file (full path) = " ref
echo "アノテーション情報は"$gtf""
echo "リファレンスファイルは"$ref""
read -p "Label name for samples (separated by ,) = " label_name
bams='*/*th.bam'
cuffmerge -p 4 -o fpkm_compare -g "$gtf" -s "$ref" transcripts.gtf.txt
cuffdiff -p 4 --upper-quartile-norm -o cuffdiff_result -L "$label_name" fpkm_compare/merged.gtf $bams

cuffmerge_diffの後ろにtophat_resultsフォルダをD&Dしてリターンするだけ。
bamファイルを投入するところ、*を使っているが、ソートされる順番を考慮に入れてLabel nameを並べておく必要あり。ここはcsvファイルか何かを参照して投入するように仕様変更すべき。

最終的には以下のようにファイルが生成されることになる。

working dir
	|-sample1.fastq
	|-sample2.fastq
	|-sample3.fastq
	|-	.
	|-	.
	|-FastQC
	|	|-sample1_fastqc.html
	|	|-sample1_fastqc.zip
	|	|-sample2_fastqc.html
	|	|-sample2_fastqc.zip
	|	|-sample3_fastqc.html
	|	|-sample3_fastqc.zip
	|	|-	.
	|	|-	.
	|	|-trimmed
	|		|-sample1_trim_fastqc.html
	|		|-sample1_trim_fastqc.zip
	|		|-sample2_trim_fastqc.html
	|		|-sample2_trim_fastqc.zip
	|		|-sample3_trim_fastqc.html
	|		|-sample3_trim_fastqc.zip
	|		|-	.
	|		|-	.
	|-trimmed
	|	|-sample1_trim_fastq
	|	|-sample2_trim_fastq
	|	|-sample3_trim_fastq
	|	|-	.
	|	|-	.
	|-tophat_results
		|-cuffdiff_result
		|	|-bias_params.info
		|	|-cds_exp.diff
		|	|-cds.count_tracking
		|	|-cds.diff
		|	|-cds.fpkm_tracking
		|	|-cds.read_group_tracking
		|	|-gene_exp.diff
		|	|-genes.count_tracking
		|	|-genes.fpkm_tracking
		|	|-genes.read_group_tracking
		|	|-isoform_exp.diff
		|	|-isoforms.count_tracking
		|	|-isoforms.fpkm_tracking
		|	|-isoforms.read_group_tracking
		|	|-promoters.diff
		|	|-read_groups.info
		|	|-run.info
		|	|-splicing.diff
		|	|-tss_group_exp.diff
		|	|-tss_groups.count_tracking
		|	|-tss_groups.fpkm_tracking
		|	|-tss_groups.read_group_tracking
		|	|-var_model.info
		|-sample1_trim
		|	|-align_summary.txt
		|	|-cufflinks_results
		|	|	|-genes.fpkm_tracking
		|	|	|-isoforms,gtf
		|	|	|-skipped.gtf
		|	|	|-transcripts.gtf
		|	|-deletions,bed
		|	|-sample1_trim_th.bam
		|	|-insertions.bed
		|	|-junctions.bed
		|	|-logs
		|		|-	.
		|		|-	.
		|	|-prep_reads.info
		|	|-unmapped.bam
		|-sample2_trim
		|	|-	.
		|	|-	.
		|-sample3_trim
		|	|-	.
		|	|-	.
		|-	.
		|-	.
		|-fpkm_compare
		|	|-logs
		|	|	|-	.
		|	|	|-	.
		|	|-merged.gtf
		|-transcripts.gtf.txt	
		

working_dir/tophat_results/cuffdiff_resultが最終的に解析されたデータの格納されるディレクトリとなる。
R(cummeRbund)でグラフにして評価に用いる。