Last active
March 25, 2019 22:38
-
-
Save IanSudbery/cc274d97d38fd88df34ca392b7a0d859 to your computer and use it in GitHub Desktop.
Example of standard ruffus syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ruffus import transform, suffix, pipeline_run | |
from task_functions import run_bwa, sort_bam | |
@transform("*.fastq", suffix(".fastq"), ".bam") | |
def step1(infile, outfile); | |
run_bwa(infile, outfile) | |
@transform(run_bwa, suffix(".bam"), ".sorted_bam") | |
def step2(infile, outfile): | |
sort_bam(infile, outfile) | |
pipeline_run([step2], multithread=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ruffus import transform, suffix, pipeline_run | |
@transform("*.fastq", suffix(".fastq"), ".bam") | |
def run_bwa(input_file, output_file): | |
print "Align DNA sequences in %s to a genome -> %s " % (input_file, output_file) | |
# make dummy output file | |
open(output_file, "w").close() | |
@transform(run_bwa, suffix(".bam"), ".sorted_bam") | |
def sort_bam(input_file, output_file): | |
print "Sort DNA sequences in %s -> %s " % (input_file, output_file) | |
# make dummy output file | |
open(output_file, "w").close() | |
pipeline_run([sort_bam], multithread = 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment