Merge branch 'CW-7212' into 'dev'
Exclude non existent samples or samples without reads after ingress Closes CW-7212 See merge request epi2melabs/workflows/wf-transcriptomes!255
This commit is contained in:
commit
c87a5ce09c
23
main.nf
23
main.nf
@ -303,14 +303,27 @@ workflow {
|
|||||||
"input": params.bam,
|
"input": params.bam,
|
||||||
] + ingress_args, ref_genome)
|
] + ingress_args, ref_genome)
|
||||||
}
|
}
|
||||||
|
|
||||||
analysis_samples = samples
|
analysis_samples = samples
|
||||||
.filter { meta, xam, xai, stats ->
|
.filter { meta, xam, xai, stats ->
|
||||||
if (meta.n_seqs == 0) {
|
boolean is_excluded = false
|
||||||
log.warn("Sample ${meta.alias} has no reads - excluded from transcriptome analysis.")
|
String excluded_reason = null
|
||||||
return false
|
if (meta.n_primary == 0) {
|
||||||
|
excluded_reason = "has no reads"
|
||||||
|
is_excluded = true
|
||||||
|
} else if (meta.n_primary == null) {
|
||||||
|
excluded_reason = "was not found during ingress"
|
||||||
|
is_excluded = true
|
||||||
}
|
}
|
||||||
true
|
if (is_excluded) {
|
||||||
|
log.warn("Sample ${meta.alias} ${excluded_reason} and will be excluded from transcriptome analysis.")
|
||||||
|
if (params.de_analysis) {
|
||||||
|
throw new Exception("""\
|
||||||
|
Differential gene expression and differential transcript analyses
|
||||||
|
requires all the samples present in the sample sheet to have reads.
|
||||||
|
""".stripIndent())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !is_excluded
|
||||||
}
|
}
|
||||||
.ifEmpty {
|
.ifEmpty {
|
||||||
throw new Exception("No samples with reads were available for transcriptome analysis.")
|
throw new Exception("No samples with reads were available for transcriptome analysis.")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user