Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
b47be7c
Migrate local STARFUSION_DETECT
delfiterradas Jul 23, 2025
9cea8b7
Merge branch 'nf-core:master' into master
delfiterradas Jul 24, 2025
5c182bc
Fix linting errors
delfiterradas Jul 24, 2025
6155771
Correct test for unstable file
delfiterradas Jul 24, 2025
e81fe8f
Fix and update test
delfiterradas Jul 25, 2025
6f0435a
Merge branch 'master' into master
atrigila Jul 25, 2025
3eb2eba
Add test with single-end data
delfiterradas Jul 28, 2025
b602940
Update snapshot
delfiterradas Jul 29, 2025
b934f4e
Merge branch 'master' into master
delfiterradas Jul 29, 2025
ba86afc
Update input paths for `STARFUSION_BUILD` tests
delfiterradas Aug 4, 2025
15319ce
Merge branch 'master' into master
delfiterradas Aug 4, 2025
b213b86
Fix test
delfiterradas Aug 4, 2025
f6020ba
Migrate local `FASTQ_ALIGN_CONVERT_STAR_SAMTOOLS` subworkflow
delfiterradas Aug 5, 2025
d768c55
Merge branch 'nf-core:master' into fastq_align_star
delfiterradas Aug 5, 2025
c5a1c8a
Minor format changes
delfiterradas Aug 5, 2025
853376a
Fix alignment
delfiterradas Aug 5, 2025
3b14df5
Merge branch 'master' into master
delfiterradas Aug 5, 2025
7c40649
Update tests for unstable files
delfiterradas Aug 5, 2025
8e8fe38
Fix tests for unstable file size
delfiterradas Aug 6, 2025
b76d3e0
Add channel description
delfiterradas Aug 6, 2025
1abe097
REmove extra space
delfiterradas Aug 6, 2025
53701fd
Update tests to use nf-core test-datasets
delfiterradas Aug 6, 2025
713407f
Merge branch 'master' into master
delfiterradas Aug 6, 2025
bcda6c7
Merge pull request #1 from delfiterradas/master
delfiterradas Aug 6, 2025
4a3d40a
Merge branch 'master' into fastq_align_star
delfiterradas Aug 8, 2025
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
55 changes: 55 additions & 0 deletions subworkflows/nf-core/fastq_align_convert_star_samtools/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
include { SAMTOOLS_CONVERT } from '../../../modules/nf-core/samtools/convert/main'
include { STAR_ALIGN } from '../../../modules/nf-core/star/align/main'
include { SAMTOOLS_INDEX } from '../../../modules/nf-core/samtools/index/main.nf'

workflow FASTQ_ALIGN_CONVERT_STAR_SAMTOOLS {
take:
reads // channel: [ meta, [ fastq1, fastq2 ]]
index // channel: [ meta, index ]
gtf // channel: [ meta, gtf ]
fasta // channel: [ meta, fasta ]
fai // channel: [ meta, fai ]
ignore_sjdbgtf // boolean
cram // boolean: Create CRAM files

main:
def ch_versions = Channel.empty()
STAR_ALIGN(
reads,
index,
gtf,
ignore_sjdbgtf,
"", // seq_platform is handled in the config
"" // seq_center is handled in the config
)
ch_versions = ch_versions.mix(STAR_ALIGN.out.versions.first())

SAMTOOLS_INDEX(
STAR_ALIGN.out.bam_sorted_aligned
)
ch_versions = ch_versions.mix(SAMTOOLS_INDEX.out.versions.first())

ch_bam_bai = STAR_ALIGN.out.bam_sorted_aligned
.join(SAMTOOLS_INDEX.out.bai, failOnMismatch:true, failOnDuplicate:true)

def ch_cram_crai = Channel.empty()
if(cram) {
SAMTOOLS_CONVERT(
STAR_ALIGN.out.bam_sorted_aligned.map { meta, bam -> [ meta, bam, []] },
fasta,
fai
)
ch_versions = ch_versions.mix(SAMTOOLS_CONVERT.out.versions.first())
ch_cram_crai = SAMTOOLS_CONVERT.out.cram
.join(SAMTOOLS_CONVERT.out.crai, failOnMismatch:true, failOnDuplicate:true)
}

emit:
versions = ch_versions // channel: [ versions ]
bam_bai = ch_bam_bai // channel: [ val(meta), path(bam), path(bai) ]
cram_crai = ch_cram_crai // channel: [ val(meta), path(cram), path(crai) ]
junctions = STAR_ALIGN.out.junction // channel: [ val(meta), path(junction) ]
spl_junc_tabs = STAR_ALIGN.out.spl_junc_tab // channel: [ val(meta), path(spl_jun_tab) ]
log_final = STAR_ALIGN.out.log_final // channel: [ val(meta), path(log_final) ]
gene_count = STAR_ALIGN.out.read_per_gene_tab // channel: [ val(meta), path(read_per_gene_tab) ]
}
104 changes: 104 additions & 0 deletions subworkflows/nf-core/fastq_align_convert_star_samtools/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/subworkflows/yaml-schema.json
name: "FASTQ_ALIGN_CONVERT_STAR_SAMTOOLS"
description: "Align FASTQ reads using STAR, index BAM files with samtools, and optionally convert to CRAM format"
keywords:
- alignment
- star
- samtools
- rna-seq
- bam
- cram
- indexing
- conversion
components:
- samtools/convert
- star/align
- samtools/index
input:
- reads:
type: file
description: |
Structure: [ val(meta), path(fastq) ]
One or two FASTQ files for single or paired end data respectively.
pattern: "*.{fq,fastq,fq.gz,fastq.gz}"
- index:
type: directory
description: |
Structure: [ val(meta), path(index) ]
STAR genome index directory
pattern: "star_index"
- gtf:
type: file
description: |
Structure: [ val(meta), path(gtf) ]
Reference GTF annotation file
pattern: "*.{gtf,gtf.gz}"
- fasta:
type: file
description: |
Structure: [ val(meta), path(fasta) ]
Reference genome FASTA file
pattern: "*.{fa,fasta,fa.gz,fasta.gz}"
- fai:
type: file
description: |
Structure: [ val(meta), path(fai) ]
Reference genome FASTA index file
pattern: "*.fai"
- ignore_sjdbgtf:
type: boolean
description: Indicates whether to ignore splice junctions from GTF file
- cram:
type: boolean
description: Indicates whether to convert BAM files to CRAM format
output:
- versions:
type: file
description: |
Structure: [ path(versions.yml) ]
File containing software versions
pattern: "versions.yml"
- bam_bai:
type: file
description: |
Structure: [ val(meta), path("*.bam"), path ("*.bai") ]
Sorted BAM file and its index
pattern: "*.{bam,bai}"
- cram_crai:
type: file
description: |
Structure: [ val(meta), path("*.cram"), path("*.crai") ]
CRAM file and its index (optional, only when cram=true)
pattern: "*.{cram,crai}"
- junctions:
type: file
description: |
Structure: [ val(meta), path('*.out.junction') ]
STAR splice junction files
pattern: "*.SJ.out.tab"
- spl_junc_tabs:
type: file
description: |
Structure: [ tuple val(meta), path('*.SJ.out.tab') ]
STAR splice junction tab files
pattern: "*.tab"
- log_final:
type: file
description: |
Structure: [ val(meta), path('*Log.final.out') ]
STAR final log files
pattern: "*Log.final.out"
- gene_count:
type: file
description: |
Structure: [ val(meta), path('*.ReadsPerGene.out.tab') ]
STAR gene count files
pattern: "*ReadsPerGene.out.tab"
authors:
- "@rannick"
- "@nvnieuwk"
- "@atrigila"
maintainers:
- "@rannick"
- "@nvnieuwk"
- "@atrigila"
Loading
Loading