Skip to content

Instantly share code, notes, and snippets.

@audy
Last active October 20, 2023 20:44
Show Gist options
  • Save audy/2b0145689dcafb1b2ec70fd9b680e295 to your computer and use it in GitHub Desktop.
Save audy/2b0145689dcafb1b2ec70fd9b680e295 to your computer and use it in GitHub Desktop.
# Rule to count the number of lines in input.interleaved.fastq
rule count_lines:
input:
"input.interleaved.fastq"
output:
"line_count.txt"
shell:
"wc -l < {input} > {output}"
# Rule to convert paired-end FASTQ files to interleaved format
# TODO: actually *interleave* them
rule convert_to_interleaved:
input:
R1="input_R1.fastq",
R2="input_R2.fastq"
output:
"input.interleaved.fastq"
shell:
"cat {input.R1} {input.R2} > {output}"
# Rule to symlink input.fastq to input.interleaved.fastq
rule symlink_input:
input:
"input.fastq"
output:
"input.interleaved.fastq"
run:
import os
os.symlink(input[0], output[0])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment