Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kallisto quantification #1106

Merged
merged 66 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
0979aee
naive kallisto addition to prepare_genome, following salmon pattern (…
pinin4fjords Oct 31, 2023
882843b
Add kallisto modules
pinin4fjords Oct 31, 2023
952ab48
update schema
pinin4fjords Oct 31, 2023
ac4fa24
Pass kallisto index in workflow
pinin4fjords Oct 31, 2023
549cfef
Add kallisto quant subworkflow
pinin4fjords Oct 31, 2023
b32eba6
[skip ci] next batch of kallisto adaptations
pinin4fjords Oct 31, 2023
06f72dc
tximport is more generic than just salmon
pinin4fjords Nov 1, 2023
9e3d589
Fix kallisto indexing
pinin4fjords Nov 1, 2023
1a41fbf
[skip ci] Next phase of Kallisto integration
pinin4fjords Nov 1, 2023
c081697
[skip ci] Bump kallisto modules
pinin4fjords Nov 2, 2023
7eb755b
[skip ci] rewire for updated kallisto modules
pinin4fjords Nov 2, 2023
42cef1d
[skip ci] Make tx2gene.py generic
pinin4fjords Nov 2, 2023
4089972
[skip ci] Try chatgpt's tidied version of tx2gene.py
pinin4fjords Nov 2, 2023
d18c3f1
[skip ci] Tidied up and genericised tximport script
pinin4fjords Nov 2, 2023
2d3e08e
[skip ci] misc compatibility updates
pinin4fjords Nov 2, 2023
5be6a04
[skip ci] fix bin/tx2gene.py
pinin4fjords Nov 2, 2023
4d8911f
[skip ci] prioritise transcript_id
pinin4fjords Nov 2, 2023
a5b27f7
[skip ci] final kallisto results handling fixes
pinin4fjords Nov 2, 2023
73e1a54
more genericisation between kallisto and salmon
pinin4fjords Nov 3, 2023
2a24792
Remove debugging line
pinin4fjords Nov 3, 2023
aebad06
Fix multiqc to avoid imp module error
pinin4fjords Nov 3, 2023
2ada1e4
Fix process selector
pinin4fjords Nov 3, 2023
39589a6
add kallisto_index default
pinin4fjords Nov 3, 2023
839ac5c
Combine kallisto and salmon components
pinin4fjords Nov 3, 2023
aa6e8c0
appease eclint
pinin4fjords Nov 3, 2023
72766a5
[automated] Fix linting with Prettier
nf-core-bot Nov 3, 2023
7328c65
Update CHANGELOG
pinin4fjords Nov 3, 2023
3c56b68
Merge branch 'kallisto_quant' of https://github.com/nf-core/rnaseq in…
pinin4fjords Nov 3, 2023
6a5e485
blackify
pinin4fjords Nov 3, 2023
f40065d
Don't hardcode tx2gene_file
pinin4fjords Nov 3, 2023
943e6ab
syntax fix
pinin4fjords Nov 3, 2023
83217d3
Add some kallisto tests
pinin4fjords Nov 3, 2023
6f85da7
Update metro maps
pinin4fjords Nov 3, 2023
7bda41e
[skip ci] Fix metro maps
pinin4fjords Nov 3, 2023
6479792
Update strandedness params for kallisto and salmon
pinin4fjords Nov 3, 2023
92716b4
[skip ci] appease linter
pinin4fjords Nov 3, 2023
cadec09
Fix kallisto publishing
pinin4fjords Nov 3, 2023
908c6f2
[skip ci] fix usage.md for Kallisto
pinin4fjords Nov 3, 2023
334088e
Merge branch 'kallisto_quant' of github.com:nf-core/rnaseq into kalli…
pinin4fjords Nov 3, 2023
0fc5407
[automated] Fix linting with Prettier
nf-core-bot Nov 3, 2023
e9ed01d
Update fraglen defaults
pinin4fjords Nov 3, 2023
1467c81
MultiQC needs STDOUT from Kallisto
pinin4fjords Nov 6, 2023
7d04886
Fix Kallisto MultiQC
pinin4fjords Nov 6, 2023
8420e99
Update docs
pinin4fjords Nov 6, 2023
46866ae
[automated] Fix linting with Prettier
nf-core-bot Nov 6, 2023
b39e7e8
Correct kallisto out path
pinin4fjords Nov 6, 2023
36694f8
Merge branch 'kallisto_quant' of github.com:nf-core/rnaseq into kalli…
pinin4fjords Nov 6, 2023
58bbc27
Add prefix usage to local modules to facilitate batched runs
pinin4fjords Nov 7, 2023
ab4c662
[skip ci] Address easy review feedback
pinin4fjords Nov 7, 2023
c612dd0
[skip ci] Update config per latest
pinin4fjords Nov 9, 2023
4a81e64
[skip ci] fix font sizes in metro map file icons
pinin4fjords Nov 9, 2023
d5c6f7f
thank myself to poke ci
pinin4fjords Nov 9, 2023
d75d507
Reflect updated kallisto module
pinin4fjords Nov 9, 2023
b0cf295
[skip ci] test file not supposed to be there
pinin4fjords Nov 10, 2023
9dcaf0b
Merge branch 'dev' into kallisto_quant
pinin4fjords Nov 10, 2023
4f556ee
[skip ci] Add Kallisto outputs to Tower yml
pinin4fjords Nov 13, 2023
9ab9f7c
Post-review changes
drpatelh Nov 14, 2023
0c9c0aa
Fix Kallisto sample name rendering in MultiQC
drpatelh Nov 14, 2023
2decfdc
[skip ci] Alphabetically order enum fields for salmon strandedness
drpatelh Nov 14, 2023
5ea79ac
[skip ci] Bump module from branch
pinin4fjords Nov 14, 2023
9605b0f
Merge branch 'kallisto_quant' of github.com:nf-core/rnaseq into kalli…
pinin4fjords Nov 14, 2023
83d9fb4
[automated] Fix linting with Prettier
nf-core-bot Nov 14, 2023
6c75322
[skip ci] removed kallisto strandedness as a standalone parameter
pinin4fjords Nov 14, 2023
5458b5c
[skip ci] Fix kallisto log file ext
pinin4fjords Nov 14, 2023
68b8977
Fix tiny issue
pinin4fjords Nov 14, 2023
5ad263a
[automated] Fix linting with Prettier
nf-core-bot Nov 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions bin/salmon_tximport.r → bin/tximport.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ library(SummarizedExperiment)
library(tximport)

args = commandArgs(trailingOnly=TRUE)
if (length(args) < 2) {
stop("Usage: salmon_tximport.r <coldata> <salmon_out>", call.=FALSE)
if (length(args) < 3) {
stop("Usage: tximport.r <coldata> <quant_out> <type>", call.=FALSE)
}

coldata = args[1]
path = args[2]
sample_name = args[3]
type = args[4]

prefix = sample_name
tx2gene = "salmon_tx2gene.tsv"
Expand All @@ -36,7 +37,7 @@ if (file.exists(coldata)) {
coldata = data.frame(files = fns, names = names)
}

txi = tximport(fns, type = "salmon", txOut = TRUE)
txi = tximport(fns, type = type, txOut = TRUE)
rownames(coldata) = coldata[["names"]]
extra = setdiff(rownames(txi[[1]]), as.character(rowdata[["tx"]]))
if (length(extra) > 0) {
Expand Down
43 changes: 43 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,49 @@ if (!params.skip_multiqc) {
// Salmon pseudo-alignment options
//

if (!params.skip_pseudo_alignment && params.pseudo_aligner == 'kallisto') {
process {
withName: '.*:QUANTIFY_KALLISTO:KALLISTO_QUANT' {
ext.fragment_len = { meta.fragment_len ?: params.kallisto_default_fraglen }
ext.sd = { meta.fragment_len ?: params.kallisto_default_fraglen_se }
ext.args = params.extra_kallisto_quant_args ?: ''
publishDir = [
path: { "${params.outdir}/${params.pseudo_aligner}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') || filename.endsWith('_meta_info.json') ? null : filename }
]
}

withName: '.*:QUANTIFY_KALLISTO:SALMON_TX2GENE' {
publishDir = [
path: { "${params.outdir}/${params.pseudo_aligner}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*:QUANTIFY_KALLISTO:SALMON_TXIMPORT' {
publishDir = [
path: { "${params.outdir}/${params.pseudo_aligner}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}

withName: '.*:QUANTIFY_KALLISTO:SALMON_SE_.*' {
publishDir = [
path: { "${params.outdir}/${params.pseudo_aligner}" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
}
}

//
// Salmon pseudo-alignment options
//

if (!params.skip_pseudo_alignment && params.pseudo_aligner == 'salmon') {
process {
withName: '.*:QUANTIFY_SALMON:SALMON_QUANT' {
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@
"git_sha": "735e1e04e7e01751d2d6e97055bbdb6f70683cc1",
"installed_by": ["modules"]
},
"kallisto/index": {
"branch": "master",
"git_sha": "8fc1d24c710ebe1d5de0f2447ec9439fd3d9d66a",
"installed_by": ["modules"]
},
"kallisto/quant": {
"branch": "master",
"git_sha": "8fc1d24c710ebe1d5de0f2447ec9439fd3d9d66a",
"installed_by": ["modules"]
},
"picard/markduplicates": {
"branch": "master",
"git_sha": "2ee934606f1fdf7fc1cb05d6e8abc13bec8ab448",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ process SALMON_TXIMPORT {

script: // This script is bundled with the pipeline, in nf-core/rnaseq/bin/
"""
salmon_tximport.r \\
tximport.r \\
NULL \\
salmon \\
salmon.merged
Expand Down
6 changes: 6 additions & 0 deletions modules/nf-core/kallisto/index/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions modules/nf-core/kallisto/index/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions modules/nf-core/kallisto/index/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions modules/nf-core/kallisto/quant/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions modules/nf-core/kallisto/quant/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 69 additions & 0 deletions modules/nf-core/kallisto/quant/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ params {
min_mapped_reads = 5
extra_star_align_args = null
extra_salmon_quant_args = null
extra_kallisto_quant_args = null
kallisto_default_fraglen = 150
kallisto_default_fraglen_se = 75
save_merged_fastq = false
save_unaligned = false
save_align_intermeds = false
Expand Down
26 changes: 25 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@
"fa_icon": "fas fa-bezier-curve",
"description": "Path to directory or tar.gz archive for pre-built Salmon index."
},
"kallisto_index": {
"type": "string",
"format": "path",
"exists": true,
"fa_icon": "fas fa-bezier-curve",
"description": "Path to directory or tar.gz archive for pre-built Kallisto index."
},
"hisat2_build_memory": {
"type": "string",
"default": "200.GB",
Expand Down Expand Up @@ -352,7 +359,7 @@
"type": "string",
"description": "Specifies the pseudo aligner to use - available options are 'salmon'. Runs in addition to '--aligner'.",
"fa_icon": "fas fa-hamburger",
"enum": ["salmon"]
"enum": ["salmon", "kallisto"]
},
"bam_csi_index": {
"type": "boolean",
Expand Down Expand Up @@ -396,6 +403,23 @@
"type": "string",
"description": "Extra arguments to pass to Salmon quant command in addition to defaults defined by the pipeline.",
"fa_icon": "fas fa-plus"
},
"extra_kallisto_quant_args": {
"type": "string",
"description": "Extra arguments to pass to Kallisto quant command in addition to defaults defined by the pipeline.",
"fa_icon": "fas fa-plus"
},
"kallisto_default_fraglen": {
"type": "integer",
"description": "In single-end mode Kallisto requires an estimated fragment length. Specify a default value for that here. TODO: use existing RSeQC results to do this dynamically.",
"default": 150,
"fa_icon": "fas fa-ruler-horizontal"
},
"kallisto_default_fraglen_se": {
"type": "integer",
"description": "In single-end mode Kallisto requires an estimated standard error for fragment length. Specify a default value for that here. TODO: use existing RSeQC results to do this dynamically.",
"default": 75,
"fa_icon": "fas fa-sort-amount-up-alt"
}
}
},
Expand Down
Loading