Skip to content

Commit

Permalink
refactor: change filtering for failed samples CDCgov#147
Browse files Browse the repository at this point in the history
  • Loading branch information
slsevilla committed Mar 28, 2024
1 parent 320cb64 commit f0876a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ process {
[
path: { "${params.outdir}/${meta.id}/file_integrity" },
mode: 'copy',
pattern: "*{_summary.txt}"
pattern: "*{_summary_fairy.txt}"
]
]
}
Expand Down
5 changes: 2 additions & 3 deletions modules/local/fairy_corruption_check.nf
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ process CORRUPTION_CHECK {
val(busco_val)

output:
tuple val(meta), path('*_summary.txt'), emit: outcome
tuple val(meta), path('*_summary_old.txt'), emit: outcome_to_edit
tuple val(meta), path('*_summary_fairy.txt'), emit: outcome
path('*_summaryline.tsv'), optional:true, emit: summary_line
tuple val(meta), path('*.synopsis'), optional:true, emit: synopsis
path("versions.yml"), emit: versions
Expand All @@ -37,7 +36,7 @@ process CORRUPTION_CHECK {
script_version=\$(${ica}fairy_proc.sh -V)
#making a copy of the summary file to pass to READ_COUNT_CHECKS to handle file names being the same
cp ${prefix}_summary.txt ${prefix}_summary_old.txt
mv ${prefix}_summary.txt ${prefix}_summary_fairy.txt
cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
5 changes: 3 additions & 2 deletions workflows/phoenix.nf
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ workflow PHOENIX_EXTERNAL {

//Combining reads with output of corruption check. By=2 is for getting R1 and R2 results
//The mapping here is just to get things in the right bracket so we can call var[0]
read_stats_ch = INPUT_CHECK.out.reads.join(CORRUPTION_CHECK.out.outcome_to_edit, by: [0,0])
.join(CORRUPTION_CHECK.out.outcome.splitCsv(strip:true, by:2).map{meta, fairy_outcome -> [meta, [fairy_outcome[0][0], fairy_outcome[1][0]]]}, by: [0,0])
read_stats_ch = INPUT_CHECK.out.reads.join(CORRUPTION_CHECK.out.outcome, by: [0,0])
.join(CORRUPTION_CHECK.out.outcome.splitCsv(strip:true, by:2).map{meta, fairy_outcome -> [meta, [fairy_outcome[0][0], fairy_outcome[1][0]]]}, by: [0,0])
.filter { it[3].findAll {!it.contains('FAILED')}}

//Get stats on raw reads if the reads aren't corrupted
GET_RAW_STATS (
Expand Down

0 comments on commit f0876a8

Please sign in to comment.