Skip to content

Commit 8767812

Browse files
authored
Merge pull request #39 from yyoshiaki/developmentv1.2.1
v1.2.1
2 parents 2793f6e + dda7b0b commit 8767812

File tree

7 files changed

+140
-77
lines changed

7 files changed

+140
-77
lines changed

README.md

Lines changed: 60 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# ikra v1.2.0 -RNAseq pipeline centered on Salmon-<img src="img/ikra.png" width="20%" align="right" />
1+
# ikra v1.2.1 -RNAseq pipeline centered on Salmon-<img src="img/ikra.png" width="20%" align="right" />
22

3+
A gene expression table (gene × sample) is automatically created from the experiment matrix. The output can be used as an input of [idep](http://bioinformatics.sdstate.edu/idep/). Ikra is an RNAseq pipeline centered on [salmon](https://combine-lab.github.io/salmon/).
34

4-
[idep](http://bioinformatics.sdstate.edu/idep/)のinputとして発現量テーブル(gene × sample)をexperiment matrixから自動でつくる。salmonを用いる。
55

6-
## 重要 bugについて 2019/04/30
7-
8-
ikraの`tximport_R.R`にサンプルを取り違えうる重大なバグが見つかり、修正しました。最新版に更新してお使いください。古いバージョンを使われていた方は、中間ファイルは問題ありませんので、`output.tsv`およびexperiment matrixと同じディレクトリにコピーされている`tximport_R.R`を削除し、もう一度新しいikra.shを実行してください。大変ご迷惑をおかけいたしました。
6+
## [日本語ドキュメントはこちら](./README_ja.md)
97

108
## Usage
119

@@ -32,14 +30,13 @@ Options:
3230
-v, --version Show version.
3331
```
3432

35-
- test optionは各サンプルにおいてリード数を100000に限定する。
36-
- udocker modeはUser権限しか使えないサーバー環境用。詳しくは[https://github.com/indigo-dc/udocker](https://github.com/indigo-dc/udocker)
37-
- without-docker modeはすべてのツールをインストールした状態で動く。非推奨。
38-
- protein-coding modeはgenesをprotein coding genesのみに限定する。
39-
- threads
40-
- outputはデフォルトでは`output.tsv`
41-
42-
experiment matrixはカンマ区切りで(csv形式)。
33+
- **test option** limits the number of reads to 100,000 in each sample.
34+
- **udocker mode** is for server environments that can only use User privileges. For more information [https://github.com/indigo-dc/udocker](https://github.com/indigo-dc/udocker).
35+
- **without-docker mode** works with all tools installed. Not recommended.
36+
- **protein-coding mode** restricts genes to protein coding genes only.
37+
- **threads**
38+
- **output** is `output.tsv` by default.
39+
**experiment matrix** should be separated by commas (csv format).
4340

4441
**SRR mode**
4542

@@ -55,40 +52,42 @@ experiment matrixはカンマ区切りで(csv形式)。
5552
| Treg_LN_1 | hoge/SRR5385247 | SE | Treg | ...|
5653
| Treg_LN_2 | hoge/SRR5385248 | SE | Treg | ... |
5754

58-
- nameはアンダーバー区切りでcondition、replicateをつなげて書く。
59-
- 前3列は必須。
60-
- 自前のfastq fileを使いたいときは`--fastq`をつける。拡張子は`.fq`, `.fq.gz`, `.fastq`, `fastq.gz`のみに対応。
61-
- fastq fileは`fastq.gz`もしくは`_1.fastq.gz`,`_2.fastq.gz`を除いたpathを。例えば`hoge/SRR5385247.fastq.gz`なら`hoge/SRR5385247`と記載。
62-
- suffixが`_1.fastq.gz`,`_2.fastq.gz`ではない場合は-s1, -s2オプションをつける。
63-
- `../fq/**.fastq.gz`など、実行ディレクトリより上の階層を指定することはdockerの都合上不可能だが、symbolic linkを貼ることで回避できる。
55+
- Denote names by connecting conditions and replicates with underscores. See [idep's Naming convention](https://idepsite.wordpress.com/data-format/) in detail.
56+
- The first three columns are required.
57+
- If you want to use your own fastq file, add `--fastq` option. Ikra supports only `.fq`, `.fq.gz`, `.fastq` and `fastq.gz`.
58+
- fastq file specifies path excluding `fastq.gz` or `_1.fastq.gz` and `_2.fastq.gz`. For example, `hoge/SRR5385247.fastq.gz` is described as `hoge/SRR5385247`.
59+
- If suffix is not `_1.fastq.gz` or `_2.fastq.gz`, add -s1 and -s2 options.
60+
- It is impossible for docker to specify a hierarchy above the execution directory, such as `../fq/**.fastq.gz`, but it can be avoided by pasting a symbolic link.
6461
[bonohu blog](https://bonohu.github.io/running-ikra.html)
6562

66-
- Illumina用 : trimmomatic -> trim_galoreに切り替えた。
67-
- Ion S5用: SEしか無い。trimmomaticではなくfastx-toolsを使う。adapterはNoneを入れておく。(test : [DRP003376](https://trace.ncbi.nlm.nih.gov/Traces/sra/?study=DRP003376))
68-
6963
### Output
7064

7165
- output.tsv(scaledTPM)
66+
- multiqc_report.html : including fastQC reports and mapping rate of salmon(mapping rate for transcript)
67+
68+
**output sample**
69+
70+
| | Treg_LN_1 | Treg_LN_2 |
71+
| ---- | ---- | - |
72+
| 0610005C13Rik | 0 | 0 |
73+
| 0610006L08Rik | 0 | 1 |
74+
| 0610009B22Rik | 4 | 10 |
75+
| ... | | |
7276

73-
- multiqc_report.html
74-
salmonのマッピング率(トランスクリプトに対するマッピング率)
77+
### Various Specifications
7578

76-
### 各種仕様
79+
- output is **scaledTPM** (see. [Soneson, C., Love, M. I. & Robinson, M. D. Differential analyses for RNA-seq: transcript-level estimates improve gene-level inferences. F1000Research 4, 1521 (2015).](https://f1000research.com/articles/4-1521/v2))。
80+
- About GCbias `—-gcbias` is added on salmon. You can refer to https://mikelove.wordpress.com/2016/09/26/rna-seq-fragment-sequence-bias/ about the influence on RNAseq by GCbias.
81+
- ValidateMappings option was adopted. (You can’t use it while using alignment-base mode.) Please see https://combine-lab.github.io/salmon/faq/ for further details.
7782

78-
- outputは**scaledTPM** (see. [Soneson, C., Love, M. I. & Robinson, M. D. Differential analyses for RNA-seq: transcript-level estimates improve gene-level inferences. F1000Research 4, 1521 (2015).](https://f1000research.com/articles/4-1521/v2))。
79-
- GCbiasについて、salmonで`--gcBias`を追加した。GCbiasのRNAseqにおける影響に関しては[Mike Love's blog :
80-
RNA-seq fragment sequence bias](https://mikelove.wordpress.com/2016/09/26/rna-seq-fragment-sequence-bias/)
81-
- validateMappings optionを採用。(alignment-base modeでは使えない。)詳しくは[salmon Frequently Asked Questions](https://combine-lab.github.io/salmon/faq/)
8283

83-
## 重要 bugについて 2019/04/30
84+
## Important About a Bug 2019/04/30
8485

85-
ikraの`tximport_R.R`にサンプルを取り違えうる重大なバグが見つかり、修正しました。必ずv1.1.1以降に更新してお使いください。古いバージョンを使われていた方は、中間ファイルは問題ありませんので、`output.tsv`を削除し、もう一度新しいikra.shを実行してください。大変ご迷惑をおかけいたしました。
86+
A serious bug was reported in the `tximport_R.R` and fixed. In the older version, Salmon's output and multiqc reports were correct and sometimes `output.tsv` were disturbed. Please update Ikra to the latest version. If you are using the old version(<1.1.1), please update and re-run ikra. We apologize for the inconvenience.
8687

8788
## Install
8889

89-
dockerかudocker(v1.1.3)をインストール済みであること。
90-
もしくはどちらも使いたくない場合は、すべてのソフトを手動でインストールして、`--without-docker`を用いる。
91-
shell scriptなのでcloneするだけ。
90+
All you need is `git clone` ikra, and install docker or udocker(v1.1.3). No need for installing plenty of softwares! If you don’t want to use docker (or udocker), you must install all softwares by yourself and use `—-without-docker` option.
9291

9392
```bash
9493
$ git clone https://github.com/yyoshiaki/ikra.git
@@ -108,7 +107,7 @@ $ cd test/Illumina_SE && bash ../../ikra.sh Illumina_SE_SRR.csv mouse --test -t
108107

109108
**fastq mode**
110109

111-
SRR modeを実行したあとしかできない。(fastqはつけていないから。)
110+
You can execute it after you execute SRR mode. (That is because you don’t have fastq file.)
112111

113112
```bash
114113
$ cd test/Illumina_SE && bash ../../ikra.sh Illumina_SE_fastq.csv mouse --fastq -t 10
@@ -124,21 +123,17 @@ $ cd test/Illumina_PE && bash ../../ikra.sh Illumina_PE_SRR.csv mouse --test -t
124123

125124
**fastq mode**
126125

127-
SRR modeを実行したあとしかできない。(fastqはつけていないから。)
126+
You can execute it after you execute SRR mode. (That is because you don’t have fastq file.)
127+
128128

129129
```bash
130130
$ cd test/Illumina_PE && bash ../../ikra.sh Illumina_PE_fastq.csv mouse --fastq -t 10
131131
```
132132

133-
### Ion (ThermoFisher)
134133

135-
```bash
136-
$ cd test/Ion && bash ../../ikra_Ion_SRR.sh Ion_SRR.csv mouse
137-
```
134+
## For Mac Users
138135

139-
## Macのひと
140-
141-
salmonがmacで走らない問題だが、[DBCLS大田さん](https://github.com/inutano)に解決していただいた。macではdefaultで2Gbしかメモリをdockerに振っていないことが原因らしい。写真のように、8Gb等大きめのメモリ量を割り振って、Apply & Restartすると解決する。
136+
[Dr.Ota(DBCLS)](https://github.com/inutano) solved the problem that salmon doesn’t work on Mac. The cause of the problem is that Docker is allocated only 2GB by default on Mac. Therefore,like this picture, the problem will be solved by allocating large amount of memories to Docker, such as 8GB, and doing Apply & Restart.
142137

143138
![img](img/docker_mac0.png)
144139
![img](img/docker_mac1.png)
@@ -149,62 +144,59 @@ salmonがmacで走らない問題だが、[DBCLS大田さん](https://github.com
149144

150145
## Tips
151146

152-
SRRデータを探している場合は[http://sra.dbcls.jp/](http://sra.dbcls.jp/index.html)が爆速でおすすめ。
147+
You can find SRR data so quickly in [http://sra.dbcls.jp/](http://sra.dbcls.jp/index.html)
153148

154149
<img src="https://github.com/yyoshiaki/mishima_gassyuku/blob/master/img/dbcls_sra.png?raw=true" width="50%" >
155150

156-
## やること
151+
## Issue
157152

158-
[issue](https://github.com/yyoshiaki/auto_counttable_maker/issues)を参照のこと。
153+
Please refer to [issue](https://github.com/yyoshiaki/ikra/issues)
159154

160-
## やったこと
155+
## Releases
161156

162-
詳しくは[Relases](https://github.com/yyoshiaki/ikra/releases)を参照。
157+
Please refer to [Relases](https://github.com/yyoshiaki/ikra/releases)
163158

164-
- udockerの対応
165-
- 生物種の判別(アナログ)
166-
- gtf, transcript file をGENCODEから
159+
- add support for udocker
160+
- add setting of species
161+
- gtf and transcript file from GENCODE
167162
- salmon
168163
- trimmomatic(legacy)
169164
- trim_galore!
170165
- tximport
171-
- fastxtools(Ion用)
172-
- fastqかSRRの判別(マニュアル)
173-
- salmon gcbias correctionの導入
166+
- fastxtools(for Ion)
167+
- judging fastq or SRR(manual)
168+
- introduce "salmon gcbias correction"
174169
- salomn validateMappings
175-
- pigz(gzipのマルチスレッド版)
170+
- pigz(multithread version of gzip)
176171
- fasterq-dump
177-
- cwl開発少しだけ
178-
- 名前の変更(ikra
172+
- cwl development is in progress
173+
- rename to "ikra"
179174
- protein coding option
180175

181-
## legacy
182-
183-
trimmomaticを使ったトリミングを用いたフローは`./legacy`に移動しました。
176+
## Legacy
184177

185-
## 開発戦略
178+
Moved the flow using trimmomatic to `./legacy`
186179

187-
今はまだ完成とは言えないので各自
180+
## Development Strategy
188181

189-
**"development" branchの中** でFork -> Pull Request。直接masterは変えない。
182+
Fork -> Pull Request in **"developmentv\*\*" branch.** Do not edit "master" directly.
190183

191-
## 参考
184+
## Reference
192185

193186
- [biocontainers : SNP-calling](http://biocontainers.pro/docs/containers-examples/SNP-Calling/)
194187
- [idep](http://bioinformatics.sdstate.edu/idep/)
195188
- [GENCODE](https://www.gencodegenes.org/)
196189
- [salmon](https://combine-lab.github.io/salmon/getting_started/)
197190

198-
## cwl版の開発
191+
## Development of cwl ver.
199192

200-
2019/03/22 https://youtu.be/weJrq5QNt1M cwl作者のMichaelさんの来日配信に合わせてやってみた。
201-
とりあえずPEでtrim_galoreとsalmonをcwl化した。
193+
2019/03/22 https://youtu.be/weJrq5QNt1M We tried developing it because Mr.Michael visited Japan. For now, cwlnized trim_galore and salmon in PE.
202194

203195
```
204196
cd test/cwl_PE && bash test.sh
205197
```
206198

207-
## cwl_toolsの由来、参考
199+
## sorce and reference ー cwl_tools
208200

209201
- https://github.com/pitagora-galaxy/cwl
210202
- https://github.com/roryk/salmon-cwl

README_el.md renamed to README_ja.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ikra v1.2.0 -RNAseq pipeline centered on Salmon-<img src="img/ikra.png" width="20%" align="right" />
1+
# ikra v1.2.1 -RNAseq pipeline centered on Salmon-<img src="img/ikra.png" width="20%" align="right" />
22

33

44
[idep](http://bioinformatics.sdstate.edu/idep/)のinputとして発現量テーブル(gene × sample)をexperiment matrixから自動でつくる。salmonを用いる。
@@ -130,6 +130,14 @@ SRR modeを実行したあとしかできない。(fastqはつけていない
130130
$ cd test/Illumina_PE && bash ../../ikra.sh Illumina_PE_fastq.csv mouse --fastq -t 10
131131
```
132132

133+
#### 開発用
134+
135+
書きを実行できてからcommitすべし。
136+
137+
```
138+
$ cd test && bash test.sh
139+
```
140+
133141
### Ion (ThermoFisher)
134142

135143
```bash

ikra.sh

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! bin/bash
1+
#!/bin/bash
22
set -xeu
33

44
<<COMMENTOUT
@@ -18,7 +18,9 @@ COMMENTOUT
1818
set +u
1919

2020
PROGNAME="$( basename $0 )"
21-
VERSION="v1.2.0"
21+
22+
VERSION="v1.2.1dev"
23+
2224

2325
# Usage
2426
function usage() {
@@ -240,13 +242,13 @@ if [[ "$RUNINDOCKER" -eq "1" ]]; then
240242
# chmod 777 .
241243

242244
COWSAY_IMAGE=docker/whalesay
243-
SRA_TOOLKIT_IMAGE=inutano/sra-toolkit
245+
SRA_TOOLKIT_IMAGE=inutano/sra-toolkit:2.9.0
244246
FASTQC_IMAGE=biocontainers/fastqc:v0.11.5_cv2
245-
MULTIQC_IMAGE=maxulysse/multiqc
247+
MULTIQC_IMAGE=maxulysse/multiqc:2.0.0
246248
# TRIMMOMATIC_IMAGE=fjukstad/trimmomatic
247249
# TRIMMOMATIC_IMAGR=comics/trimmomatic
248-
TRIMGALORE_IMAGE=miasteinberg/trim-galore
249-
SALMON_IMAGE=combinelab/salmon:latest
250+
TRIMGALORE_IMAGE=quay.io/biocontainers/trim-galore:0.6.3--0
251+
SALMON_IMAGE=combinelab/salmon:0.14.0
250252
# SALMON_IMAGE=fjukstad/salmon
251253
RSCRIPT_TXIMPORT_IMAGE=fjukstad/tximport
252254
WGET_IMAGE=fjukstad/tximport
@@ -300,8 +302,51 @@ if [[ -f "tximport_R.R" ]]; then
300302
rm tximport_R.R
301303
fi
302304

303-
# tximport_R.Rを取ってくる。
304-
cp $SCRIPT_DIR/tximport_R.R ./
305+
# # tximport_R.Rを取ってくる。
306+
# cp $SCRIPT_DIR/tximport_R.R ./
307+
308+
# 2019/06/09 devv1.3 tximport_R.Rを埋め込み
309+
310+
cat << 'EOF' > tximport_R.R
311+
#! /usr/bin/Rscript
312+
313+
library(tximport)
314+
library(readr)
315+
library(stringr)
316+
317+
# Rscript tximport_R.R gencode.vM19.metadata.MGI.gz Illumina_PE_SRR.csv output.tsv
318+
319+
args1 = commandArgs(trailingOnly=TRUE)[1]
320+
args2 = commandArgs(trailingOnly=TRUE)[2]
321+
args3 = commandArgs(trailingOnly=TRUE)[3]
322+
323+
tx2knownGene <- read_delim(args1, '\t', col_names = c('TXNAME', 'GENEID'))
324+
exp.table <- read.csv(args2, row.names=NULL)
325+
326+
files.raw <- exp.table[,2]
327+
328+
# files.raw <- c("SE/test/ttt30.fq.gz", "SE/test/ttt2.fq.gz")
329+
330+
files.raw <- gsub(".gz$", "", files.raw)
331+
files.raw <- gsub(".fastq$", "", files.raw)
332+
files.raw <- gsub(".fq$", "", files.raw)
333+
334+
split.vec <- sapply(files.raw, basename)
335+
# print(paste(c("salmon_output_") , split.vec, c("/quant.sf"), sep=''))
336+
337+
# files <- paste(c("salmon_output_") , exp.table[,2], c("/quant.sf"), sep='')
338+
files <- paste(c("salmon_output_") , split.vec, c("/quant.sf"), sep='')
339+
names(files) <- exp.table[,1]
340+
341+
print(files)
342+
343+
# txi.salmon <- tximport(files, type = "salmon", tx2gene = tx2knownGene)
344+
txi.salmon <- tximport(files, type = "salmon", tx2gene = tx2knownGene, countsFromAbundance="scaledTPM")
345+
346+
write.table(txi.salmon$counts, file=args3, sep="\t",col.names=NA,row.names=T,quote=F,append=F)
347+
write.table(exp.table[-c(2,3)], file="designtable.csv",row.names=F,quote=F,append=F)
348+
349+
EOF
305350

306351
# trimmomaticのadaptersを取ってくる。
307352
# cp -r $SCRIPT_DIR/adapters/*.fa ./

img/Illumina_PE_fastq_csv.png

93.8 KB
Loading

img/Illumina_PE_test_output.png

295 KB
Loading

test/test.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
cd Illumina_SE && bash ../../ikra.sh Illumina_SE_SRR.csv mouse --test -t 6
4+
5+
rm -r salmon_*
6+
rm output.tsv
7+
8+
bash ../../ikra.sh Illumina_SE_fastq.csv mouse --fastq -t 6
9+
10+
cd ../Illumina_PE && bash ../../ikra.sh Illumina_PE_SRR.csv mouse --test -t 6
11+
12+
rm -r salmon_*
13+
rm output.tsv
14+
15+
bash ../../ikra.sh Illumina_PE_fastq.csv mouse --fastq -t 6

tximport_R.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#! /usr/bin/Rscript
22

3+
# 2019/06/09 embedded in ikra.sh
4+
# このファイルを書き換えた際は直接ikra.shも書き換えること。
5+
36
library(tximport)
47
library(readr)
58
library(stringr)

0 commit comments

Comments
 (0)