Commit 64f71be7 authored by Peter van 't Hof's avatar Peter van 't Hof
Browse files

Remove old scripts

parent d4cad0b9
#!/usr/bin/env python
#
# Biopet is built on top of GATK Queue for building bioinformatic
# pipelines. It is mainly intended to support LUMC SHARK cluster which is running
# SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
# should also be able to execute Biopet tools and pipelines.
#
# Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
#
# Contact us at: sasc@lumc.nl
#
# A dual licensing mode is applied. The source code within this project that are
# not part of GATK Queue is freely available for non-commercial use under an AGPL
# license; For commercial users or users who do not want to follow the AGPL
# license, please contact us to obtain a separate license.
#
# prep_deepsage.py
#
# Script for preprocessing deepSAGE sequencing samples.
#
# Adapted from: http://galaxy.nbic.nl/u/pacthoen/w/deepsagelumc
import argparse
from Bio import SeqIO
PREFIX = 'CATG'
def prep_deepsage(input_fastq, output_fastq, is_gzip, seq):
if is_gzip:
import gzip
opener = gzip.GzipFile
else:
opener = open
with opener(input_fastq, 'r') as in_handle, open(output_fastq, 'w') as \
out_handle:
# adapted from fastools.fastools.add
# not importing since we also need to cut away parts of the sequence
for rec in SeqIO.parse(in_handle, 'fastq'):
qual = rec.letter_annotations['phred_quality']
rec.letter_annotations = {}
rec.seq = seq + rec.seq
rec.letter_annotations = {'phred_quality': [40] * len(seq) +
qual}
SeqIO.write(rec, out_handle, "fastq")
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('input_fastq', type=str,
help="Path to input FASTQ file")
parser.add_argument('-o', '--output', type=str,
dest='output_fastq',
default="prep_deepsage_output.fq",
help="Path to output FASTQ file")
parser.add_argument('--gzip', dest='gzip',
action='store_true',
help="Whether input FASTQ file is gzipped or not.")
parser.add_argument('--prefix', dest='prefix', type=str,
default=PREFIX,
help="Whether input FASTQ file is gzipped or not.")
args = parser.parse_args()
prep_deepsage(args.input_fastq, args.output_fastq, args.gzip, args.prefix)
/**
* Biopet is built on top of GATK Queue for building bioinformatic
* pipelines. It is mainly intended to support LUMC SHARK cluster which is running
* SGE. But other types of HPC that are supported by GATK Queue (such as PBS)
* should also be able to execute Biopet tools and pipelines.
*
* Copyright 2014 Sequencing Analysis Support Core - Leiden University Medical Center
*
* Contact us at: sasc@lumc.nl
*
* A dual licensing mode is applied. The source code within this project that are
* not part of GATK Queue is freely available for non-commercial use under an AGPL
* license; For commercial users or users who do not want to follow the AGPL
* license, please contact us to obtain a separate license.
*/
package nl.lumc.sasc.biopet.scripts
import nl.lumc.sasc.biopet.core.config.Configurable
import nl.lumc.sasc.biopet.extensions.PythonCommandLineFunction
import org.broadinstitute.gatk.utils.commandline.{ Input, Output, Argument }
import java.io.File
class PrefixFastq(val root: Configurable) extends PythonCommandLineFunction {
setPythonScript("prefixFastq.py")
@Input(doc = "Input file")
var input: File = _
@Output(doc = "output File")
var output: File = _
@Argument(doc = "Prefix sequence")
var prefix: String = "CATG"
@Argument(doc = "Input file is gziped", required = false)
var gzip: Boolean = _
override def beforeCmd {
if (input.getName.endsWith(".gzip") || input.getName.endsWith("gz")) gzip = true
}
def cmdLine = getPythonCommand +
required("-o", output) +
required("--prefix", prefix) +
required(input)
}
object PrefixFastq {
def apply(root: Configurable, input: File, outputDir: String): PrefixFastq = {
val prefixFastq = new PrefixFastq(root)
prefixFastq.input = input
prefixFastq.output = new File(outputDir, input.getName + ".prefix.fastq")
return prefixFastq
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment