Ejemplo n.º 1
0
def test_sync_splitmapper_execution():
    gem.loglevel("debug")
    input = files.open(testfiles["reads_1.fastq"])
    mappings = gem.splitmapper(input, index, results_dir + "/splitmap_out.mapping")
    assert mappings is not None
    assert mappings.process is not None
    assert mappings.filename == results_dir + "/splitmap_out.mapping"
    assert os.path.exists(results_dir + "/splitmap_out.mapping")
    assert sum(1 for x in mappings) == 10000
Ejemplo n.º 2
0
def test_sync_splitmapper_execution():
    gem.loglevel("debug")
    input = files.open(testfiles["reads_1.fastq"])
    mappings = gem.splitmapper(input, index,
                               results_dir + "/splitmap_out.mapping")
    assert mappings is not None
    assert mappings.process is not None
    assert mappings.filename == results_dir + "/splitmap_out.mapping"
    assert os.path.exists(results_dir + "/splitmap_out.mapping")
    assert sum(1 for x in mappings) == 10000
Ejemplo n.º 3
0
def gemtools():
    try:
        parser = argparse.ArgumentParser(prog="gemtools",
                description="Gemtools driver to execute different gemtools command and pipelines"
                )
        parser.add_argument('--loglevel', dest="loglevel", default=None, help="Log level (error, warn, info, debug)")
        parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __VERSION__)

        commands = {
            "index": gem.production.Index,
            "hash": gem.production.Hash,
            "rna-pipeline": gem.production.RnaPipeline,
            "t-index": gem.production.TranscriptIndex,
            "merge": gem.production.Merge,
            "gtf-junctions": gem.production.Junctions,
            "denovo-junctions": gem.production.JunctionExtraction,
            "stats": gem.production.Stats,
            "report": gem.production.StatsReport
        }
        instances = {}

        subparsers = parser.add_subparsers(title="commands", metavar="<command>", description="Available commands", dest="command")
        for name, cmdClass in commands.items():
            p = subparsers.add_parser(name, help=cmdClass.title, description=cmdClass.description)
            instances[name] = cmdClass()
            instances[name].register(p)

        args = parser.parse_args()
        if args.loglevel is not None:
            gem.loglevel(args.loglevel)

        # register cleanup signal handler
        def cleanup_in_signal(signal, frame):
            # cleanup
            gem.utils.teminate_processes()
            gem.files._cleanup()

        signal.signal(signal.SIGINT, cleanup_in_signal)
        signal.signal(signal.SIGQUIT, cleanup_in_signal)
        signal.signal(signal.SIGHUP, cleanup_in_signal)
        signal.signal(signal.SIGTERM, cleanup_in_signal)

        try:
            instances[args.command].run(args)
        except gem.utils.CommandException, e:
            sys.stderr.write("%s\n" % (str(e)))
            exit(1)
    except KeyboardInterrupt:
        gem.utils.teminate_processes()
        gem.files._cleanup()
        exit(1)
    finally:
        # cleanup
        gem.utils.teminate_processes()
        gem.files._cleanup()
Ejemplo n.º 4
0
def gemtools():
    try:
        parser = argparse.ArgumentParser(
            prog="gemtools",
            description=
            "Gemtools driver to execute different gemtools command and pipelines"
        )
        parser.add_argument('--loglevel',
                            dest="loglevel",
                            default=None,
                            help="Log level (error, warn, info, debug)")
        parser.add_argument('-v',
                            '--version',
                            action='version',
                            version='%(prog)s ' + __VERSION__)

        commands = {
            "index": gem.production.Index,
            "rna-pipeline": gem.production.RnaPipeline,
            "t-index": gem.production.TranscriptIndex,
            "gtfcount": gem.production.GtfCount,
            "merge": gem.production.Merge,
            "convert": gem.production.Convert,
            "gtf-junctions": gem.production.Junctions,
            "denovo-junctions": gem.production.JunctionExtraction,
            "stats": gem.production.Stats,
            "filter": gem.production.Filter,
            "report": gem.production.StatsReport,
        }
        instances = {}

        subparsers = parser.add_subparsers(title="commands",
                                           metavar="<command>",
                                           description="Available commands",
                                           dest="command")
        for name, cmdClass in commands.items():
            p = subparsers.add_parser(name,
                                      help=cmdClass.title,
                                      description=cmdClass.description)
            instances[name] = cmdClass()
            instances[name].register(p)

        args = parser.parse_args()
        if args.loglevel is not None:
            gem.loglevel(args.loglevel)

        try:
            instances[args.command].run(args)
        except gem.utils.CommandException, e:
            sys.stderr.write("%s\n" % (str(e)))
            exit(1)
    except KeyboardInterrupt:
        exit(1)
    finally:
        pass
Ejemplo n.º 5
0
def gemtools():
    try:
        parser = argparse.ArgumentParser(prog="gemtools-cnv",
                description="Gemtools-cnv driver to execute different gemtools-cnv command and pipelines"
                )
        parser.add_argument('--loglevel', dest="loglevel", default=None, help="Log level (error, warn, info, debug)")
        parser.add_argument('-v', '--version', action='version', version='%(prog)s ' + __VERSION__)

        commands = {
            "index": gem.production.Index,
            "rna-pipeline": gem.production.RnaPipeline,
            "basic-mapping": gem.production.BasicMappingPipeline,
            "remove-duplicates": gem.production.RemoveDuplicatesPipeline,            
            "bam-2-fastq": gem.production.BamToFastqPipeline,
            "fastq-splitter": gem.production.SplitFastqPipeline,
            "cnv-mapping": gem.production.CnvMappingPipeline,
            "cnv-call": gem.production.CnvCallingPipeline,
            "cnv-assembly-preparation": gem.production.CnvAssemblyPreparation,
            "cnv-prep": gem.production.CnvPrepare,
            "t-index": gem.production.TranscriptIndex,
            "gtfcount": gem.production.GtfCount,
            "merge": gem.production.Merge,
            "convert": gem.production.Convert,
            "gtf-junctions": gem.production.Junctions,
            "denovo-junctions": gem.production.JunctionExtraction,
            "stats": gem.production.Stats,
            "filter": gem.production.Filter,
            "report": gem.production.StatsReport,
        }
        instances = {}

        
        subparsers = parser.add_subparsers(title="commands", metavar="<command>", description="Available commands", dest="command")
        
        for name, cmdClass in commands.items():
            p = subparsers.add_parser(name, help=cmdClass.title, description=cmdClass.description)
            instances[name] = cmdClass()
            instances[name].register(p)

        args = parser.parse_args()
        if args.loglevel is not None:
            gem.loglevel(args.loglevel)
            

        try:
            instances[args.command].run(args)
        except gem.utils.CommandException, e:
            sys.stderr.write("%s\n" % (str(e)))
            exit(1)
    except KeyboardInterrupt:
        exit(1)
    finally:
        pass