How to use create_line_chart method in SeleniumBase

Best Python code snippet using SeleniumBase

stats_figures.py

Source:stats_figures.py Github

copy

Full Screen

...297 )298 A, B = utils.retrieve_data_points_from_dict_in_dict(299 data, 'aligned_reads', 'mapq_percent', False300 )301 plotting.create_line_chart(302 A,303 'Distribution of MAPQ Scores: Sample A',304 'MAPQ Score',305 'Percent of Reads',306 (0, 60, 10),307 (0, 100, 20),308 3,309 'upper left',310 outdir+'mapq_dist_sample_A.pdf'311 )312 plotting.create_line_chart(313 B,314 'Distribution of MAPQ Scores: Sample B',315 'MAPQ Score',316 'Percent of Reads',317 (0, 60, 10),318 (0, 100, 20),319 3,320 'upper left',321 outdir+'mapq_dist_sample_B.pdf'322 )323 plot_data = utils.retrieve_aligned_reads_total_only(data, True)324 plotting.create_rep_avg_plot(325 [(samp, i/1000000.) for samp, i in plot_data],326 'Number of Aligned Read Fragments',327 'Aligned Read Fragments (Millions)',328 '',329 (0, 1800, 300),330 outdir+'aligned_reads.pdf'331 )332def duplicate_rate_plots(data, outdir):333 """Make plots with duplicate read rate percentages."""334 meta = {335 'dup_report_all': {336 'key1' : 'dup_report',337 'key2' : 'dup_all',338 'title' : 'Percentage of Duplicate Marked Reads',339 'xlab' : 'Percentage of Reads',340 'ylab' : '',341 'xlims' : (0, 100, 10),342 'figname': outdir+'dup_all.pdf'343 },344 'dup_report_q40': {345 'key1' : 'dup_report',346 'key2' : 'dup_q40',347 'title' : 'Percentage of Duplicate Marked Reads',348 'xlab' : 'Percentage of Reads',349 'ylab' : '',350 'xlims' : (0, 100, 10),351 'figname': outdir+'dup_q40.pdf'352 }353 }354 for vals in meta.values():355 plot_data = utils.retrieve_single_element_data_from_dict_one_output(356 data, vals['key1'], vals['key2'], True357 )358 plotting.create_rep_avg_plot(359 plot_data,360 vals['title'],361 vals['xlab'],362 vals['ylab'],363 vals['xlims'],364 vals['figname']365 )366 return 0367def cpn_retention_plots(data, outdir):368 """Make plots with CpN retention rate percentages."""369 meta = {370 'read_rtn_a': {371 'key1' : 'read_rtn',372 'key2' : 'rca',373 'title' : 'Read-averaged CpA Retention',374 'xlab' : 'Percent Retained',375 'ylab' : '',376 'xlims' : (0, 5, 1),377 'figname': outdir+'read_rtn_cpa.pdf'378 },379 'read_rtn_c': {380 'key1' : 'read_rtn',381 'key2' : 'rcc',382 'title' : 'Read-averaged CpC Retention',383 'xlab' : 'Percent Retained',384 'ylab' : '',385 'xlims' : (0, 5, 1),386 'figname': outdir+'read_rtn_cpc.pdf'387 },388 'read_rtn_g': {389 'key1' : 'read_rtn',390 'key2' : 'rcg',391 'title' : 'Read-averaged CpG Retention',392 'xlab' : 'Percent Retained',393 'ylab' : '',394 'xlims' : (0, 100, 10),395 'figname': outdir+'read_rtn_cpg.pdf'396 },397 'read_rtn_t': {398 'key1' : 'read_rtn',399 'key2' : 'rct',400 'title' : 'Read-averaged CpT Retention',401 'xlab' : 'Percent Retained',402 'ylab' : '',403 'xlims' : (0, 5, 1),404 'figname': outdir+'read_rtn_cpt.pdf'405 },406 'base_rtn_a': {407 'key1' : 'base_rtn',408 'key2' : 'bca',409 'title' : 'Base-averaged CpA Retention',410 'xlab' : 'Percent Retained',411 'ylab' : '',412 'xlims' : (0, 5, 1),413 'figname': outdir+'base_rtn_cpa.pdf'414 },415 'base_rtn_c': {416 'key1' : 'base_rtn',417 'key2' : 'bcc',418 'title' : 'Base-averaged CpC Retention',419 'xlab' : 'Percent Retained',420 'ylab' : '',421 'xlims' : (0, 5, 1),422 'figname': outdir+'base_rtn_cpc.pdf'423 },424 'base_rtn_g': {425 'key1' : 'base_rtn',426 'key2' : 'bcg',427 'title' : 'Base-averaged CpG Retention',428 'xlab' : 'Percent Retained',429 'ylab' : '',430 'xlims' : (0, 100, 10),431 'figname': outdir+'base_rtn_cpg.pdf'432 },433 'base_rtn_t': {434 'key1' : 'base_rtn',435 'key2' : 'bct',436 'title' : 'Base-averaged CpT Retention',437 'xlab' : 'Percent Retained',438 'ylab' : '',439 'xlims' : (0, 5, 1),440 'figname': outdir+'base_rtn_cpt.pdf'441 }442 }443 for vals in meta.values():444 plot_data = utils.retrieve_single_element_data_from_dict_one_output(445 data, vals['key1'], vals['key2'], True446 )447 plotting.create_rep_avg_plot(448 plot_data,449 vals['title'],450 vals['xlab'],451 vals['ylab'],452 vals['xlims'],453 vals['figname']454 )455 return 0456def create_trinucleotide_methylation_plots(data, outdir):457 """Make plots with CpWpN retention rate percentages."""458 meta = {459 'cah_methylation_percent': {460 'key' : 'cah_methylation_percent',461 'title' : 'Base-averaged CpApH Retention',462 'xlab' : 'Percent Retained',463 'ylab' : '',464 'xlims' : (0, 5, 1),465 'figname': outdir+'cah_meth.pdf'466 },467 'cag_methylation_percent': {468 'key' : 'cag_methylation_percent',469 'title' : 'Base-averaged CpApG Retention',470 'xlab' : 'Percent Retained',471 'ylab' : '',472 'xlims' : (0, 5, 1),473 'figname': outdir+'cag_meth.pdf'474 },475 'cth_methylation_percent': {476 'key' : 'cth_methylation_percent',477 'title' : 'Base-averaged CpTpH Retention',478 'xlab' : 'Percent Retained',479 'ylab' : '',480 'xlims' : (0, 5, 1),481 'figname': outdir+'cth_meth.pdf'482 },483 'ctg_methylation_percent': {484 'key' : 'ctg_methylation_percent',485 'title' : 'Base-averaged CpTpG Retention',486 'xlab' : 'Percent Retained',487 'ylab' : '',488 'xlims' : (0, 5, 1),489 'figname': outdir+'ctg_meth.pdf'490 },491 }492 for vals in meta.values():493 plot_data = utils.retrieve_single_element_data_one_output(494 data, vals['key'], True495 )496 plotting.create_rep_avg_plot(497 plot_data,498 vals['title'],499 vals['xlab'],500 vals['ylab'],501 vals['xlims'],502 vals['figname']503 )504 return 0505def mbias_plots(data, outdir):506 """Make M-bias plots."""507 A, B = utils.retrieve_data_points_from_dict_in_dict(508 data, 'cpg_rtn_readpos', '1', False509 )510 plotting.create_line_chart(511 A,512 'Read 1 CpG Retention by Read Position: Sample A',513 'Read Position',514 'Percent Retained',515 (0, 100, 20),516 (0, 100, 20),517 3,518 'lower center',519 outdir+'r1_cpg_rtn_readpos_sample_A.pdf'520 )521 plotting.create_line_chart(522 B,523 'Read 1 CpG Retention by Read Position: Sample B',524 'Read Position',525 'Percent Retained',526 (0, 100, 20),527 (0, 100, 20),528 3,529 'lower center',530 outdir+'r1_cpg_rtn_readpos_sample_B.pdf'531 )532 A, B = utils.retrieve_data_points_from_dict_in_dict(533 data, 'cpg_rtn_readpos', '2', False534 )535 plotting.create_line_chart(536 A,537 'Read 2 CpG Retention by Read Position: Sample A',538 'Read Position',539 'Percent Retained',540 (0, 100, 20),541 (0, 100, 20),542 3,543 'lower center',544 outdir+'r2_cpg_rtn_readpos_sample_A.pdf'545 )546 plotting.create_line_chart(547 B,548 'Read 2 CpG Retention by Read Position: Sample B',549 'Read Position',550 'Percent Retained',551 (0, 100, 20),552 (0, 100, 20),553 3,554 'lower center',555 outdir+'r2_cpg_rtn_readpos_sample_B.pdf'556 )557 A, B = utils.retrieve_data_points_from_dict_in_dict(558 data, 'cph_rtn_readpos', '1', False559 )560 plotting.create_line_chart(561 A,562 'Read 1 CpH Retention by Read Position: Sample A',563 'Read Position',564 'Percent Retained',565 (0, 100, 20),566 (0, 100, 20),567 3,568 'upper left',569 outdir+'r1_cph_rtn_readpos_sample_A.pdf'570 )571 plotting.create_line_chart(572 B,573 'Read 1 CpH Retention by Read Position: Sample B',574 'Read Position',575 'Percent Retained',576 (0, 100, 20),577 (0, 100, 20),578 3,579 'upper left',580 outdir+'r1_cph_rtn_readpos_sample_B.pdf'581 )582 A, B = utils.retrieve_data_points_from_dict_in_dict(583 data, 'cph_rtn_readpos', '2', False584 )585 plotting.create_line_chart(586 A,587 'Read 2 CpH Retention by Read Position: Sample A',588 'Read Position',589 'Percent Retained',590 (0, 100, 20),591 (0, 100, 20),592 3,593 'upper left',594 outdir+'r2_cph_rtn_readpos_sample_A.pdf'595 )596 plotting.create_line_chart(597 B,598 'Read 2 CpH Retention by Read Position: Sample B',599 'Read Position',600 'Percent Retained',601 (0, 100, 20),602 (0, 100, 20),603 3,604 'upper left',605 outdir+'r2_cph_rtn_readpos_sample_B.pdf'606 )607 return 0608def create_covdist_plots(data, outdir):609 """Make coverage vs. depth plots."""610 A, B = utils.retrieve_data_points_from_dict(data, 'covdist_all_base', False)611 plotting.create_line_chart(612 A,613 'Base Cumulative Coverage: Sample A',614 'Coverage',615 'Number of Bases (Millions)',616 (0, 50, 5),617 (0, 3500, 500),618 2,619 'upper right',620 outdir+'covdist_all_base_sample_A.pdf'621 )622 plotting.create_line_chart(623 B,624 'Base Cumulative Coverage: Sample B',625 'Coverage',626 'Number of Bases (Millions)',627 (0, 50, 5),628 (0, 3500, 500),629 2,630 'upper right',631 outdir+'covdist_all_base_sample_B.pdf'632 )633 A, B = utils.retrieve_data_points_from_dict(data, 'covdist_q40_base', False)634 plotting.create_line_chart(635 A,636 'Base Cumulative Coverage: Sample A',637 'Coverage',638 'Number of Bases (Millions)',639 (0, 50, 5),640 (0, 3500, 500),641 2,642 'upper right',643 outdir+'covdist_q40_base_sample_A.pdf'644 )645 plotting.create_line_chart(646 B,647 'Base Cumulative Coverage: Sample B',648 'Coverage',649 'Number of Bases (Millions)',650 (0, 50, 5),651 (0, 3500, 500),652 2,653 'upper right',654 outdir+'covdist_q40_base_sample_B.pdf'655 )656 A, B = utils.retrieve_data_points_from_dict(data, 'covdist_all_cpg', False)657 plotting.create_line_chart(658 A,659 'CpG Cumulative Coverage: Sample A',660 'Coverage',661 'Number of CpGs (Millions)',662 (0, 50, 5),663 (0, 35, 5),664 2,665 'upper right',666 outdir+'covdist_all_cpg_sample_A.pdf'667 )668 plotting.create_line_chart(669 B,670 'CpG Cumulative Coverage: Sample B',671 'Coverage',672 'Number of CpGs (Millions)',673 (0, 50, 5),674 (0, 35, 5),675 2,676 'upper right',677 outdir+'covdist_all_cpg_sample_B.pdf'678 )679 A, B = utils.retrieve_data_points_from_dict(data, 'covdist_q40_cpg', False)680 plotting.create_line_chart(681 A,682 'CpG Cumulative Coverage: Sample A',683 'Coverage',684 'Number of CpGs (Millions)',685 (0, 50, 5),686 (0, 35, 5),687 2,688 'upper right',689 outdir+'covdist_q40_cpg_sample_A.pdf'690 )691 plotting.create_line_chart(692 B,693 'CpG Cumulative Coverage: Sample B',694 'Coverage',695 'Number of CpGs (Millions)',696 (0, 50, 5),697 (0, 35, 5),698 2,699 'upper right',700 outdir+'covdist_q40_cpg_sample_B.pdf'701 )702 return 0703def create_insert_size_plots(data, outdir):704 """Create plot of insert sizes."""705 A, B = utils.retrieve_data_points_from_dict_in_dict(706 data, 'isize_data', 'percent', False707 )708 plotting.create_line_chart(709 A,710 'Insert Size: Sample A',711 'Insert Size',712 'Percent of Mapped Reads',713 (0, 700, 100),714 (0, 1.0, 0.1),715 3,716 'upper right',717 outdir+'insert_size_sample_A.pdf',718 every=50719 )720 plotting.create_line_chart(721 B,722 'Insert Size: Sample B',723 'Insert Size',724 'Percent of Mapped Reads',725 (0, 700, 100),726 (0, 1.0, 0.1),727 3,728 'upper right',729 outdir+'insert_size_sample_B.pdf',730 every=50731 )732 return 0733def create_complexity_curve_plots(data, outdir):734 """Create plot of complexity curves."""735 A, B = utils.retrieve_data_points_from_dict(data, 'complexity_curve', False)736 plotting.create_line_chart(737 [(samp, np.array(x)/1000000., np.array(y)/1000000.) for samp, x, y in A],738 'Library Complexity: Sample A',739 'Total Reads (Millions)',740 'Unique Reads (Millions)',741 (0, 600, 100),742 (0, 500, 100),743 2,744 'upper left',745 outdir+'complexity_sample_A.pdf',746 every=50747 )748 plotting.create_line_chart(749 [(samp, np.array(x)/1000000., np.array(y)/1000000.) for samp, x, y in B],750 'Library Complexity: Sample B',751 'Total Reads (Millions)',752 'Unique Reads (Millions)',753 (0, 900, 100),754 (0, 600, 100),755 2,756 'lower right',757 outdir+'complexity_sample_B.pdf',758 every=50759 )760 return 0761def create_tex_table(data, outdir):762 """Create table with CpG regional coverages."""...

Full Screen

Full Screen

main.py

Source:main.py Github

copy

Full Screen

...146 bar_response = create_bar_chart(details['bar_data'], BASE_PRESENTATION)147 success = success and bar_response[0]148 response = "{response}. {br}".format(response=response, br=bar_response[1])149 if 'create_line_chart' in details and details['create_line_chart'] and details['line_data']:150 line_response = create_line_chart(details['line_data'], BASE_PRESENTATION)151 success = success and line_response[0]152 response = "{response}. {lr}".format(response=response, lr=line_response[1])153 if success:154 return True, response155 else:156 return False, response157@app.route("/", methods=['POST'])158def ppt_request_handle():159 print("in ppt_request_handle")160 req = request.json161 print(req)162 with open("req_sample.json", "w") as outfile:163 json.dump(req, outfile)164 if req["req"] == "create_ppt" and req["source"].lower() == "wikipedia":165 result = create_ppt(req["title"])166 if result[0]:167 response = {168 "message": "Request successful",169 "title": result[1]170 }171 return jsonify(response), 200172 elif req["req"] == "create_ppt_count" and req["source"].lower() == "wikipedia":173 result = create_ppt_with_count(req["title"], req["count"])174 if result[0]:175 response = {176 "message": "Request successful",177 "title": result[1],178 "count": result[2],179 }180 return jsonify(response), 200181 elif req["req"] == "create_ppt_count" and req["source"].lower() == "nytimes":182 result = create_ppt_ny(req["title"], req["count"])183 if result[0]:184 response = {185 "message": "Request successful",186 "title": result[1],187 "count": result[2],188 }189 return jsonify(response), 200190 elif req["req"] == "create_team_slide":191 result = create_team_slide(req["people"])192 response = {193 "message": result[1]194 }195 if result[0]:196 return jsonify(response), 200197 else:198 return jsonify(response), 400199 elif req["req"] == "create_pie_chart":200 result = create_pie_chart(req, BASE_PRESENTATION)201 response = {202 "message": result[1]203 }204 if result[0]:205 return jsonify(response), 200206 else:207 return jsonify(response), 400208 elif req["req"] == "create_bar_chart":209 result = create_bar_chart(req, BASE_PRESENTATION)210 response = {211 "message": result[1]212 }213 if result[0]:214 return jsonify(response), 200215 else:216 return jsonify(response), 400217 elif req["req"] == "create_line_chart":218 result = create_line_chart(req, BASE_PRESENTATION)219 response = {220 "message": result[1]221 }222 if result[0]:223 return jsonify(response), 200224 else:225 return jsonify(response), 400226 elif req["req"] == "create_chart" or req["req"] == "create_charts":227 result = create_charts(req)228 response = {229 "message": result[1]230 }231 if result[0]:232 return jsonify(response), 200233 else:234 return jsonify(response), 400235 elif req["req"] == "create_org_chart":236 result = True, 'Got the request'237 response = {238 "message": result[1]239 }240 if result[0]:241 return jsonify(response), 200242 else:243 return jsonify(response), 400244 return f"Cannot process request", 400245# 'Main' function to run246if __name__ == '__main__':247 # app.run(debug=True) # run server in debug mode248 os.chdir("/Users/vishal/Documents/Auxi/PIII-Prototype/PIII-Prototype-First")249 with open('./1.json') as json_file:250 data = json.load(json_file)251 print(data)252 create_ppt_ny(data['title'], data['count'])253 # create_ppt(data['title'])254 # try:255 # prs = Presentation('./Final - Presentation.pptx')256 # except exc.PackageNotFoundError as err:257 # # print(f'No presentation file: {err}')258 # prs = Presentation('../../misc/Team_Slide_Custom.pptx')259 # create_team_slide(["chris", "john", "mike", "steve"], BASE_PRESENTATION)260 # res = create_pie_chart({261 # 'req': 'create_pie_chart',262 # 'categories': ['USA', 'Canada', 'Mexico'],263 # 'percentages': ['30', '30', '40']}, BASE_PRESENTATION264 # )265 #266 # res = create_bar_chart({267 # 'req': 'create_bar_chart',268 # 'categories': ['USA', 'Canada', 'Mexico'],269 # 'values': ['81', '45', '54']}, BASE_PRESENTATION270 # )271 #272 # res = create_line_chart({273 # 'req': 'create_line_chart',274 # "Label": ["India", "Bangladesh"],275 # "Value": [20, 30]}, BASE_PRESENTATION276 # )277 # req = {278 # "req": "create_chart",279 # "details": {280 # "create_pie_chart": True,281 # "pie_data": {282 # "categories": ["Russia", "India", "Bangladesh"],283 # "percentages": [30.0, 30.0, 40.0]284 # },285 # "create_bar_chart": True,286 # "bar_data": {...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run SeleniumBase automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful