From c9d3c67a9b02e4f261400e9d08d12557dadd07e2 Mon Sep 17 00:00:00 2001 From: Guillermo del Angel Date: Mon, 8 Apr 2013 11:44:22 -0400 Subject: [PATCH] Small Queue/scala improvements, and commiting pipeline scripts developed for ancient DNA processing for posterity: -- Picard extension so Queue scripts can use FastqToSam -- Single-sample BAM processing: merge/trim reads + BWA + IR + MD + BQSR. Mostly identical to standard pipeline, except for the adaptor trimming/merging which is critical for short-insert libraries. -- Single-sample calling (experimental, work in progress): standard UG run but outputting at all sites, meant for deep whole genomes. New scripts --- .../queue/extensions/picard/FastqToSam.scala | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 public/scala/src/org/broadinstitute/sting/queue/extensions/picard/FastqToSam.scala diff --git a/public/scala/src/org/broadinstitute/sting/queue/extensions/picard/FastqToSam.scala b/public/scala/src/org/broadinstitute/sting/queue/extensions/picard/FastqToSam.scala new file mode 100644 index 000000000..7b9e657bf --- /dev/null +++ b/public/scala/src/org/broadinstitute/sting/queue/extensions/picard/FastqToSam.scala @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2012 The Broad Institute +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +* THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +package org.broadinstitute.sting.queue.extensions.picard + +/* +* Copyright (c) 2012 The Broad Institute +* +* Permission is hereby granted, free of charge, to any person +* obtaining a copy of this software and associated documentation +* files (the "Software"), to deal in the Software without +* restriction, including without limitation the rights to use, +* copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following +* conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +* THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +import org.broadinstitute.sting.commandline._ + +import java.io.File + +class FastqToSam extends org.broadinstitute.sting.queue.function.JavaCommandLineFunction /*with PicardBamFunction*/ { + analysisName = "FastqToSam" + javaMainClass = "net.sf.picard.sam.FastqToSam" + + @Input(shortName = "fq1", fullName = "input_fq_file1", required = true, doc = "Input Fastq file to extract reads from (single-end fastq or, if paired, first end of the pair fastq)") + var fastq: File = _ + + @Input(shortName = "fq2", fullName = "input_fq_file2", required = false, doc = "Input Fastq file to extract reads from (if paired, second end of the pair fastq).") + var secondEndFastQ: File = _ + + @Output(shortName = "bam", fullName = "output_bam_file", required = true, doc = "Output bam file .") + var bam: File = _ + + @Argument(shortName = "SM", fullName = "SM", required = false, doc = "SM") + var SM: String = "SM" + + @Argument(shortName = "LIB", fullName = "LIB", required = false, doc = "LIB") + var LIB: String = "LIB" + + @Argument(shortName = "PU", fullName = "PU", required = false, doc = "PU") + var PU: String = "PU" + + @Argument(shortName = "RG", fullName = "RG", required = false, doc = "RG") + var RG: String = "RG" + + @Argument(shortName = "PL", fullName = "PL", required = false, doc = "PL") + var PL: String = "illumina" + + @Argument(shortName = "CN", fullName = "CN", required = false, doc = "CN") + var CN: String = "CN" + + +// override def inputBams = Seq(fastq) +// override def outputBam = bam +// this.sortOrder = null + val createIndex:Boolean = true + override def commandLine = super.commandLine + + required("FASTQ=" + fastq) + + optional("FASTQ2=", secondEndFastQ, spaceSeparated=false) + + required("OUTPUT=" + bam) + + optional("READ_GROUP_NAME=", RG, spaceSeparated=false) + + required("SAMPLE_NAME=" + SM) + + optional("LIBRARY_NAME=", LIB, spaceSeparated=false) + + optional("PLATFORM_UNIT=", PU, spaceSeparated=false) + + optional("PLATFORM=", PL, spaceSeparated=false) + + optional("CREATE_INDEX=", createIndex, spaceSeparated=false) + + optional("SEQUENCING_CENTER=", CN, spaceSeparated=false) +} \ No newline at end of file