Skip to content
Snippets Groups Projects
Commit 1f9f4590 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

use structure basket

parent 59e3f5a5
No related branches found
No related tags found
No related merge requests found
......@@ -5,16 +5,18 @@ import * as d3 from "d3";
import SystemOperonStructure from './SystemOperonStructure.vue';
import type { StructureItem } from '~/types/structure';
import type { SearchParams, SearchResponse } from 'meilisearch';
import { useStructuresBasket } from '~/stores/structuresBasket';
const { page } = useContent();
const client = useMeiliSearchRef()
const structureBasket = useStructuresBasket()
// get the structures
const structures = ref<SearchResponse<StructureItem, SearchParams> | undefined>()
const structureTitle = ref("Structure")
const msIndexName = ref<string>("structure")
const stuctureUrls = ref<string[] | undefined>(undefined)
// const stuctureUrls = ref<string[] | undefined>(undefined)
const headers = ref<Record<string, any>[]>([
{ title: 'Structure', key: 'structure', sortable: false, removable: false, fixed: true, minWidth: "110px" },
......@@ -56,7 +58,7 @@ function pdbNameToCif(pdbPath: string) {
return `${cifPath}.cif`
}
function displayStructure(item) {
stuctureUrls.value = item.structuresUrls
structureBasket.set(item.structuresUrls)
structureTitle.value = `${item.subsystem} - ${item.gene_name}`
}
......@@ -163,6 +165,6 @@ async function fetchStructures() {
</v-row>
</template>
</v-data-table>
<PdbeMolstarPlugin v-model="stuctureUrls" v-model:title="structureTitle" />
<PdbeMolstarPlugin v-model:title="structureTitle" />
</v-card>
</template>
\ No newline at end of file
......@@ -6,6 +6,7 @@ import PlotFigure from "@/components/PlotFigure";
import type { SearchResponse } from 'meilisearch'
import { useRefinedUrl } from "@/composables/useRefinedUrl"
import { useDisplay } from "vuetify";
import { useStructuresBasket } from "~/stores/structuresBasket";
interface Props {
subsystem: string
......@@ -20,8 +21,9 @@ const filterBase = ref<string[]>([
"completed='true'"
])
const structureTitle = ref("Structure")
const structureUrls = ref<string[] | undefined>(undefined)
// const structureUrls = ref<string[] | undefined>(undefined)
const matrixElemSize = ref(50)
const structureBasket = useStructuresBasket()
export interface PlotMargin {
marginTop: number,
......@@ -183,9 +185,10 @@ function buildStructureUrl(item) {
}
function displayStructure(item) {
structureUrls.value = buildStructureUrl(item).map(url => {
return toValue(useRefinedUrl(url).refinedUrl)
})
structureBasket.set(
buildStructureUrl(item).map(url => {
return toValue(useRefinedUrl(url).refinedUrl)
}))
structureTitle.value = item.proteins_in_the_prediction.join(" / ")
}
......@@ -200,7 +203,7 @@ function displayStructure(item) {
</v-card-text>
</v-card>
<PdbeMolstarPlugin v-model="structureUrls" v-model:title="structureTitle" />
<PdbeMolstarPlugin v-model:title="structureTitle" />
</v-row>
<v-card v-else flat color="transparent">
<v-card-text>
......
......@@ -4,7 +4,8 @@ import { useNumericalFilter } from "@/composables/useNumericalfilter"
import { useRefinedUrl } from "@/composables/useRefinedUrl"
import { ServerDbTable } from "#components"
import { withQuery, joinURL, withTrailingSlash } from 'ufo'
import { joinURL } from 'ufo'
import { useStructuresBasket } from "~/stores/structuresBasket"
interface Item {
Foldseek_name: string
......@@ -12,12 +13,12 @@ interface Item {
}
const sortBy: Ref<SortItem[]> = ref([{ key: 'System', order: "asc" }])
const sortBy: Ref<SortItem[]> = ref([{ key: 'system', order: "asc" }])
const itemValue = ref("id");
const dbName = ref("structure")
const client = useMeiliSearchRef()
const structureTitle = ref("Structure")
const stuctureUrls = ref<string[] | undefined>(undefined)
const structureBasket = useStructuresBasket()
onMounted(async () => {
......@@ -48,7 +49,6 @@ const autocompleteMeiliFacetsProps = ref<AutocompleteMeiliFacetProps>({
{ title: "System", value: "System", type: "facet", icon: "i-tabler:virus-off", },
{ title: "Subsystem", value: "subtype", type: "facet", icon: "i-tabler:virus-off" },
{ type: "divider" },
{ title: "Gene name", value: "gene_name", type: "facet", icon: "mdi-dna" },
{ title: "Completed", value: "completed", type: "facet", icon: "md:done" },
{ title: "Prediction type", value: "prediction_type", type: "facet", icon: "i-gravity-ui:molecule" },
],
......@@ -83,9 +83,9 @@ const computedAutocompleteMeiliFacetsProps = computed(() => {
const headers: Ref<Object[]> = ref([
{ title: 'Structure', key: 'structure', sortable: false, removable: false, fixed: true, minWidth: "110px" },
{ title: 'Foldseek', key: 'Foldseek_name', sortable: false },
{ title: "System", key: "System", removable: false },
{ title: "Gene name", key: "gene_name", removable: false },
{ title: "Subtype", key: "subtype", removable: false },
{ title: "System", key: "system", removable: false },
// { title: "Gene name", key: "gene_name", removable: false },
{ title: "Sub-system", key: "subsystem", removable: false },
// { title: "pdb file", key: "pdb" },
// { title: "fasta", key: "fasta_file" },
{ title: "Proteins in structure", key: 'proteins_in_the_prediction', sortable: false, removable: true },
......@@ -157,9 +157,10 @@ function buildStructureUrl(item) {
}
function displayStructure(item) {
stuctureUrls.value = buildStructureUrl(item).map(url => {
structureBasket.set(buildStructureUrl(item).map(url => {
return toValue(useRefinedUrl(url).refinedUrl)
})
}))
structureTitle.value = `${item.subtype} - ${item.gene_name}`
}
......
......@@ -341,7 +341,6 @@ def structure(
body=[
"system",
"subsystem",
"gene_name",
"completed",
"prediction_type",
"plddts",
......@@ -365,7 +364,6 @@ def structure(
[
"system",
"subsystem",
"gene_name",
"completed",
"plddts",
"nb_sys",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment