Skip to content
New issue

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

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

Already on GitHub? # to your account

Estelle/controlled keywords #243

Merged
merged 19 commits into from
Aug 22, 2024
Merged

Conversation

EstelleDa
Copy link
Member

Finished one.

@EstelleDa EstelleDa requested a review from jstone-dev August 2, 2024 01:19
Copy link
Collaborator

@bencap bencap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice, left a couple minor comments but if you want to address them with TODOs and backlog items I don't think they are blocking.

@@ -541,7 +752,7 @@ export default {
}

const editedItem = _.merge({}, this.item || {}, editedFields)

console.log(editedItem)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. I think I added it when I debug something and forgot it.

<p class="m-0">
{{ keyword.keyword.description }}
</p>
</Dialog> : <a :href="`https://www.mavedb.org/search/?keywords=${keyword.keyword.value}`">{{ keyword.keyword.value }}</a>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem like there is a mechanism in the score set search to search by keywords on associated experiments. We either want to add that or remove this link, since right now it will just link to a generic search when clicked.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In search_score_set function, I added this part. My understanding for it is the associated score sets will be returned if users type keywords. However, it's online one so I can't test it and I thought just put it first and see how it's going.
image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that will allow us to load the score sets matching our filter logic, but we would still need to add the filter for keywords and add the .

So in src/mavedb/view_models/search.py we would need to add a keywords list to the search model:

class ScoreSetsSearch(BaseModel):
    published: Optional[bool]
    targets: Optional[list[str]]
    target_organism_names: Optional[list[str]]
    target_types: Optional[list[str]]
    target_accessions: Optional[list[str]]
    authors: Optional[list[str]]
    databases: Optional[list[str]]
    journals: Optional[list[str]]
    publication_identifiers: Optional[list[str]]
    keywords: Optional[list[str]]
    text: Optional[str]

And then in src/mavedb/lib/score_sets.py we'd have to add a block that queries the experiment keywords:

if search.keywords:
    query = query.filter(
        Experiment.keyword_objs.any(
            ControlledKeyword.value.in_(search.keywords)
        )
    )

I haven't tested that, but would be happy to look together if you wanted to add it in.

@bencap bencap added the type: enhancement Enhancement to an existing feature label Aug 14, 2024
@bencap bencap linked an issue Aug 14, 2024 that may be closed by this pull request
@EstelleDa EstelleDa merged commit 48e5304 into release-2024.3.0 Aug 22, 2024
@bencap bencap mentioned this pull request Aug 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
type: enhancement Enhancement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Keyword overhaul
3 participants