Skip to content

Commit ab845b6

Browse files
committed
sample
1 parent 8ac4c40 commit ab845b6

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

modules/local/subsample.nf

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ process SEQTK_SAMPLE {
1010
'quay.io/biocontainers/seqtk:1.3--h5bf99c6_3' }"
1111

1212
input:
13-
tuple val(meta), path(reads)
14-
val subsample_str
15-
val random_seed
13+
tuple val(meta), path(reads), val(subsample_str), val(random_seed)
1614

1715
output:
1816
tuple val(meta), path("*.fastq.gz"), emit: reads

modules/local/umitools_umi_extract.nf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
process UMITOOLS_UMI_EXTRACT {
22
tag "$meta.id"
3-
label 'process_medium'
3+
label 'process_low'
44

55
conda (params.enable_conda ? "bioconda::umi_tools=1.1.2" : null)
66
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?

subworkflows/local/trim_fastp.nf

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,21 @@ workflow TRIM_FASTP {
2828
//TODO: try to shift smart subsample before UMI processing
2929
//problem is that we might need 3-4 fastq files, not the 2 standard ones
3030

31-
//Fixed seed for reproducibility
32-
//random_seed = 42
33-
//SEQTK_SAMPLE (
34-
// umi_processed, subsample_nr, random_seed
35-
//)
36-
37-
//random seed subsample each sample
38-
val random = new Random(42)
31+
32+
//use random seed per sample (subsampling study) or fixed seed for all samples
33+
//def DO_RANDOM = params.subsample_random_seed ?: false not implemented
34+
def DO_RANDOM = true
35+
def RANDOM_SEED = 42
36+
def random = new Random(RANDOM_SEED)
3937
umi_processed.map { meta, reads ->
40-
def random_seed = random.nextInt(10000)
41-
return tuple( tuple(meta, reads), subsample_nr, random_seed )
38+
if(DO_RANDOM){
39+
rs = random.nextInt(10000)
40+
} else {
41+
rs = RANDOM_SEED
42+
}
43+
tuple( meta, reads, subsample_nr, rs )
4244
}.set { umi_processed_with_seed }
43-
SEQTK_SAMPLE ( umi_processed_with_seed )
44-
45+
SEQTK_SAMPLE( umi_processed_with_seed )
4546
ch_versions = ch_versions.mix(SEQTK_SAMPLE.out.versions.first())
4647

4748
//

0 commit comments

Comments
 (0)