Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nextflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
nextflow
Commits
966a31ee
Verified
Commit
966a31ee
authored
2 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
Close merge request #28
parent
fa92e48e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nf_modules/star/main.nf
+153
-0
153 additions, 0 deletions
src/nf_modules/star/main.nf
with
153 additions
and
0 deletions
src/nf_modules/star/main.nf
0 → 100644
+
153
−
0
View file @
966a31ee
// STAR is an ultrafast universal RNA-seq aligner
//
// EXAMPLE:
/*
include {
index_with_gff as star_index_with_gff;
mapping_fastq as star_mapping_fastq
} from './nf_modules/star/main.nf'
addParams(
star_mapping_fastq_out: "star/"
)
star_index_with_gff(
genome_file,
gff_file
)
star_mapping_fastq(
star_index_with_gff.out.index,
reads
)
*/
version
=
"2.7.3a"
container_url
=
"lbmc/star:${version}"
params
.
star_mapping_fastq_out
=
""
process
gff3_2_gtf
{
container
=
"dceoy/cufflinks"
label
"small_mem_mono_cpus"
input:
tuple
val
(
genome_id
),
path
(
gff3_file
)
output:
path
"${genome_id}.gtf"
,
emit:
gtf
script:
"""
gffread ${gff3_file} -T -o ${genome_id}.gtf
"""
}
process
index_with_gtf
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
input:
tuple
val
(
genome_id
),
path
(
genome_fasta
)
path
gtf_file
output:
tuple
val
(
genome_id
),
path
(
"*"
),
emit:
index
script:
"""
STAR --runThreadN ${task.cpus} --runMode genomeGenerate \
--genomeDir ./ \
--genomeFastaFiles ${genome_fasta} \
--sjdbGTFfile ${gtf_file} \
--genomeSAindexNbases 13 # min(14, log2(GenomeLength)/2 - 1)
"""
}
workflow
index_with_gff
{
take:
genome_fasta
gff_file
main:
gff3_2_gtf
(
gff_file
)
index_with_gtf
(
genome_fasta
,
gff3_2_gtf
.
out
.
gtf
)
emit:
report
=
index_with_gtf
.
out
.
index
}
process
index_without_gff
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
input:
tuple
val
(
genome_id
),
path
(
genome_fasta
)
output:
tuple
val
(
genome_id
),
path
(
"*"
),
emit:
index
script:
"""
STAR --runThreadN ${task.cpus} --runMode genomeGenerate \
--genomeDir ./ \
--genomeFastaFiles ${genome_fasta} \
--genomeSAindexNbases 13 # min(14, log2(GenomeLength)/2 - 1)
"""
}
process
mapping_fastq
{
container
=
"${container_url}"
label
"big_mem_multi_cpus"
if
(
params
.
star_mapping_fastq_out
!=
""
)
{
publishDir
"results/${params.star_mapping_fastq_out}"
,
mode:
'copy'
}
input:
tuple
val
(
index_id
),
path
(
index
)
tuple
val
(
reads_id
),
path
(
reads
)
output:
path
"*.Log.final.out"
,
emit:
report
tuple
val
(
reads_id
),
path
(
"*.bam"
),
emit:
bam
script:
if
(
reads_id
instanceof
List
){
file_prefix
=
reads_id
[
0
]
}
else
{
file_prefix
=
reads_id
}
if
(
reads
.
size
()
==
2
)
"""
mkdir -p index
mv ${index} index/
STAR --runThreadN ${task.cpus} \
--genomeDir index/ \
--readFilesCommand zcat \
--readFilesIn ${reads[0]} ${reads[1]} \
--outFileNamePrefix ${reads_id}. \
--alignIntronMax 10000 \
--outSAMtype BAM SortedByCoordinate \
--outSAMstrandField intronMotif
mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
"""
else
"""
mkdir -p index
mv ${index} index/
STAR --runThreadN ${task.cpus} \
--genomeDir index/ \
--readFilesCommand zcat \
--readFilesIn ${reads} \
--outFileNamePrefix ${reads_id}. \
--alignIntronMax 10000 \
--outSAMtype BAM SortedByCoordinate \
--outSAMstrandField intronMotif
mv ${reads_id}.Aligned.sortedByCoord.out.bam ${reads_id}.bam
"""
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment