Exemple #1
0
def run(parser, args):
    args = parser.parse_args()
    # args = check_args(args)
    if args.quiet:
        logger.setLevel(logging.ERROR)
    else:
        logger.setLevel(logging.INFO)
    DBNAME = "%s-%s" % (DB_PREFIX, args.db_name)
    connect(DBNAME, host=args.db_uri)
    logger.debug("Using DB %s" % DBNAME)

    with open(args.reference_set) as fp:
        reference_set_name = get_first_chrom_name(fp)

    try:
        reference_set = ReferenceSet.objects.get(name=reference_set_name)
    except DoesNotExist:
        reference_set = ReferenceSet.create_and_save(name=reference_set_name)

    try:
        reference = Reference.create_and_save(name=reference_set_name,
                                              reference_sets=[reference_set],
                                              md5checksum="NA")
    except:
        pass
    vcf = VCF(args.vcf, reference_set.id, method=args.method, force=args.force)
    vcf.add_to_database()
Exemple #2
0
def run(parser, args):
    args = parser.parse_args()
    # args = check_args(args)
    if args.quiet:
        logger.setLevel(logging.ERROR)
    else:
        logger.setLevel(logging.INFO)
    DBNAME = 'atlas-%s' % (args.db_name)
    db = client[DBNAME]
    connect(DBNAME)
    logger.debug("Using DB %s" % DBNAME)
    reference_set_name = ".".join(
        os.path.basename(args.reference_set).split(".")[:-1])
    try:
        reference_set = ReferenceSet.objects.get(name=reference_set_name)
    except DoesNotExist:
        reference_set = ReferenceSet.create_and_save(name=reference_set_name)
        # Hack
    try:
        reference = Reference.create_and_save(name=reference_set_name,
                                              reference_sets=[reference_set],
                                              md5checksum="NA")
    except:
        pass
    vcf = VCF(args.vcf, reference_set.id, method=args.method, force=args.force)
    vcf.add_to_database()
Exemple #3
0
def run_make_probes_from_vcf_file(args):
    # Make VariantSet from vcf
    reference = os.path.basename(args.reference_filepath).split(".fa")[0]
    try:
        reference_set = ReferenceSet.objects.get(name=reference)
    except DoesNotExist:
        reference_set = ReferenceSet.create_and_save(name=reference)
        # Hack
    try:
        reference = Reference.create_and_save(
            name=reference,
            reference_sets=[reference_set],
            md5checksum=reference)
    except NotUniqueError:
        pass
    vcf = VCF(
        args.vcf,
        reference_set.id,
        method="tmp",
        force=True,
        append_to_global_variant_set=False)
    vcf.add_to_database()