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()
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) try: reference_set = ReferenceSet.objects.get(name=args.reference_set) except DoesNotExist: reference_set = ReferenceSet.create_and_save(name=args.reference_set) # Hack try: reference = Reference.create_and_save(name=args.reference_set, 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()