-
Notifications
You must be signed in to change notification settings - Fork 44
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
Update to Innuca's recipe modules #191
Open
cimendes
wants to merge
20
commits into
dev
Choose a base branch
from
innuca_update
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
49cf9f2
integrity_coverage template now checks the integrity of the read file…
cimendes 971e155
update container to integrity_coverage
cimendes 7a31fd5
added template mlst. Increases discriminatory power to the verificati…
cimendes 75b6a6d
fix typo
cimendes 7c8c9a7
add insert_size template
cimendes 2bdc6b1
added new retry to re-filter only by gc if assembly size is lower tha…
cimendes 7dad2fd
verifies the % of mapped reads, issuing an warning when it falls
cimendes 4163c48
new container directive for mlst process.
cimendes 06a0788
fix typo
cimendes 1a9242a
update true_coverage image
cimendes 577ed47
Merge branch 'dev' into innuca_update
cimendes 10ee738
add `insert_size` to innuca's recipe.
cimendes 3e9c331
Fix typo in changelog.md
tiagofilipe12 b3ad2da
update changelog
cimendes aca2fc8
Update changelog.md
cimendes 3303be8
Update flowcraft/generator/components/mapping.py
tiagofilipe12 a4f6745
update inser_size output type
cimendes e64efc9
Update flowcraft/templates/insert_size.py
tiagofilipe12 75e5ea7
code cleanup
cimendes e62ee23
Update to fastQC rules for emitting warning and fail messages.
cimendes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
IN_plot{{ pid }} = params.distribution_plot{{ param_id }} ? "True" : "False" | ||
|
||
|
||
process assembly_mapping_statistics_{{ pid }} { | ||
|
||
// Send POST request to platform | ||
{% include "post.txt" ignore missing %} | ||
|
||
tag { sample_id } | ||
|
||
input: | ||
set sample_id, file(assembly), file(fastq) from {{ input_channel }}.join(_LAST_fastq_{{ pid }}) | ||
|
||
output: | ||
set sample_id, file("samtools_stats.txt") into IN_insert_size_{{ pid }} | ||
{% with task_name="assembly_mapping_statistics" %} | ||
{%- include "compiler_channels.txt" ignore missing -%} | ||
{% endwith %} | ||
|
||
script: | ||
""" | ||
{ | ||
echo [DEBUG] BUILDING BOWTIE INDEX FOR ASSEMBLY: $assembly >> .command.log 2>&1 | ||
bowtie2-build --threads ${task.cpus} $assembly genome_index >> .command.log 2>&1 | ||
|
||
echo [DEBUG] MAPPING READS FROM $fastq >> .command.log 2>&1 | ||
bowtie2 -q --very-fast --threads ${task.cpus} -x genome_index -1 ${fastq[0]} -2 ${fastq[1]} \ | ||
--fr -I 0 -X 2000 --no-discordant --no-mixed --no-unal -S alignment.sam >> .command.log 2>&1 | ||
|
||
echo [DEBUG] GET STATISTICS FROM SAM: alignment.sam | ||
samtools stats alignment.sam > samtools_stats.txt | ||
|
||
if [ -f "alignment.sam" ] && [ -f "samtools_stats.txt" ] | ||
then | ||
echo pass > .status | ||
else | ||
echo fail > .status | ||
fi | ||
|
||
echo -n "" > .report.json | ||
echo -n "" > .versions | ||
} || { | ||
echo fail > .status | ||
} | ||
""" | ||
} | ||
|
||
|
||
process insert_size_{{ pid }} { | ||
|
||
// Send POST request to platform | ||
{% include "post.txt" ignore missing %} | ||
|
||
tag { sample_id } | ||
|
||
publishDir "results/assembly/insert_size_{{ pid }}/" | ||
|
||
input: | ||
set sample_id, file(sam_stats) from IN_insert_size_{{ pid }} | ||
val plot from IN_plot{{ pid }} | ||
|
||
output: | ||
file ("*insert_size_report.tab") | ||
file ("*insert_size_distribution.html") optional true | ||
{% with task_name="insert_size" %} | ||
{%- include "compiler_channels.txt" ignore missing -%} | ||
{% endwith %} | ||
|
||
script: | ||
template "insert_size.py" | ||
cimendes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
// If a species is not provided, it bypasses the species verification | ||
if (params.mlstSpecies{{ param_id }} == null){ | ||
IN_expected_species_{{ pid }} = Channel.value("PASS") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} else { | ||
IN_expected_species_{{ pid }} = Channel.value(params.mlstSpecies{{ param_id }}) | ||
} | ||
|
||
process mlst_{{ pid }} { | ||
|
||
|
@@ -10,6 +16,7 @@ process mlst_{{ pid }} { | |
|
||
input: | ||
set sample_id, file(assembly) from {{ input_channel }} | ||
val expected_species from IN_expected_species_{{ pid }} | ||
|
||
output: | ||
file '*.mlst.txt' into LOG_mlst_{{ pid }} | ||
|
@@ -19,30 +26,8 @@ process mlst_{{ pid }} { | |
{% endwith %} | ||
|
||
script: | ||
""" | ||
{ | ||
expectedSpecies=${params.mlstSpecies{{ param_id }}} | ||
mlst $assembly >> ${sample_id}.mlst.txt | ||
mlstSpecies=\$(cat *.mlst.txt | cut -f2) | ||
json_str="{'expectedSpecies':\'\$expectedSpecies\',\ | ||
'species':'\$mlstSpecies',\ | ||
'st':'\$(cat *.mlst.txt | cut -f3)',\ | ||
'tableRow':[{'sample':'${sample_id}','data':[\ | ||
{'header':'MLST species','value':'\$mlstSpecies','table':'typing'},\ | ||
{'header':'MLST ST','value':'\$(cat *.mlst.txt | cut -f3)','table':'typing'}]}]}" | ||
echo \$json_str > .report.json | ||
|
||
if [ ! \$mlstSpecies = \$expectedSpecies ]; | ||
then | ||
printf fail > .status | ||
else | ||
printf pass > .status | ||
fi | ||
|
||
} || { | ||
printf fail > .status | ||
} | ||
""" | ||
template "run_mlst.py" | ||
cimendes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
} | ||
|
||
process compile_mlst_{{ pid }} { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed with @miguelpmachado, to me this seems like enforcing an intrusive behavior that will easily fail in some setups. However in this case it seems better because default
cpus
is 1.