Exemplo n.º 1
0
Arquivo: utils.py Projeto: lowks/SDST
                        readfile2=opts.readFile2,
                        indexfile=opts.indexFile,
                        indexes=opts.index)
        else:
            demultiplex(readfile=opts.readFile1,
                        readfile2=opts.readFile2,
                        indexfile=opts.indexFile,
                        indexfile2=opts.indexFile2,
                        indexes=opts.index)
    else:
        demultiplex(readfile=opts.readFile1,
                    indexfile=opts.indexFile,
                    indexes=opts.index)


utils_parser = subparsers.add_parser('utils')
utils_subparsers = utils_parser.add_subparsers(help="General utilities")
demultiplex_parser = utils_subparsers.add_parser(
    'demultiplex', help="Demultiplex a set of fastq files")
demultiplex_parser.add_argument('-1', '--readFile1', help="read1 filename")
demultiplex_parser.add_argument('-2', '--readFile2', help="read2 filename")
demultiplex_parser.add_argument('-i', '--indexFile', help="index Filename")
demultiplex_parser.add_argument('-j', '--indexFile2', help="index Filename")
demultiplex_parser.add_argument(
    '-x',
    '--index',
    type=str,
    action='append',
    help=
    "The indexes, one per index or comma-separated pairs for dual-barcode indexing"
)
Exemplo n.º 2
0
def RNAcounts(opts):
    if(opts.vcf):
        f = open(opts.vcf,mode='r',errors='ignore')
        v = vcf.Reader(f)
    else:
        v = vcf.Reader(sys.stdin)
    if(opts.outfile):
        outfile = open(opts.outfile,'w')
    else:
        outfile = sys.stdout
    bamfile = pysam.Samfile(opts.bamfile)
    seqtools.seqvcf.countBases(v,outfile,bamfile)
    outfile.close()


varscan_parser = subparsers.add_parser('vcf')
varscan_subparsers = varscan_parser.add_subparsers(help="vcf subcommands")
meltVcf_parser = varscan_subparsers.add_parser('melt',
                                              help="Melt a VCF file into a tab-delimited text file with special treatment of snpEff annotation")
meltVcf_parser.add_argument('-f','--vcf',
                            help='Filename of VCF file [default=stdin]')
meltVcf_parser.add_argument('-o','--outfile',
                            help='Filename of VCF file [default=stdout]')
meltVcf_parser.add_argument('-s','--samplename',default=None,
                            help='Sample name to include in first column of output [default=None]')
meltVcf_parser.add_argument('-i','--includeHeader',action='store_true',
                            help='Include VCF header in the output; useful for including definitions of columns')
meltVcf_parser.add_argument('-g','--includeGenotypes',action='store_true',
                            help='Include genotypes for each sample (XXX.GT in column header) if available')
meltVcf_parser.set_defaults(func=meltVcf)
Exemplo n.º 3
0
def RNAcounts(opts):
    if (opts.vcf):
        f = open(opts.vcf, mode='r', errors='ignore')
        v = vcf.Reader(f)
    else:
        v = vcf.Reader(sys.stdin)
    if (opts.outfile):
        outfile = open(opts.outfile, 'w')
    else:
        outfile = sys.stdout
    bamfile = pysam.Samfile(opts.bamfile)
    seqtools.seqvcf.countBases(v, outfile, bamfile)
    outfile.close()


varscan_parser = subparsers.add_parser('vcf')
varscan_subparsers = varscan_parser.add_subparsers(help="vcf subcommands")
meltVcf_parser = varscan_subparsers.add_parser(
    'melt',
    help=
    "Melt a VCF file into a tab-delimited text file with special treatment of snpEff annotation"
)
meltVcf_parser.add_argument('-f',
                            '--vcf',
                            help='Filename of VCF file [default=stdin]')
meltVcf_parser.add_argument('-o',
                            '--outfile',
                            help='Filename of VCF file [default=stdout]')
meltVcf_parser.add_argument(
    '-s',
    '--samplename',
Exemplo n.º 4
0
import sys
import argparse
from seqtools.main import subparsers
from seqtools.varscan import fixVarscanVcfFile


def fixVcf(opts):
    if (not opts.varscan):
        varscan = fixVarscanVcfFile(sys.stdin)
    else:
        varscan = fixVarscanVcfFile(opts.varscan)
    for line in varscan:
        print(line)


varscan_parser = subparsers.add_parser('varscan')
varscan_subparsers = varscan_parser.add_subparsers(help="VarScan subcommands")
fixVcf_parser = varscan_subparsers.add_parser(
    'fixVcf',
    help="Fix the FREQ field and the ALT field in varscan VCF output")
fixVcf_parser.add_argument('-f',
                           '--varscan',
                           default=sys.stdin,
                           type=argparse.FileType('r'),
                           help='Filename of varscan VCF file [default=stdin]')
fixVcf_parser.set_defaults(func=fixVcf)
Exemplo n.º 5
0
import sys
import argparse
from seqtools.main import subparsers
from seqtools.varscan import fixVarscanVcfFile


def fixVcf(opts):
    if(not opts.varscan):
        varscan = fixVarscanVcfFile(sys.stdin)
    else:
        varscan = fixVarscanVcfFile(opts.varscan)
    for line in varscan:
        print(line)

varscan_parser = subparsers.add_parser('varscan')
varscan_subparsers = varscan_parser.add_subparsers(help="VarScan subcommands")
fixVcf_parser = varscan_subparsers.add_parser('fixVcf',
                                              help="Fix the FREQ field and the ALT field in varscan VCF output")
fixVcf_parser.add_argument('-f','--varscan',default=sys.stdin,
                           type=argparse.FileType('r'),
                           help='Filename of varscan VCF file [default=stdin]')
fixVcf_parser.set_defaults(func=fixVcf)
Exemplo n.º 6
0
from seqtools.main import subparsers
import seqtools.strucvar
import seqtools.strucvar.crest

def crestToBed(opts):
    with open(opts.predSVfile,'r') as f:
        for line in f:
            if(opts.samplename is not None):
                print(seqtools.strucvar.crest.crestLineToBedLines(line,opts.samplename))
            else:
                print(seqtools.strucvar.crest.crestLineToBedLines(line))
                


strucvar_parser = subparsers.add_parser('strucvar')
strucvar_subparsers = strucvar_parser.add_subparsers(help="Structural variation subcommands")
crestToBed_parser = strucvar_subparsers.add_parser('crestToBed',
                                                   help="convert CREST output to two BED records per line")
crestToBed_parser.add_argument('-s','--samplename',default=None,type=str,
                               help="sample information to add to the BED 'name' column")
crestToBed_parser.add_argument('predSVfile',help="The name of the CREST predSV.txt file")

crestToBed_parser.set_defaults(func=crestToBed)

Exemplo n.º 7
0
Arquivo: utils.py Projeto: lowks/SDST
            demultiplex(readfile = opts.readFile1,
                        readfile2 = opts.readFile2,
                        indexfile = opts.indexFile,
                        indexes = opts.index)
        else:
            demultiplex(readfile = opts.readFile1,
                        readfile2 = opts.readFile2,
                        indexfile = opts.indexFile,
                        indexfile2 = opts.indexFile2,
                        indexes = opts.index)
    else:
        demultiplex(readfile = opts.readFile1,
                    indexfile = opts.indexFile,
                    indexes = opts.index)

utils_parser = subparsers.add_parser('utils')
utils_subparsers = utils_parser.add_subparsers(help="General utilities")
demultiplex_parser = utils_subparsers.add_parser('demultiplex',
                                                 help="Demultiplex a set of fastq files")
demultiplex_parser.add_argument('-1','--readFile1',
                    help="read1 filename")
demultiplex_parser.add_argument('-2','--readFile2',
                    help="read2 filename")
demultiplex_parser.add_argument('-i','--indexFile',
                    help="index Filename")
demultiplex_parser.add_argument('-j','--indexFile2',
                    help="index Filename")
demultiplex_parser.add_argument('-x','--index',type=str,action='append',
                    help="The indexes, one per index or comma-separated pairs for dual-barcode indexing")

demultiplex_parser.set_defaults(func=demultiplex_setup)