Skip to content

Commit

Permalink
Add Kallisto quantification while removing deprecated option to use d…
Browse files Browse the repository at this point in the history
…edup reads for fusion calls
  • Loading branch information
anoronh4 committed Jun 28, 2023
1 parent 1ec8d9c commit b968173
Show file tree
Hide file tree
Showing 13 changed files with 304 additions and 48 deletions.
3 changes: 3 additions & 0 deletions conf/igenomes.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ params {
fasta = "${params.igenomes_base}/Homo_sapiens/GATK/GRCh37/Sequence/WholeGenomeFasta/human_g1k_v37_decoy.fasta"
gtf = "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Annotation/Genes/genes.gtf"
refflat = "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Annotation/Genes/refFlat.txt.gz"
cdna = "https://ftp.ensembl.org/pub/release-75/fasta/homo_sapiens/cdna/Homo_sapiens.GRCh37.75.cdna.all.fa.gz"
starfusion_url = "https://data.broadinstitute.org/Trinity/CTAT_RESOURCE_LIB/__genome_libs_StarFv1.10/GRCh37_gencode_v19_CTAT_lib_Mar012021.plug-n-play.tar.gz"
arriba_blacklist = "/usr/local/var/lib/arriba/blacklist_hg19_hs37d5_GRCh37_v2.3.0.tsv.gz"
arriba_known_fusions = "/usr/local/var/lib/arriba/known_fusions_hg19_hs37d5_GRCh37_v2.3.0.tsv.gz"
Expand Down Expand Up @@ -41,6 +42,7 @@ params {
arriba_blacklist = "/usr/local/var/lib/arriba/blacklist_hg38_GRCh38_v2.3.0.tsv.gz"
arriba_known_fusions = "/usr/local/var/lib/arriba/known_fusions_hg38_GRCh38_v2.3.0.tsv.gz"
arriba_protein_domains = "/usr/local/var/lib/arriba/protein_domains_hg38_GRCh38_v2.3.0.gff3"
cdna = "https://ftp.ensembl.org/pub/release-86/fasta/homo_sapiens/cdna/Homo_sapiens.GRCh38.cdna.all.fa.gz"
}
'smallGRCh37' {
fasta = "https://raw.githubusercontent.com/nf-core/test-datasets/modules/data/genomics/homo_sapiens/genome/genome.fasta"
Expand All @@ -50,6 +52,7 @@ params {
arriba_blacklist = "/usr/local/var/lib/arriba/blacklist_hg19_hs37d5_GRCh37_v2.3.0.tsv.gz"
arriba_known_fusions = "/usr/local/var/lib/arriba/known_fusions_hg19_hs37d5_GRCh37_v2.3.0.tsv.gz"
arriba_protein_domains = "/usr/local/var/lib/arriba/protein_domains_hg19_hs37d5_GRCh37_v2.3.0.gff3"
cdna = "ftp://ftp.ensembl.org/pub/grch37/current/fasta/homo_sapiens/cdna/Homo_sapiens.GRCh37.75.cdna.abinitio.fa.gz"
}
/*
'hg38' {
Expand Down
19 changes: 19 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,25 @@ process {
time = { check_max( 20.h * task.attempt, 'time' ) }
}

withName: KALLISTO_QUANT {
ext.args = {
[
"--plain-text",
"--bias",
"-b 100",
meta.strand == "forward" ?
"--fr-stranded" :
(
meta.strand == "reverse" ?
"--rf-stranded" :
""
)
].join(" ")
}
ext.fragment_len = params.kallisto_fragment_len
ext.sd = params.kallisto_fragment_sd
}

withName: ARRIBA {
ext.args = {
[
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@
"git_sha": "c8e35eb2055c099720a75538d1b8adb3fb5a464c",
"installed_by": ["modules"]
},
"kallisto/index": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"kallisto/quant": {
"branch": "master",
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"multiqc": {
"branch": "master",
"git_sha": "ee80d14721e76e2e079103b8dcd5d57129e584ba",
Expand Down
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.

31 changes: 31 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.

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.

70 changes: 70 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.

6 changes: 5 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ params {
save_align_intermeds = false

// Fusion
dedup_umi_for_fusions = false
run_oncokb_fusionannotator = false
cosmic_usr = null
fusion_report_cutoff = 1
Expand All @@ -39,6 +38,11 @@ params {
// rseqc_modules can include ['bam_stat','inner_distance','infer_experiment','junction_annotation','junction_saturation','read_distribution','read_duplication','tin']
rseqc_modules = ['bam_stat','inner_distance','infer_experiment','junction_annotation','junction_saturation','read_distribution','read_duplication']

// Quantification
dedup_umi_for_kallisto = true
kallisto_fragment_len = 500
kallisto_fragment_sd = 150

// MultiQC options
multiqc_config = null
multiqc_title = null
Expand Down
24 changes: 24 additions & 0 deletions subworkflows/local/extract_dedup_fq.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
include { SAMTOOLS_BAM2FQ } from '../../modules/nf-core/samtools/bam2fq/main'

workflow EXTRACT_DEDUP_FQ {
take:
bam

main:
ch_versions = Channel.empty()

SAMTOOLS_BAM2FQ(
bam,
true
)
ch_versions = ch_versions.mix(SAMTOOLS_BAM2FQ.out.versions.first())

dedup_reads = SAMTOOLS_BAM2FQ.out.reads
.map{ meta, reads ->
[meta, reads.findAll{ !(it.getName().endsWith("singleton.fq.gz") || it.getName().endsWith("other.fq.gz")) }]
}

emit:
dedup_reads = dedup_reads
ch_versions = ch_versions
}
34 changes: 0 additions & 34 deletions subworkflows/local/merge_reads.nf

This file was deleted.

6 changes: 6 additions & 0 deletions subworkflows/local/prepare_references.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ include { GUNZIP } from '../../modules/nf-core/gunzip/ma
include { STARFUSION_DOWNLOAD } from '../../modules/local/starfusion/download/main'
include { FUSIONCATCHER_DOWNLOAD } from '../../modules/local/fusioncatcher/download/main'
include { FUSIONREPORT_DOWNLOAD } from '../../modules/local/fusionreport/download/main'
include { KALLISTO_INDEX } from '../../modules/local/kallisto/index/main'


workflow PREPARE_REFERENCES {

Expand Down Expand Up @@ -70,6 +72,9 @@ workflow PREPARE_REFERENCES {
//cosmic_passwd = params.cosmic_passwd ?: ""
FUSIONREPORT_DOWNLOAD()

KALLISTO_INDEX(params.cdna)
ch_versions = ch_versions.mix(KALLISTO_INDEX.out.versions)

emit:
star_index = star_index
// Convert queue channel to value channel so it never gets poison pilled
Expand All @@ -84,6 +89,7 @@ workflow PREPARE_REFERENCES {
fusioncatcher_ref = fusioncatcher_ref
fusion_report_db = FUSIONREPORT_DOWNLOAD.out.reference
rseqc_bed = UCSC_GENEPREDTOBED.out.bed.map{it[1]}.first()
kallisto_index = KALLISTO_INDEX.out.idx
ch_versions = ch_versions

}
Loading

0 comments on commit b968173

Please # to comment.