Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
get_taxonomic_assignments,
)
from pathlib import Path
from sqlalchemy import select, text, func
from sqlalchemy import select, text, func, desc
from sqlalchemy.pool import NullPool
from app.datatables import datatables_response, init_app, query_columns
from app.nl_query import generate_sql, generate_sql_modification
Expand Down Expand Up @@ -141,6 +141,20 @@ def index():
except Exception as e:
print(f"Error fetching special collection counts: {e}")

try:
# Get counts of all the species in the collection
species = (
db.session.query(Isolate.suspected_organism, func.count(Isolate.sample_id).label("count"))
.filter(Isolate.suspected_organism.is_not(None))
.filter(Isolate.suspected_organism != "Unknown")
.group_by(Isolate.suspected_organism)
.order_by(desc("count"))
.limit(10)
.all()
)
except Exception as e:
print(f"Error fetching species counts: {e}")

return render_template(
"index.html",
version=__version__,
Expand All @@ -149,6 +163,7 @@ def index():
isolate_count=isolate_count,
patient_count=patient_count,
special_collection_counts=special_collections,
species_counts=species,
)


Expand Down
22 changes: 20 additions & 2 deletions app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,32 @@ <h3 style="text-transform:none;">Welcome to the Microbial ARchive and Cryo-colle

<h4>
The database currently holds {{ isolate_count }} isolates from {{ patient_count }} patients.
</h4>
</h4><br>

<p>The efforts to curate the isolates include:</p>
<h5>The efforts to curate the isolates include:</h5>
<ul class="list-unstyled">
{% for collection, val in special_collection_counts.items() %}
<li class="mb-2"><strong>{{ collection }}</strong> ({{ val[0] }} isolates){% if val[1] %} - {{ val[1] }}{% endif %}</li>
{% endfor %}
</ul><br>

<h5>The most common species in the database are:</h5>
<ul class="list-unstyled">
{% for species, val in species_counts %}
<li class="mb-2"><strong>{{ species }}:</strong> {{ val }} isolates</li>
{% endfor %}
</ul><br>


<h4>
Publications
</h4>

<p>We are working on multiple projects in parallel using this data. The current publications are listed below:</p>
<ul class="list-unstyled">
<li class="mb-2">She Q, Srinivasan L, Theiller E, Galis BE, Napper T, Feder A, Arvanitis A, Jones SM, Hayes E, Puopolo KM, Baldassano RN, David MZ, Coffin SE, Gibbs KA, Potter RF, Smith KP, Harris RM, Zackular JP, Moustafa AM, Planet PJ. Rapid dissemination of Staphylococcus aureus in the neonatal intensive care unit is associated with invasive infection. Nat Commun. 2026 Feb 9. doi: 10.1038/s41467-026-69074-z. Epub ahead of print. <a href="https://pubmed.ncbi.nlm.nih.gov/41663361/">PMID: 41663361</a>.</li>
</ul>

</div>

<div>
Expand Down
Loading