@@ -0,0 +1,1967 @@
+%22%22%22Upload a genome to an existing project.%0A%22%22%22%0A%0Aimport os%0Aimport requests%0Afrom requests.auth import HTTPBasicAuth%0Aimport sys%0Aimport json%0Aimport argparse%0A%0A#Load environment variables for request authentication parameters%0Aif %22OMICIA_API_PASSWORD%22 not in os.environ:%0A    sys.exit(%22OMICIA_API_PASSWORD environment variable missing%22)%0A%0Aif %22OMICIA_API_LOGIN%22 not in os.environ:%0A    sys.exit(%22OMICIA_API_LOGIN environment variable missing%22)%0A%0AOMICIA_API_LOGIN = os.environ%5B'OMICIA_API_LOGIN'%5D%0AOMICIA_API_PASSWORD = os.environ%5B'OMICIA_API_PASSWORD'%5D%0AOMICIA_API_URL = os.environ.get('OMICIA_API_URL', 'https://api.omicia.com')%0Aauth = HTTPBasicAuth(OMICIA_API_LOGIN, OMICIA_API_PASSWORD)%0A%0A%0Adef add_fields_to_cr(cr_id):%0A    %22%22%22Use the Omicia API to fill in custom patient fields for a clinical report%0A    %22%22%22%0A%0A    #Construct request%0A    url = %22%7B%7D/reports/%7B%7D/patient_fields%22%0A    url = url.format(OMICIA_API_URL, cr_id)%0A    url_payload = %7B'proband_genome_id': proband_genome_id,%0A                   'mother_genome_id': mother_genome_id,%0A                   'father_genome_id': father_genome_id,%0A                   'sibling_genome_id': sibling_genome_id,%0A                   'vaast_report_id': vaast_report_id%7D%0A%0A    sys.stdout.write(%22Adding custom patient fields to report...%22)%0A    sys.stdout.write(%22%5Cn%5Cn%22)%0A    sys.stdout.flush()%0A    # If patient information was not provided, make a post request to reports%0A    # without a patient information parameter in the url%0A    result = requests.put(url, auth=auth, data=json.dumps(url_payload))%0A    return result.json()%0A%0A%0Adef main(argv):%0A    %22%22%22main function. Upload a specified VCF file to a specified project.%0A    %22%22%22%0A    parser = argparse.ArgumentParser(description='Fill patient info fields for existing clinical reports.')%0A    parser.add_argument('c', metavar='clinical_report_id', type=int)%0A    args = parser.parse_args()%0A%0A    cr_id = args.c%0A%0A    json_response = add_fields_to_cr(cr_id)%0A%0Aif __name__ == %22__main__%22:%0A    main(sys.argv%5B1:%5D)%0A

Change doc for api