-
Notifications
You must be signed in to change notification settings - Fork 6
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
Update orthology association table #930
Changes from 4 commits
e6eef6a
5320402
3e50071
7ac9401
f040d80
efcf884
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 |
---|---|---|
|
@@ -210,11 +210,7 @@ def multi_entity_associations( | |
] = None, | ||
counterpart_category: Annotated[ | ||
Optional[List[str]], | ||
typer.Option( | ||
"--counterpart-category", | ||
"-c", | ||
help="A comma-separated list of counterpart categories" | ||
), | ||
typer.Option("--counterpart-category", "-c", help="A comma-separated list of counterpart categories"), | ||
] = None, | ||
limit: fields.LimitOption = 20, | ||
offset: fields.OffsetOption = 0, | ||
|
@@ -306,9 +302,7 @@ def histopheno( | |
|
||
@solr_app.command("association-counts") | ||
def association_counts( | ||
entity_id: Annotated[ | ||
str, typer.Argument(help="The entity to get association counts for") | ||
], | ||
entity_id: Annotated[str, typer.Argument(help="The entity to get association counts for")], | ||
fmt: fields.FormatOption = fields.OutputFormat.json, | ||
output: fields.OutputOption = None, | ||
): | ||
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. autoformatting |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -454,21 +454,6 @@ const ariaSort = computed(() => { | |
text-transform: capitalize; | ||
} | ||
|
||
/* first th */ | ||
.th:nth-child(1) { | ||
width: 30%; | ||
} | ||
|
||
/* second th */ | ||
.th:nth-child(2) { | ||
width: 5%; | ||
} | ||
|
||
/* third th */ | ||
.th:nth-child(3) { | ||
width: 30%; | ||
} | ||
|
||
/** body cells */ | ||
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. This is where I might be causing trouble by altering potentially broader impact css, but I think I'm actually reducing the trouble that this overly broad css was causing. This PR is the first of many for defining the columns for each association type separately, and it doesn't make sense that we'll always want these widths. Plus, if you scan through Human Disease on this branch, most tables look better, in particular it gives as much space as possible to disease models. 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. Yeah, we really need the new UI person to do a CSS review across the app but this looks good for now. |
||
.td { | ||
border-bottom: solid 2px $light-gray; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,31 @@ | |
:total="associations.total" | ||
@download="download" | ||
> | ||
<!-- ortholog --> | ||
<template #ortholog="{ row }"> | ||
<AppNodeBadge | ||
v-if="row.direction === AssociationDirectionEnum.outgoing" | ||
:node="{ | ||
id: row.object, | ||
name: row.object_label, | ||
category: 'biolink:Gene', | ||
info: row.object_taxon_label, | ||
}" | ||
:breadcrumbs="getBreadcrumbs(node, row, 'subject')" | ||
/> | ||
|
||
<AppNodeBadge | ||
v-if="row.direction === AssociationDirectionEnum.incoming" | ||
:node="{ | ||
id: row.subject, | ||
name: row.subject_label, | ||
category: 'biolink:Gene', | ||
info: row.subject_taxon_label, | ||
}" | ||
:breadcrumbs="getBreadcrumbs(node, row, 'object')" | ||
/> | ||
</template> | ||
|
||
<!-- subject --> | ||
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. how to display an ortholog cell |
||
<template #subject="{ row }"> | ||
<AppNodeBadge | ||
|
@@ -65,6 +90,15 @@ | |
<span v-else class="empty">No info</span> | ||
</template> | ||
|
||
<template #has_evidence="{ row }"> | ||
<AppLink | ||
v-for="(source, index) in row.has_evidence_links" | ||
:key="index" | ||
:to="source.url || ''" | ||
>{{ source.id }}</AppLink | ||
> | ||
</template> | ||
|
||
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. how to display a has_evidence cell (borrowed from SectionAssociationDetails) 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. You likely shouldn't be using The key should uniquely identify what objcet this is rendering. I'm not totally familiar with this data structure, but I'm guessing that would be For example, if I had the set of rows:
Vue would render if fine initially. But if I resorted those rows:
Vue would not know that it would need to re-render those rows, since the key of the elements never changes-- the first element always has index 0, the second index 1, and so on. 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. fixed! thanks for catching that! |
||
<!-- button to show details --> | ||
<template #details="{ row }"> | ||
<AppButton text="Details" icon="info-circle" @click="openModal(row)" /> | ||
|
@@ -180,8 +214,46 @@ const search = ref(""); | |
|
||
type Datum = keyof DirectionalAssociation; | ||
|
||
/** Orholog columns */ | ||
|
||
const orthologColoumns = computed<Cols<Datum>>(() => { | ||
return [ | ||
{ | ||
slot: "taxon", | ||
key: "taxon" as Datum, | ||
heading: "Taxon", | ||
}, | ||
{ | ||
slot: "ortholog", | ||
key: "ortholog" as Datum, | ||
heading: "Ortholog", | ||
}, | ||
{ | ||
slot: "has_evidence", | ||
key: "has_evidence" as Datum, | ||
heading: "Evidence", | ||
}, | ||
{ | ||
slot: "primary_knowledge_source", | ||
key: "primary_knowledge_source" as Datum, | ||
heading: "Source", | ||
}, | ||
{ slot: "divider" }, | ||
{ | ||
slot: "details", | ||
key: "evidence_count", | ||
heading: "Details", | ||
align: "center", | ||
}, | ||
]; | ||
}); | ||
|
||
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. which columns should be shown for the ortholog section 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. I really like how you are using this data structure. |
||
/** table columns */ | ||
const cols = computed((): Cols<Datum> => { | ||
if (props.category.id.includes("GeneToGeneHomology")) { | ||
return orthologColoumns.value; | ||
} | ||
|
||
/** standard columns, always present */ | ||
const baseCols: Cols<Datum> = [ | ||
{ | ||
|
@@ -219,14 +291,12 @@ const cols = computed((): Cols<Datum> => { | |
let extraCols: Cols<Datum> = []; | ||
|
||
/** taxon column. exists for many categories, so just add if any row has taxon. */ | ||
if ( | ||
props.category.id.includes("GeneToGeneHomology") || | ||
props.category.id.includes("Interaction") | ||
) | ||
if (props.category.id.includes("Interaction")) { | ||
extraCols.push({ | ||
slot: "taxon", | ||
heading: "Taxon", | ||
}); | ||
} | ||
|
||
if ( | ||
props.node.in_taxon_label == "Homo sapiens" && | ||
|
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.
This was autoformatting from
make format