Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ChIPster
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
Xavier Grand
ChIPster
Commits
192fef09
Verified
Commit
192fef09
authored
3 years ago
by
Laurent Modolo
Browse files
Options
Downloads
Patches
Plain Diff
bowtie2: change file_id handling
parent
5a367584
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CONTRIBUTING.md
+11
-4
11 additions, 4 deletions
CONTRIBUTING.md
src/nf_modules/bowtie2/main.nf
+10
-4
10 additions, 4 deletions
src/nf_modules/bowtie2/main.nf
with
21 additions
and
8 deletions
CONTRIBUTING.md
+
11
−
4
View file @
192fef09
...
...
@@ -125,15 +125,22 @@ process fastp {
Here `
file_id
` can be anything from a simple identifier to a list of several variables.
In which case the first item of the List should be usable as a file prefix.
So you have to keep that in mind if you want to use it to define output file names (you can test for that with `
file_id instanceof List
`).
In some case, the `
file_id
` may be a Map to have a cleaner access to the `
file_id
` content by explicit keywords.
If you want to use information within the `
file_id
` to name outputs in your `
script
` section, you can use the following snipet:
```Groovy
script:
if (file_id instanceof List){
file_prefix = file_id[0]
} else {
file_prefix = file_id
switch(file_id) {
case {it instanceof List}:
file_prefix = file_id[0]
break
case {it instanceof Map}:
file_prefix = file_id.values()[0]
break
default:
file_id
break
}
```
...
...
This diff is collapsed.
Click to expand it.
src/nf_modules/bowtie2/main.nf
+
10
−
4
View file @
192fef09
...
...
@@ -56,10 +56,16 @@ process mapping_fastq {
index_id
=
(
index_file
=~
/(.*)\.1\.bt2/
)[
0
][
1
]
}
}
if
(
file_id
instanceof
List
){
file_prefix
=
file_id
[
0
]
}
else
{
file_prefix
=
file_id
switch
(
file_id
)
{
case
{
it
instanceof
List
}:
file_prefix
=
file_id
[
0
]
break
case
{
it
instanceof
Map
}:
file_prefix
=
file_id
.
values
()[
0
]
break
default:
file_id
break
}
if
(
reads
.
size
()
==
2
)
...
...
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