#!/usr/bin/env python
# Copyright 2006-2012 Mark Diekhans

import sys, os
# FIXME: should use virtualenv
sys.path.append(os.path.expanduser("/hive/groups/recon/projs/mus_strain_cactus/src/pycbio/lib"))
from optparse import OptionParser
from pycbio.hgdata import geneCheckDetails
from pycbio.sys import fileOps, pipeline

class CmdOpts(object):
    usage="""%prog [options] genePredCheckDetails outputBed

    """
    def __init__(self):
        parser = OptionParser(usage=CmdOpts.usage)
        (opts, args) = parser.parse_args()
        if len(args) != 2:
            parser.error("wrong number of arguments")
        self.genePredCheckDetails, self.outputBed = args
        self.__dict__.update(opts.__dict__)

def createBedRec(detail, bedFh):
    itemRgb = "128,0,0"
    desc = detail.problem+"/"
    if detail.info != None:
        desc += detail.info + "/"
    desc += detail.acc
    fileOps.prRowv(bedFh, detail.chr, detail.chrStart, detail.chrEnd, desc)

opts = CmdOpts()

with pipeline.Pipeline(["sort", "-k1,1", "-k2,2n"], "w", opts.outputBed) as bedFh:
    for detail in geneCheckDetails.GeneCheckDetailsReader(opts.genePredCheckDetails):
        createBedRec(detail, bedFh)

67e1e0386d50dd125d9cae8ac42c4c2fcd84f813
<mask token>


class CmdOpts(object):
    usage = '%prog [options] genePredCheckDetails outputBed\n\n    '

    def __init__(self):
        parser = OptionParser(usage=CmdOpts.usage)
        opts, args = parser.parse_args()
        if len(args) != 2:
            parser.error('wrong number of arguments')
        self.genePredCheckDetails, self.outputBed = args
        self.__dict__.update(opts.__dict__)


def createBedRec(detail, bedFh):
    itemRgb = '128,0,0'
    desc = detail.problem + '/'
    if detail.info != None:
        desc += detail.info + '/'
    desc += detail.acc
    fileOps.prRowv(bedFh, detail.chr, detail.chrStart, detail.chrEnd, desc)


<mask token>

<mask token>
sys.path.append(os.path.expanduser(
    '/hive/groups/recon/projs/mus_strain_cactus/src/pycbio/lib'))
<mask token>


class CmdOpts(object):
    usage = '%prog [options] genePredCheckDetails outputBed\n\n    '

    def __init__(self):
        parser = OptionParser(usage=CmdOpts.usage)
        opts, args = parser.parse_args()
        if len(args) != 2:
            parser.error('wrong number of arguments')
        self.genePredCheckDetails, self.outputBed = args
        self.__dict__.update(opts.__dict__)


def createBedRec(detail, bedFh):
    itemRgb = '128,0,0'
    desc = detail.problem + '/'
    if detail.info != None:
        desc += detail.info + '/'
    desc += detail.acc
    fileOps.prRowv(bedFh, detail.chr, detail.chrStart, detail.chrEnd, desc)


<mask token>
with pipeline.Pipeline(['sort', '-k1,1', '-k2,2n'], 'w', opts.outputBed
    ) as bedFh:
    for detail in geneCheckDetails.GeneCheckDetailsReader(opts.
        genePredCheckDetails):
        createBedRec(detail, bedFh)

<mask token>
sys.path.append(os.path.expanduser(
    '/hive/groups/recon/projs/mus_strain_cactus/src/pycbio/lib'))
<mask token>


class CmdOpts(object):
    usage = '%prog [options] genePredCheckDetails outputBed\n\n    '

    def __init__(self):
        parser = OptionParser(usage=CmdOpts.usage)
        opts, args = parser.parse_args()
        if len(args) != 2:
            parser.error('wrong number of arguments')
        self.genePredCheckDetails, self.outputBed = args
        self.__dict__.update(opts.__dict__)


def createBedRec(detail, bedFh):
    itemRgb = '128,0,0'
    desc = detail.problem + '/'
    if detail.info != None:
        desc += detail.info + '/'
    desc += detail.acc
    fileOps.prRowv(bedFh, detail.chr, detail.chrStart, detail.chrEnd, desc)


opts = CmdOpts()
with pipeline.Pipeline(['sort', '-k1,1', '-k2,2n'], 'w', opts.outputBed
    ) as bedFh:
    for detail in geneCheckDetails.GeneCheckDetailsReader(opts.
        genePredCheckDetails):
        createBedRec(detail, bedFh)

import sys, os
sys.path.append(os.path.expanduser(
    '/hive/groups/recon/projs/mus_strain_cactus/src/pycbio/lib'))
from optparse import OptionParser
from pycbio.hgdata import geneCheckDetails
from pycbio.sys import fileOps, pipeline


class CmdOpts(object):
    usage = '%prog [options] genePredCheckDetails outputBed\n\n    '

    def __init__(self):
        parser = OptionParser(usage=CmdOpts.usage)
        opts, args = parser.parse_args()
        if len(args) != 2:
            parser.error('wrong number of arguments')
        self.genePredCheckDetails, self.outputBed = args
        self.__dict__.update(opts.__dict__)


def createBedRec(detail, bedFh):
    itemRgb = '128,0,0'
    desc = detail.problem + '/'
    if detail.info != None:
        desc += detail.info + '/'
    desc += detail.acc
    fileOps.prRowv(bedFh, detail.chr, detail.chrStart, detail.chrEnd, desc)


opts = CmdOpts()
with pipeline.Pipeline(['sort', '-k1,1', '-k2,2n'], 'w', opts.outputBed
    ) as bedFh:
    for detail in geneCheckDetails.GeneCheckDetailsReader(opts.
        genePredCheckDetails):
        createBedRec(detail, bedFh)

#!/usr/bin/env python
# Copyright 2006-2012 Mark Diekhans

import sys, os
# FIXME: should use virtualenv
sys.path.append(os.path.expanduser("/hive/groups/recon/projs/mus_strain_cactus/src/pycbio/lib"))
from optparse import OptionParser
from pycbio.hgdata import geneCheckDetails
from pycbio.sys import fileOps, pipeline

class CmdOpts(object):
    usage="""%prog [options] genePredCheckDetails outputBed

    """
    def __init__(self):
        parser = OptionParser(usage=CmdOpts.usage)
        (opts, args) = parser.parse_args()
        if len(args) != 2:
            parser.error("wrong number of arguments")
        self.genePredCheckDetails, self.outputBed = args
        self.__dict__.update(opts.__dict__)

def createBedRec(detail, bedFh):
    itemRgb = "128,0,0"
    desc = detail.problem+"/"
    if detail.info != None:
        desc += detail.info + "/"
    desc += detail.acc
    fileOps.prRowv(bedFh, detail.chr, detail.chrStart, detail.chrEnd, desc)

opts = CmdOpts()

with pipeline.Pipeline(["sort", "-k1,1", "-k2,2n"], "w", opts.outputBed) as bedFh:
    for detail in geneCheckDetails.GeneCheckDetailsReader(opts.genePredCheckDetails):
        createBedRec(detail, bedFh)
