diff --git a/modules/nf-core/cellranger/count/templates/cellranger_count.py b/modules/nf-core/cellranger/count/templates/cellranger_count.py index 4bfb9f4f..76878969 100644 --- a/modules/nf-core/cellranger/count/templates/cellranger_count.py +++ b/modules/nf-core/cellranger/count/templates/cellranger_count.py @@ -31,14 +31,25 @@ def chunk_iter(seq, size): fastq_all = Path("./fastq_all") fastq_all.mkdir(exist_ok=True) +# FIXME: Generalize this filename pattern once we better understand it +""" +Old file name matching from NF-core # Match R1 in the filename, but only if it is followed by a non-digit or non-character # match "file_R1.fastq.gz", "file.R1_000.fastq.gz", etc. but # do not match "SRR12345", "file_INFIXR12", etc -filename_pattern = r"([^a-zA-Z0-9])R1([^a-zA-Z0-9])" +# filename_pattern = r"([^a-zA-Z0-9])R1([^a-zA-Z0-9])" +""" +# FIXME: This is working locally but not on AWS Batch +# filename_pattern = r"(.+)_1" +# print(filename_pattern) for i, (r1, r2) in enumerate(chunk_iter(fastqs, 2)): # double escapes are required because nextflow processes this python 'template' - if re.sub(filename_pattern, r"\\1R2\\2", r1.name) != r2.name: + # FIXME: Generalize this pattern switching function once we standardize the filename pattern + # if re.sub(filename_pattern, r"\\1R2\\2", r1.name) != r2.name: + # FIXME: This is working locally but not on AWS Batch + # if re.sub(filename_pattern, r"\1_2", r1.name) != r2.name: + if r1.name.replace("_1", "_2") != r2.name: raise AssertionError( dedent( f"""\ @@ -55,11 +66,13 @@ def chunk_iter(seq, size): r1.rename(fastq_all / f"{sample_id}_S1_L{i:03d}_R1_001.fastq.gz") r2.rename(fastq_all / f"{sample_id}_S1_L{i:03d}_R2_001.fastq.gz") +# FIXME: Add toggle for introns based on sc vs snRNA run( # fmt: off [ "cellranger", "count", "--id", "${prefix}", + '--include-introns', 'false', "--fastqs", str(fastq_all), "--transcriptome", "${reference.name}", "--localcores", "${task.cpus}",