-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from Plant-Food-Research-Open/add/gfastats
Added gfastats
- Loading branch information
Showing
23 changed files
with
332 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
from pathlib import Path | ||
import pandas as pd | ||
from tabulate import tabulate | ||
import re | ||
|
||
from report_modules.parsers.parsing_commons import sort_list_of_results | ||
|
||
|
||
def parse_gfastats_folder(folder_name="gfastats"): | ||
dir = os.getcwdb().decode() | ||
reports_folder_path = Path(f"{dir}/{folder_name}") | ||
|
||
if not os.path.exists(reports_folder_path): | ||
return {} | ||
|
||
list_of_report_files = reports_folder_path.glob("*.assembly_summary") | ||
|
||
data = {"GFASTATS": []} | ||
|
||
for report_path in list_of_report_files: | ||
report_table = pd.read_csv(report_path, sep="\t") | ||
report_table.columns = ['Stat', 'Value'] | ||
|
||
file_tokens = re.findall( | ||
r"([\w]+).assembly_summary", | ||
os.path.basename(str(report_path)), | ||
)[0] | ||
|
||
data["GFASTATS"].append( | ||
{ | ||
"hap": file_tokens, | ||
"report_table": report_table.to_dict("records"), | ||
"report_table_html": tabulate( | ||
report_table, | ||
headers=["Stat", "Value"], | ||
tablefmt="html", | ||
numalign="left", | ||
showindex=False, | ||
), | ||
} | ||
) | ||
|
||
return { | ||
"GFASTATS": sort_list_of_results(data["GFASTATS"], "hap") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<div class="dropdown"> | ||
<div class="dropdown_content"> | ||
<select id="selector_GFASTATS" onchange="showContent('GFASTATS')"> | ||
{% set str_hap = 'hap' %} {% for item in range(all_stats_dicts["GFASTATS"]|length) %} | ||
<option value="tabcontent_GFASTATS_{{all_stats_dicts['GFASTATS'][item]['hap']}}"> | ||
{{ all_stats_dicts['GFASTATS'][item][str_hap] }} {% endfor %} | ||
</option> | ||
</select> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<div id="GFASTATS" class="tabcontent" style="display: none"> | ||
<div class="section-para-wrapper"> | ||
<p class="section-para">A fast and exhaustive tool for summary statistics.</p> | ||
<p class="section-para"><b>Reference:</b></p> | ||
<p class="section-para"> | ||
Giulio Formenti, Linelle Abueg, Angelo Brajuka, Nadolina Brajuka, Cristóbal Gallardo-Alba, Alice Giani, Olivier | ||
Fedrigo, Erich D Jarvis, Gfastats: conversion, evaluation and manipulation of genome sequences using assembly | ||
graphs, Bioinformatics, Volume 38, Issue 17, September 2022, Pages 4214–4216, | ||
<a href="https://doi.org/10.1093/bioinformatics/btac460" target="_blank">10.1093/bioinformatics/btac460</a> | ||
</p> | ||
<p class="section-para"> | ||
<b>Version: {{ all_stats_dicts['VERSIONS']['GFASTATS']['gfastats'] }}</b> | ||
</p> | ||
</div> | ||
{% include 'gfastats/dropdown.html' %} {% include 'gfastats/report_contents.html' %} | ||
</div> |
17 changes: 17 additions & 0 deletions
17
bin/report_modules/templates/gfastats/report_contents.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% set vars = {'is_first': True} %} {% for item in range(all_stats_dicts["GFASTATS"]|length) %} {% set | ||
active_text = 'display: block' if vars.is_first else 'display: none' %} | ||
<div | ||
id="tabcontent_GFASTATS_{{ all_stats_dicts['GFASTATS'][item]['hap'] }}" | ||
class="tabcontent-GFASTATS" | ||
style="{{ active_text }}" | ||
> | ||
<div class="results-section"> | ||
<div class="section-heading-wrapper"> | ||
<div class="section-heading">{{ all_stats_dicts['GFASTATS'][item]['hap'] }}</div> | ||
</div> | ||
</div> | ||
<div class="table-outer"> | ||
<div class="table-wrapper">{{ all_stats_dicts['GFASTATS'][item]['report_table_html'] }}</div> | ||
</div> | ||
</div> | ||
{% if vars.update({'is_first': False}) %} {% endif %} {% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.