Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make overrepresented table entries a fixed size table with scrolling. #168

Merged
merged 2 commits into from
Jun 3, 2024
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
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Changelog

version 0.10.0-dev
------------------
+ Make overrepresented sequences table scrollable and smaller so it is easier
to skip over when lots of entries are found.
+ Overrepresented sequence analysis now only counts unique fragments per read.
Fragments that are duplicated inside the read are counted only once. This
prevents long stretches of genomic repeats getting higher reported
Expand Down
4 changes: 2 additions & 2 deletions src/sequali/report_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ def to_html(self) -> str:
</table>
"""
)
content.write("<table>")
content.write("<div class=\"overrepresented_table\"><table>")
content.write("<tr><th>count</th><th>percentage</th>"
"<th>canonical sequence</th>"
"<th>reverse complemented sequence</th>"
Expand All @@ -1479,7 +1479,7 @@ def to_html(self) -> str:
<td style="text-align:right">
{item.most_matches / item.max_matches:.02%}</td>
<td>{html.escape(item.best_match)}</td></tr>""")
content.write("</table>")
content.write("</table></div>")
return content.getvalue()

@classmethod
Expand Down
7 changes: 7 additions & 0 deletions src/sequali/static/sequali_report.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,3 +96,10 @@ tr:nth-child(odd) {
tr:hover {
background-color: darkseagreen;
}

.overrepresented_table {
/* Use a non-integer height so the last row is partially visible. This
indicates that the table is scrollable. */
max-height: 35.75em;
overflow-y: scroll;
}
Loading