Skip to content

Commit

Permalink
Improve the search results.
Browse files Browse the repository at this point in the history
  • Loading branch information
yjcyxky committed Mar 31, 2024
1 parent 5a0bc8f commit 5813639
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/api/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ impl BiomedgpsApi {
"id ASC".to_string()
} else {
// More fields will cause bad performance
make_order_clause_by_pairs(pairs, 2)
make_order_clause_by_pairs(pairs, 1)
}
}
None => "id ASC".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion src/bin/biomedgps-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub struct CacheTableArguments {
#[structopt(name = "table", short = "t", long = "table")]
table: String,

/// [Optional] Relation types for compound-disease-symptom table. Separated by comma. e.g. STRING::BINDING::Gene:Gene,STRING::BINDING::Gene:Gene. The number and order of relation types should be consistent with the pairs of table name. e.g. compound-disease-symptom table should have two relation types for compound-disease and disease-symptom.
/// [Optional] Relation types for compound-disease-symptom table. Separated by comma. e.g. DRUGBANK::treats::Compound:Disease,HSDN::has_symptom:Disease:Symptom. The number and order of relation types should be consistent with the pairs of table name. e.g. compound-disease-symptom table should have two relation types for compound-disease and disease-symptom.
#[structopt(name = "relation_types", short = "r", long = "relation-types")]
relation_types: Option<String>,

Expand Down
5 changes: 3 additions & 2 deletions studio/src/pages/Home/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
overflow: scroll;

.header {
height: 30%;
height: 40%;
width: 100%;
display: flex;
flex-direction: column;
Expand All @@ -35,7 +35,7 @@

.text-statistics {
display: flex;
padding: 0 40px;
padding: 0 6%;
flex-direction: row;
width: 100%;

Expand Down Expand Up @@ -77,6 +77,7 @@
}

.statistics {
height: 50%;
padding: 0 60px;

.data-stat {
Expand Down
17 changes: 11 additions & 6 deletions studio/src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,19 @@ export const fetchNodes = async (
// If the value is a number, then maybe it is an id or xref but not for name or synonyms.
if (value && !isNaN(Number(value))) {
queryMap = { id: value, xrefs: value };
order = ['label', 'id', 'xrefs'];
order = ['id', 'xrefs', 'label'];
} else {
queryMap = { name: value, synonyms: value, xrefs: value, id: value };
order = ['label', 'name', 'synonyms', 'xrefs', 'id'];
order = ['name', 'synonyms', 'xrefs', 'id', 'label'];
}

const fetchData = () => {
fetchEntities({
query_str: makeQueryEntityStr(queryMap, order),
page: 1,
page_size: 50,
// We only want to get all valid entities.
model_table_prefix: 'biomedgps',
})
.then((response) => {
const { records } = response;
Expand Down Expand Up @@ -291,7 +293,7 @@ const HomePage: React.FC = () => {
>
{nodeOptions &&
nodeOptions.map((option: any) => (
<Select.Option key={option.label} value={option.value} disabled={option.disabled} onMouseEnter={() => {
<Select.Option key={option.value} value={option.value} disabled={option.disabled} onMouseEnter={() => {
console.log('hover:', option);
setCurrentNodeOption(option.value);
}} onMouseLeave={() => {
Expand Down Expand Up @@ -351,9 +353,11 @@ const HomePage: React.FC = () => {
<Tag color={guessColor("Symptom")}>Symptom | Fatigue</Tag>
</a>
</span>
<span style={{ textAlign: 'center', color: 'red', fontWeight: 'bold' }}>NOTE: If you cannot find the node you are looking for, this may be due to the lack of knowledges in the current version of the platform.<br /> Please give us feedback or check the <a href="https://drugs.3steps.cn/#/about">About</a> page for more information.</span>
</Col>
<Row className="statistics" gutter={16}>
<Col className="data-stat" sm={24} md={12} xs={12} xxl={12}>
<Col sm={0} md={1} xs={1} xxl={1}></Col>
<Col className="data-stat" sm={24} md={10} xs={10} xxl={10}>
<p className="desc" style={{ textAlign: 'justify' }}>
A platform with biomedical knowledge graph and graph neural network for drug repurposing and disease mechanism.
<br />
Expand All @@ -367,8 +371,8 @@ const HomePage: React.FC = () => {
More resources about the platform can be found in the <a href="https://drugs.3steps.cn/#/about">About</a> page.
</p>
</Col>
<Col sm={0} md={1} xs={1} xxl={1}></Col>
<Col className="image-container" sm={24} md={11} xs={11} xxl={11}>
<Col sm={0} md={2} xs={2} xxl={2}></Col>
<Col className="image-container" sm={24} md={10} xs={10} xxl={10}>
<Carousel autoPlay dynamicHeight={false} infiniteLoop showThumbs={false}>
{images.map((item: ImageItem) => {
return (
Expand All @@ -380,6 +384,7 @@ const HomePage: React.FC = () => {
})}
</Carousel>
</Col>
<Col sm={0} md={1} xs={1} xxl={1}></Col>
</Row>
<Row className="text-statistics">
{stats.map((item) => {
Expand Down
1 change: 0 additions & 1 deletion studio/src/pages/ModelConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Layout, Menu, Form, Input, InputNumber, Button, Select, Empty, Col, Row
import { DotChartOutlined, DribbbleOutlined, AimOutlined, BranchesOutlined, BugOutlined, ZoomInOutlined } from '@ant-design/icons';
import { history } from 'umi';
// import { createFromIconfontCN } from '@ant-design/icons';
import { useAuth0 } from "@auth0/auth0-react";
import { GraphTable } from 'biominer-components';
import { makeDataSources, pushGraphDataToLocalStorage } from 'biominer-components/dist/KnowledgeGraph/utils';
import { APIs, GraphData, COMPOSED_ENTITY_DELIMITER, Entity } from 'biominer-components/dist/typings';
Expand Down

0 comments on commit 5813639

Please sign in to comment.