-
Notifications
You must be signed in to change notification settings - Fork 2
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
#3090 removed hyperlinks and displaying co-occurring/uncertain in MVL export #906
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -371,19 +371,25 @@ def __lt__(self, other): | |
def conditions(self) -> List[ConditionResolved]: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Note this is a left over from my code that made things more complicated than they need to be) It might be cleanest to change the signature of ClassificationGroup.conditions to return a single ConditionResolved, as it only returns multiple now because a single ConditionResolved doesn't properly handle the merging of resolved terms and plain text - but they wont be grouped together anyway. That way we don't need to hack the join term so much either (as in we can just use the condition tag as it was) |
||
all_terms = set() | ||
all_plain_texts = set() | ||
all_joins = set() | ||
for cm in self.modifications: | ||
c = cm.classification | ||
if resolved := c.condition_resolution_obj: | ||
for term in resolved.terms: | ||
all_terms.add(term) | ||
all_joins.add(resolved.join) | ||
else: | ||
if text := cm.get(SpecialEKeys.CONDITION): | ||
all_plain_texts.add(text) | ||
all_condition_resolved = [] | ||
shared_join = None | ||
if len(all_joins) == 1: # if there's more than one join, we can't display it | ||
shared_join = all_joins.pop() | ||
|
||
for term in all_terms: | ||
all_condition_resolved.append(ConditionResolved(terms=[term], join=None)) | ||
all_condition_resolved.append(ConditionResolved(terms=[term], join=shared_join)) | ||
for plain_text in all_plain_texts: | ||
all_condition_resolved.append(ConditionResolved(terms=[], join=None, plain_text=plain_text)) | ||
all_condition_resolved.append(ConditionResolved(terms=[], join=shared_join, plain_text=plain_text)) | ||
|
||
all_condition_resolved.sort() | ||
return all_condition_resolved | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{% load classification_tags %} | ||
<br/> | ||
{% spaceless %} | ||
<table style="max-width:1200px"> | ||
<thead> | ||
<tr style='border-bottom:1px solid gray;border-top:1px solid gray'> | ||
|
@@ -22,11 +23,16 @@ | |
<del>{{ group.clinical_significance | ekey:'clinical_significance' }}</del><br/>{{ group.clinical_significance_pending | ekey:'clinical_significance' }} (PENDING) | ||
{% else %}{{ group.clinical_significance | ekey:'clinical_significance' }}{% endif %} | ||
</td> | ||
<td style='padding:8px'>{% for condition in group.conditions %}<div>{% condition condition_obj=condition limit=None %}</div>{% empty %}-{% endfor %}</td> | ||
<td style='padding:8px'>{% for condition in group.conditions %}<div>{% condition condition_obj=condition limit=None no_links=True %}</div>{% empty %}-{% endfor %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OntologyTerm has "show_link" which defaults to True, probably best to keep the convention (instead of "no_links" defaulting to False). |
||
{% if group.conditions|length > 0 and group.conditions.0.join_text %} | ||
<span class="font-italic">{{ group.conditions.0.join_text }}</span> | ||
{% endif %} | ||
</td> | ||
<td style='padding:8px'>{{ group.zygosities | ekey:'zygosity' }}</td> | ||
<td style='font-family:monospace;padding:8px'>{% for acmg in group.acmg_criteria %}{% if not forloop.first %}, {% endif %}{{ acmg }}{% empty %}-{% endfor %}</td> | ||
<td style='font-family:monospace;padding:8px'><div style='white-space: nowrap'>{% with curated_date=group.most_recent_curated %}{% if curated_date.name %}{{ curated_date.name }} {% endif %}{{ curated_date.date | date:'Y-m-d' }}{% endwith %}</div></td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</table> | ||
{% endspaceless %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,10 @@ | |
{% if condition.terms %} | ||
{% for term in condition.terms %} | ||
{% if not forloop.first %}<br/>{% endif %} | ||
<span><a href="{% url 'ontology_term' term.url_safe_id %}" class="hover-link">{{ term.id }}</a> {{ term.name }}</span> | ||
{% if no_links %} | ||
<span> {{ term.id }} {{ term.name }}</span> | ||
{% else %} | ||
<span><a href="{% url 'ontology_term' term.url_safe_id %}" class="hover-link">{{ term.id }}</a> {{ term.name }}</span> | ||
{% endif %} | ||
{% endfor %} | ||
{% if condition.join_text %} <span class="font-italic">{{ condition.join_text }}</span>{% endif %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we change ClassificationGroup as per the above suggestion, then we can put this back in. Especially since {% condition %} is used in other contexts where we would want to show off the join text |
||
{% else %}{{ condition.plain_text | limit_length:limit }}{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it's a very obscure edge case but:
Classifications can be put in the same group as long as the first resolved ontology term is shared
This means there could be a scenario where we have:
Condition A, Condition B, co-occurring
Condition A, Condition C, co-occurring
which would show up as
Condition A, Condition B, Condition C co-occurring.
To keep things safe, I'd suggest we only show the join term if the condition_resolution_obj for each condition is the same (not just if the joining term is the same).