コード例 #1
0
ファイル: common.py プロジェクト: seqpipe/sgains
    def common_updates(self, args):
        if args.config is not None:
            config = Config.load(args.config)
        else:
            try:
                config = Config.load('./sgains.yml')
            except AssertionError:
                config = Config.default()

        self.config = config

        if args.dry_run is not None:
            self.config.dry_run = args.dry_run
        if args.force is not None:
            self.config.force = args.force

        if args.parallel is not None:
            self.config.parallel = args.parallel
コード例 #2
0
def test_bins_config():
    conf = Config.load("tests/data/scpipe_tests.yml")
    assert conf is not None

    assert conf.mappable_regions is not None
    assert conf.mappable_regions.length == 100

    assert conf.bins is not None
    assert conf.bins.bins_count == 10000
    assert conf.bins.bins_dir == "test_data/R100_B10k"
コード例 #3
0
def test_pickle_depickle():
    conf = Config.load("tests/data/scpipe_tests.yml")
    assert conf is not None

    pkl = pickle.dumps(conf)
    assert pkl is not None

    res = pickle.loads(pkl)
    assert res is not None

    assert isinstance(res, Config)
    assert conf.to_dict() == res.to_dict()
コード例 #4
0
def hg():
    config = Config.load("tests/data/scpipe_tests.yml", use_config_dir=True)
    return Genome(config)
コード例 #5
0
def tests_config():
    config = Config.load("tests/data/scpipe_tests.yml", use_config_dir=True)
    return config
コード例 #6
0
ファイル: r_pipeline.py プロジェクト: seqpipe/sgains
                subprocess.check_call(
                    [
                        'Rscript',
                        rscript,
                        scclust_dirname,
                        case_name,
                        varbin_dir,
                        varbin_suffix,
                        bin_boundaries_filename,
                        cytoband,
                        str(nsim),
                        str(sharemin),
                        str(fdrthres),
                        str(nshare),
                        str(climbtoshare),
                    ],
                    shell=False,
                    stdout=sys.stdout,
                    stderr=sys.stdout,
                    # stdout=shutup, stderr=shutup,
                )


if __name__ == "__main__":
    config = Config.load("sgains.yml")
    print(config)

    pipeline = Rpipeline(config)

    pipeline.run()
コード例 #7
0
def main(argv=None):
    if argv is None:
        argv = sys.argv
    else:
        argv.extend(sys.argv)

    # Setup argument parser
    program_name = os.path.basename(sys.argv[0])
    program_shortdesc = \
        'sgains - sparse genomic analysis of individual nuclei by ' \
        'sequencing pipeline'
    program_description = '''%s

USAGE
''' % (program_shortdesc, )

    try:
        import setproctitle  # @UnresolvedImport
        setproctitle.setproctitle('sgains')
    except ImportError:
        pass

    try:

        defaults_config = Config.parse_args(argv)

        argparser = ArgumentParser(
            description=program_description,
            formatter_class=RawDescriptionHelpFormatter)

        OptionsBase.common_options(argparser)

        subparsers = argparser.add_subparsers(
            title="subcommands"
        )

        process_command = ProcessCommand(
            argparser, subparsers)
        process_command.add_options(defaults_config)

        prepare_command = PrepareCommand(
            argparser, subparsers)
        prepare_command.add_options(defaults_config)

        genomeindex_command = GenomeIndexCommand(
            argparser, subparsers)
        genomeindex_command.add_options(defaults_config)

        mappable_regions_command = MappableRegionsCommand(
            argparser, subparsers)
        mappable_regions_command.add_options(defaults_config)

        bins_command = BinsCommand(
            argparser, subparsers)
        bins_command.add_options(defaults_config)

        mapping_command = MappingCommand(
            argparser, subparsers)
        mapping_command.add_options(defaults_config)

        varbin_command = VarbinCommand(
            argparser, subparsers)
        varbin_command.add_options(defaults_config)

        scclust_command = SCclustCommand(
            argparser, subparsers)
        scclust_command.add_options(defaults_config)

        args = argparser.parse_args(argv[1:])
        args.func(args)

        return 0
    except KeyboardInterrupt:
        traceback.print_exc()
        return 0
    except Exception as e:
        traceback.print_exc()

        indent = len(program_name) * " "
        sys.stderr.write(program_name + ": " + repr(e) + "\n")
        sys.stderr.write(indent + "  for help use --help")
        sys.stderr.write('\n')
        return 2
コード例 #8
0
def test_load_config():
    conf = Config.load("tests/data/scpipe_tests.yml")
    assert conf is not None

    assert conf.genome is not None
    assert os.path.basename(conf.genome.version) == "hg19"
コード例 #9
0
ファイル: conftest.py プロジェクト: seqpipe/sgains
def tests_config():
    config = Config.load("tests/data/scpipe_tests.yml")
    return config