Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mdm-lab/wiki
  • hvaysset/wiki
  • jsousa/wiki
  • tclabby/wiki
4 results
Show changes
Showing
with 170833 additions and 5 deletions
......@@ -5,10 +5,14 @@ import json
from typing import Annotated, List, Optional
from pydantic import BaseModel, Field, BeforeValidator
from enum import Enum
from rich.console import Console
console = Console()
class RefSeqCsv(BaseModel):
id: str
sys_id: str
replicon: str
type: str
subtype: str
......@@ -86,7 +90,9 @@ def update_refseq(
row["accession_in_sys"] = split_on_comma(row["accession_in_sys"])
doc = RefSeqCsv(**row)
documents.append(doc.model_dump(by_alias=True))
index.add_documents_in_batches(documents, primary_key="id")
tasks = index.add_documents_in_batches(documents, primary_key="sys_id")
for task in tasks:
console.print(task)
index.update_pagination_settings({"maxTotalHits": 1000000})
index.update_filterable_attributes(
body=[
......@@ -210,7 +216,15 @@ def update_systems(
)
print(pagination_settings_task)
attr_task = index.update_filterable_attributes(
body=["title", "Sensor", "Activator", "Effector", "PFAM.AC", "PFAM.DE"]
body=[
"title",
"Sensor",
"Activator",
"Effector",
"PFAM.AC",
"PFAM.DE",
"contributors",
]
)
params = {
"maxValuesPerFacet": 1000000,
......
......@@ -5,6 +5,10 @@ from pathlib import Path
from df_wiki_cli.meilisearch import update_refseq, update_structure, update_systems
from enum import Enum
from types import SimpleNamespace
from rich.console import Console
console = Console()
app = typer.Typer()
......@@ -66,6 +70,21 @@ def delete_all_documents(ctx: typer.Context, id: str):
index.delete_all_documents()
@app.command()
def indexes(ctx: typer.Context):
client = meilisearch.Client(ctx.obj.host, ctx.obj.key)
indexes = client.get_indexes()["results"]
for index in indexes:
print(index.uid)
@app.command()
def index_update(ctx: typer.Context, index: str, primary_key: str):
client = meilisearch.Client(ctx.obj.host, ctx.obj.key)
task = client.index(index).update(primary_key=primary_key)
console.print(task)
@app.command()
def task(ctx: typer.Context, id: str):
client = meilisearch.Client(ctx.obj.host, ctx.obj.key)
......
[tool.poetry]
name = "df-wiki-cli"
version = "0.1.4"
version = "0.1.5"
description = ""
authors = ["Remi PLANEL <rplanel@pasteur.fr>"]
readme = "README.md"
......
<script setup lang="ts">
definePageMeta({
documentDriven: false
})
</script>
<template>
<NuxtPage></NuxtPage>
</template>
\ No newline at end of file
<script setup lang="ts">
import { toValue } from '@vueuse/core';
import { withTrailingSlash, withLeadingSlash, joinURL } from 'ufo'
import { useDisplay } from "vuetify"
definePageMeta({
documentDriven: false
})
definePageMeta({
layout: 'foldseek'
})
const runtimeConfig: { public: { hostUrl: string } } = useRuntimeConfig();
const { width, height } = useDisplay()
const route = useRoute()
const layout = ref({
scrollbarWidth: 15,
paddingLeft: 24,
paddingRight: 24,
toolbarHeight: 48,
containerPaddingTop: 16,
paddingTopCol: 16,
containerPaddingBottom: 10,
toolbarModalHeight: 48
})
const xMargin = computed(() => {
const toValLayout = toValue(layout)
return toValLayout.scrollbarWidth + toValLayout.paddingLeft + toValLayout.paddingRight
})
const yMargin = computed(() => {
const toValLayout = toValue(layout)
return toValLayout.toolbarHeight
+ toValLayout.toolbarModalHeight
+ toValLayout.containerPaddingBottom
+ toValLayout.containerPaddingTop
+ toValLayout.paddingTopCol
})
const computedWidth = computed(() => {
return toValue(width) - toValue(xMargin)
})
const computedHeight = computed(() => {
return toValue(height) - toValue(yMargin)
})
const breadcrumbItems = computed(() => {
return [
{
title: 'Structures DB',
disabled: false,
to: '/structure/'
},
{
title: route.params.system,
disabled: true,
exact: true,
to: {
name: route.name, params: {
...route.params,
}
}
}
]
})
const refinedFoldseekPath = computed(() => {
// return 'https://defense-finder.dev.pasteur.cloud/wiki/abia/AbiA_large__AbiA_large-plddts_90.82916.html'
const url = `/${route.params.system}/${route.params.fileName}.html`
console.log(useRuntimeConfig())
if (url?.startsWith('/') && !url.startsWith('//')) {
const _base = withLeadingSlash(withTrailingSlash(useRuntimeConfig().app.baseURL))
if (_base !== '/' && !url.startsWith(_base)) {
return joinURL(runtimeConfig.public.hostUrl, _base, url)
}
}
return url
})
const iframe = ref()
function fullscreen() {
console.log(iframe.value)
iframe.value.requestFullscreen();
}
</script>
<template>
<!-- <v-breadcrumbs :items="breadcrumbItems"></v-breadcrumbs> -->
<v-card variant="flat" color="transparent" class="pa-0">
<v-toolbar flat color="transparent" density="compact">
<v-spacer></v-spacer>
<v-btn @click="fullscreen()" icon="md:fullscreen"></v-btn>
</v-toolbar>
<iframe ref="iframe" :width="computedWidth" :height="computedHeight" allow="fullscreen" loading="lazy"
:src="refinedFoldseekPath"></iframe>
</v-card>
</template>
\ No newline at end of file
<script setup lang="ts">
import { toValue } from '@vueuse/core';
import { withTrailingSlash, withLeadingSlash, joinURL } from 'ufo'
import { useDisplay } from "vuetify"
definePageMeta({
documentDriven: false
})
definePageMeta({
layout: 'foldseek'
})
const runtimeConfig: { public: { hostUrl: string } } = useRuntimeConfig();
const { width, height } = useDisplay()
const route = useRoute()
const layout = ref({
scrollbarWidth: 15,
paddingLeft: 24,
paddingRight: 24,
toolbarHeight: 48,
containerPaddingTop: 16,
paddingTopCol: 16,
containerPaddingBottom: 10,
toolbarModalHeight: 48
})
const xMargin = computed(() => {
const toValLayout = toValue(layout)
console.log(route)
return toValLayout.scrollbarWidth + toValLayout.paddingLeft + toValLayout.paddingRight
})
const yMargin = computed(() => {
const toValLayout = toValue(layout)
return toValLayout.toolbarHeight
+ toValLayout.toolbarModalHeight
+ toValLayout.containerPaddingBottom
+ toValLayout.containerPaddingTop
+ toValLayout.paddingTopCol
})
const computedWidth = computed(() => {
return toValue(width) - toValue(xMargin)
})
const computedHeight = computed(() => {
return toValue(height) - toValue(yMargin)
})
const breadcrumbItems = computed(() => {
return [
{
title: 'Structures DB',
disabled: false,
to: '/structure/'
},
{
title: route.params.system,
disabled: true,
exact: true,
to: {
name: route.name, params: {
...route.params,
}
}
}
]
})
const refinedFoldseekPath = computed(() => {
// return 'https://defense-finder.dev.pasteur.cloud/wiki/abia/AbiA_large__AbiA_large-plddts_90.82916.html'
const url = `/${route.params.system}/${route.query.html}.html`
console.log(useRuntimeConfig())
if (url?.startsWith('/') && !url.startsWith('//')) {
const _base = withLeadingSlash(withTrailingSlash(useRuntimeConfig().app.baseURL))
if (_base !== '/' && !url.startsWith(_base)) {
const sanitizedUrl = joinURL(runtimeConfig.public.hostUrl, _base, url)
console.log(sanitizedUrl)
return sanitizedUrl
}
}
return url
})
const iframe = ref()
function fullscreen() {
console.log(iframe.value)
iframe.value.requestFullscreen();
}
</script>
<template>
<!-- <v-breadcrumbs :items="breadcrumbItems"></v-breadcrumbs> -->
<v-card variant="flat" color="transparent" class="pa-0">
<v-toolbar flat color="transparent" density="compact">
<v-spacer></v-spacer>
<v-btn @click="fullscreen()" icon="md:fullscreen"></v-btn>
</v-toolbar>
<iframe ref="iframe" :width="computedWidth" :height="computedHeight" allow="fullscreen"
:src="refinedFoldseekPath"></iframe>
</v-card>
</template>
\ No newline at end of file
<script setup lang="ts">
import { toValue } from '@vueuse/core';
import { withTrailingSlash, withLeadingSlash, joinURL } from 'ufo'
import { useDisplay } from "vuetify"
definePageMeta({
documentDriven: false
})
definePageMeta({
layout: 'foldseek'
})
const runtimeConfig: { public: { hostUrl: string } } = useRuntimeConfig();
const { width, height } = useDisplay()
const route = useRoute()
const layout = ref({
scrollbarWidth: 15,
paddingLeft: 24,
paddingRight: 24,
toolbarHeight: 48,
containerPaddingTop: 16,
paddingTopCol: 16,
containerPaddingBottom: 10,
toolbarModalHeight: 48
})
const xMargin = computed(() => {
const toValLayout = toValue(layout)
console.log(route)
return toValLayout.scrollbarWidth + toValLayout.paddingLeft + toValLayout.paddingRight
})
const yMargin = computed(() => {
const toValLayout = toValue(layout)
return toValLayout.toolbarHeight
+ toValLayout.toolbarModalHeight
+ toValLayout.containerPaddingBottom
+ toValLayout.containerPaddingTop
+ toValLayout.paddingTopCol
})
const computedWidth = computed(() => {
return toValue(width) - toValue(xMargin)
})
const computedHeight = computed(() => {
return toValue(height) - toValue(yMargin)
})
// const breadcrumbItems = computed(() => {
// return [
// {
// title: 'Structures DB',
// disabled: false,
// to: '/structure/'
// },
// {
// title: route.params.system,
// disabled: true,
// exact: true,
// to: {
// name: route.name, params: {
// ...route.params,
// }
// }
// }
// ]
// })
const refinedFoldseekPath = computed(() => {
// return 'https://defense-finder.dev.pasteur.cloud/wiki/abia/AbiA_large__AbiA_large-plddts_90.82916.html'
const url = `/${route.query.system}/${route.query.html}.html`
console.log(useRuntimeConfig())
if (url?.startsWith('/') && !url.startsWith('//')) {
const _base = withLeadingSlash(withTrailingSlash(useRuntimeConfig().app.baseURL))
if (_base !== '/' && !url.startsWith(_base)) {
const sanitizedUrl = joinURL(_base, url)
return sanitizedUrl
}
}
return url
})
const iframe = ref()
function fullscreen() {
console.log(iframe.value)
iframe.value.requestFullscreen();
}
</script>
<template>
<!-- <v-breadcrumbs :items="breadcrumbItems"></v-breadcrumbs> -->
<v-card variant="flat" color="transparent" class="pa-0">
<v-toolbar flat color="transparent" density="compact">
<v-spacer></v-spacer>
<v-btn @click="fullscreen()" icon="md:fullscreen"></v-btn>
</v-toolbar>
<iframe ref="iframe" :width="computedWidth" :height="computedHeight" allow="fullscreen"
:src="refinedFoldseekPath"></iframe>
</v-card>
</template>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
public/rm/Figure_1_Tock_Dryden_2005.png

10.8 KiB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
find * -type d -exec sh -c 'for d in "$@"; do (cd "/usr/share/nginx/html/$d"; cp --archive --recursive --symbolic-link /structure-data/sanitized-dump/$d/* .) done' argv0 {} +
# find * -type d -exec sh -c 'for d in "$@"; do (cd "/usr/src/app/public/$d"; cp --archive --recursive --symbolic-link /structure-data/sanitized-dump/$d/* .) done' argv0 {} +
find * -type d -exec sh -c 'for d in "$@"; do (cd "/usr/share/nginx/html/$d"; cp --archive --recursive --symbolic-link /structure-data/sanitized-dump/$d/* .) done' argv0 {} +
\ No newline at end of file
import { defineConfig, presetUno, presetIcons, presetAttributify } from 'unocss'
export default defineConfig({
// ...UnoCSS options
presets: [
presetUno(),
presetAttributify(),
presetIcons(),
]
})
\ No newline at end of file