on="gene_id")
    extra["pred.perf.pval"] = None
    extra["pred.perf.qval"] = None
    extra["pred.perf.R2"] = None
    extra = extra[[
        "gene_id", "gene_name", "gene_type", "n.snps.in.model", "pred.perf.R2",
        "pred.perf.pval", "pred.perf.qval"
    ]].rename(columns={
        "gene_id": "gene",
        "gene_name": "genename"
    })

    logging.info("Saving db")
    Models.create_model_db(args.output, extra, weights)

    logging.info("Done")


if __name__ == "__main__":
    import argparse
    parser = argparse.ArgumentParser("Build predition model from data")
    parser.add_argument("-data_annotation", nargs="+")
    parser.add_argument("-variant_annotation")
    parser.add_argument("-model_input")
    parser.add_argument("--model_filter", nargs="+")
    parser.add_argument("-output")
    parser.add_argument("-parsimony", type=int, default=logging.INFO)
    args = parser.parse_args()

    Logging.configure_logging(args.parsimony)
    run(args)
                                           entry[3])
                f.write(l.encode())
    logging.info("Finished building covariance.")


if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser(
        "Build S-MultiXcan covariance from models")
    parser.add_argument("-parquet_genotype_folder",
                        help="Parquet Genotype folder")
    parser.add_argument(
        "-parquet_genotype_pattern",
        help="Pattern to detect parquet genotypes by chromosome")
    parser.add_argument("-model_db_folder", help="Folder containing models")
    parser.add_argument("-model_db_file_pattern",
                        help="Regexp to parse file names")
    parser.add_argument("-output", help="Where to save stuff")
    parser.add_argument("--output_rsids", action="store_true")
    parser.add_argument(
        "-parsimony",
        help=
        "Log verbosity level. 1 is everything being logged. 10 is only high level messages, above 10 will hardly log anything",
        default="10")

    args = parser.parse_args()

    Logging.configure_logging(int(args.parsimony))

    run(args)
        "-output_column_map",
        help="Specify multiple key-value pairs to specify format conversion",
        nargs=2,
        action="append")
    parser.add_argument("--insert_value",
                        help="Create a column with a specific value",
                        nargs=2,
                        action="append")
    parser.add_argument("-output_order",
                        help="Specify output order",
                        nargs='+')
    parser.add_argument("-output", help="Where the output should go")
    parser.add_argument("--keep_all_original_entries", action="store_true")
    parser.add_argument(
        "-verbosity",
        help=
        "Log verbosity level. 1 is everything being logged. 10 is only high level messages, above 10 will hardly log anything",
        default="10")
    parser.add_argument(
        '-meta_extra_col',
        help=
        'Let extra columns in snp_reference_metadata be read. Provide key/value pairs in the format: key1:value1 key2:value2 ...',
        nargs='+',
        default=[])
    GWASUtilities.add_gwas_arguments_to_parser(parser)
    args = parser.parse_args()

    Logging.configure_logging(int(args.verbosity))

    run(args)
Ejemplo n.º 4
0
    import argparse
    parser = argparse.ArgumentParser("Convert gencode file into a table file")
    parser.add_argument("-gencode_file", help="Where to load file from")
    parser.add_argument("-output", help="Where to save")
    parser.add_argument("-gene_type_whitelist",
                        help="Which types of genes to keep",
                        default=[],
                        nargs="+")
    parser.add_argument("-feature_type_whitelist",
                        help="Which types of genes to keep",
                        default=[],
                        nargs="+")
    parser.add_argument("-transcript_type_whitelist",
                        help="Which types of transcripts to keep",
                        default=[],
                        nargs="+")
    parser.add_argument(
        "-output_column_map",
        help="Specify multiple key-value pairs to specify format conversion",
        nargs=2,
        action="append",
        default=[])
    parser.add_argument("-verbosity",
                        help="Logging verbosity (actually loquacity)",
                        type=int,
                        default=10)
    args = parser.parse_args()

    Logging.configure_logging(args.verbosity)
    run(args)
Ejemplo n.º 5
0
if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser("Run COLOC")
    parser.add_argument("-parquet_genotype_folder",
                        help="Parquet Genotype file")
    parser.add_argument("-parquet_genotype_pattern",
                        help="Parquet Genotype file")
    parser.add_argument("-parquet_genotype_metadata",
                        help="Parquet Genotype variant metadata file")
    parser.add_argument("-restrict_to_individuals",
                        help="filter to individuals")
    parser.add_argument("--mode", help="'bhat' or 'z' (z is default)")
    parser.add_argument("-eqtl",
                        help="Run on a GTEX-like eqtl summary stats file")
    parser.add_argument("-sample_size", help="number of samples", type=int)
    parser.add_argument("-cs_output", help="Credible sets.")
    parser.add_argument("-var_output", help="variables")
    parser.add_argument(
        "-parsimony",
        help=
        "Log verbosity level. 1 is everything being logged. 10 is only high level messages, above 10 will hardly log anything",
        default="10")
    parser.add_argument("-MAX_N", type=int)

    args = parser.parse_args()

    Logging.configure_logging(int(args.parsimony), with_date=True)

    run(args)