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

Merge branch 'dev' into matrix-pdock

parents 63fb2de8 6e535f35
No related branches found
No related tags found
1 merge request!226Resolve "Design of the structure section in a system's page"
This commit is part of merge request !226. Comments created here will be created in the context of that merge request.
...@@ -360,12 +360,13 @@ update-meilisearch-index:prod: ...@@ -360,12 +360,13 @@ update-meilisearch-index:prod:
stage: get-meili-key stage: get-meili-key
variables: variables:
MEILI_HOST: "http://localhost:7700" MEILI_HOST: "http://localhost:7700"
MEILI_HOST_NO_PROTOCOLE: "localhost:7700"
script: script:
- > - >
df-wiki-cli df-wiki-cli
meilisearch meilisearch
--key "${MEILI_MASTER_KEY}" --key "${MEILI_MASTER_KEY}"
--host ${MEILI_HOST} --host "${MEILI_HOST}"
get-env-var get-env-var
--output build.env --output build.env
artifacts: artifacts:
...@@ -378,6 +379,7 @@ set-meili-env:dev: ...@@ -378,6 +379,7 @@ set-meili-env:dev:
extends: .set-meili-env extends: .set-meili-env
variables: variables:
MEILI_HOST: "https://${MEILI_HOST_DEV}" MEILI_HOST: "https://${MEILI_HOST_DEV}"
MEILI_HOST_NO_PROTOCOLE: ${MEILI_HOST_DEV}
rules: rules:
- if: $CI_COMMIT_BRANCH != "main" - if: $CI_COMMIT_BRANCH != "main"
...@@ -385,6 +387,8 @@ set-meili-env:prod: ...@@ -385,6 +387,8 @@ set-meili-env:prod:
extends: .set-meili-env extends: .set-meili-env
variables: variables:
MEILI_HOST: "https://${MEILI_HOST_PROD}" MEILI_HOST: "https://${MEILI_HOST_PROD}"
MEILI_HOST_NO_PROTOCOLE: ${MEILI_HOST_PROD}
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
...@@ -416,7 +420,6 @@ sync-zotero: ...@@ -416,7 +420,6 @@ sync-zotero:
- *docker-login - *docker-login
script: script:
- echo $MEILI_HOST - echo $MEILI_HOST
- echo $MEILI_API_KEY
- > - >
docker buildx build --pull -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA" docker buildx build --pull -t "$CI_REGISTRY_IMAGE/$IMAGE_NAME:$CI_COMMIT_SHORT_SHA"
--build-arg "BASE_URL=$BASE_URL" --build-arg "BASE_URL=$BASE_URL"
...@@ -450,7 +453,7 @@ build:prod:wiki: ...@@ -450,7 +453,7 @@ build:prod:wiki:
# - get-pfam # - get-pfam
variables: variables:
BASE_URL: /wiki/ BASE_URL: /wiki/
HOST_URL: https://${HOST_PROD} HOST_URL: "https://${HOST_PROD}"
rules: rules:
- if: $CI_COMMIT_BRANCH == "main" - if: $CI_COMMIT_BRANCH == "main"
...@@ -517,7 +520,7 @@ deploy:prod: ...@@ -517,7 +520,7 @@ deploy:prod:
variables: variables:
NODE_ENV: "production" NODE_ENV: "production"
KUBE_NAMESPACE: "defense-finder-prod" KUBE_NAMESPACE: "defense-finder-prod"
PUBLIC_URL: "${HOST_PROD}" PUBLIC_URL: "https://${HOST_PROD}"
CI_DEBUG_TRACE: "false" CI_DEBUG_TRACE: "false"
ENV: "production" ENV: "production"
environment: environment:
...@@ -601,7 +604,7 @@ create-structures-archives:prod: ...@@ -601,7 +604,7 @@ create-structures-archives:prod:
variables: variables:
NODE_ENV: "production" NODE_ENV: "production"
KUBE_NAMESPACE: "defense-finder-prod" KUBE_NAMESPACE: "defense-finder-prod"
PUBLIC_URL: "${HOST_PROD}" PUBLIC_URL: "https://${HOST_PROD}"
CI_DEBUG_TRACE: "false" CI_DEBUG_TRACE: "false"
ENV: "production" ENV: "production"
environment: environment:
......
...@@ -18,7 +18,12 @@ const itemValue = ref("id"); ...@@ -18,7 +18,12 @@ const itemValue = ref("id");
const { width } = useDisplay(); const { width } = useDisplay();
const dbName = ref("refseq") const dbName = ref("refseq")
const taxonomyFacet = ref<Record<string, any> | undefined>(undefined) const taxonomyFacet = ref<Record<string, any> | undefined>(undefined)
const cellPlotMargin = ref({
marginLeft: 150,
marginBottom: 200,
marginTop: 0,
marginRight: 50
})
onBeforeMount(async () => { onBeforeMount(async () => {
...@@ -150,7 +155,7 @@ const availableTaxo: Ref<string[]> = ref([ ...@@ -150,7 +155,7 @@ const availableTaxo: Ref<string[]> = ref([
"Superkingdom" "Superkingdom"
]); ]);
const scaleTypes = ref<string[]>(['linear', 'sqrt', 'log', 'symlog']) const scaleTypes = ref<string[]>(['linear', 'sqrt', 'symlog'])
const selectedTaxoRank = ref<"species" | "genus" | "family" | "order" | "class" | "phylum" | "Superkingdom">("Superkingdom"); const selectedTaxoRank = ref<"species" | "genus" | "family" | "order" | "class" | "phylum" | "Superkingdom">("Superkingdom");
const headers = ref([ const headers = ref([
...@@ -190,7 +195,18 @@ const computedWidth = computed(() => { ...@@ -190,7 +195,18 @@ const computedWidth = computed(() => {
return Math.max(currentWidth, 550); return Math.max(currentWidth, 550);
}); });
const cellPlotComputedDimension = computed(() => {
const { marginLeft, marginBottom, marginRight, marginTop } = toValue(cellPlotMargin)
const toValWidth = toValue(width)
const widthFixCell = countSystem.value * 50 + marginLeft + marginRight
const heigthFix = countClade.value * 50 + marginTop + marginBottom
if (widthFixCell > toValWidth) {
return { width: toValWidth - marginLeft - marginRight, height: undefined }
} else {
return { width: widthFixCell, height: heigthFix }
}
})
const allHits: Ref<Record<string, any> | undefined> = ref(undefined) const allHits: Ref<Record<string, any> | undefined> = ref(undefined)
...@@ -364,17 +380,33 @@ const sortedCellDomain = computed(() => { ...@@ -364,17 +380,33 @@ const sortedCellDomain = computed(() => {
} }
}) })
const binPlotOptions = computed(() => { const binPlotOptions = computed(() => {
const { marginLeft, marginBottom } = toValue(cellPlotMargin)
const { height } = toValue(cellPlotComputedDimension)
return { return {
marginLeft: 150, marginLeft,
marginBottom: 200, marginBottom,
padding: 0, padding: 0,
grid: true, grid: true,
aspectRatio: true, aspectRatio: height ? undefined : 1,
x: { tickRotate: 90, label: "Systems", domain: toValue(sortedCellDomain) }, x: { tickRotate: 90, label: "Systems", domain: toValue(sortedCellDomain) },
color: { scheme: "plasma", legend: true, label: `Proportion per ${selectedTaxoRank.value}`, domain: [0, 100] }, color: { scheme: "plasma", legend: true, label: `Proportion per ${selectedTaxoRank.value}`, domain: [0, 100] },
} }
}) })
const countSystem = computed(() => {
const toValueAllHits = toValue(allHits)
const data = toValueAllHits?.hits ?? []
const setSystem = new Set(data.map(d => d.type))
return setSystem.size
})
const countClade = computed(() => {
const toValueAllHits = toValue(allHits)
const data = toValueAllHits?.hits ?? []
const setSystem = new Set(data.map(d => d[selectedTaxoRank.value]))
return setSystem.size
})
const binPlotGroup = computed(() => { const binPlotGroup = computed(() => {
return Plot.group( return Plot.group(
...@@ -423,9 +455,13 @@ const binPlotDataOptions = computed(() => { ...@@ -423,9 +455,13 @@ const binPlotDataOptions = computed(() => {
const toValBinPlotGroup = toValue(binPlotGroup) const toValBinPlotGroup = toValue(binPlotGroup)
const data = toValueAllHits?.hits ?? [] const data = toValueAllHits?.hits ?? []
const plotCellMark = Plot.cell(data, toValBinPlotGroup) const plotCellMark = Plot.cell(data, toValBinPlotGroup)
const { width, height } = toValue(cellPlotComputedDimension)
const dim = height ? { width, height } : { width }
return toValueAllHits?.hits?.length > 0 ? { return toValueAllHits?.hits?.length > 0 ? {
...binPlotOptions.value, ...binPlotOptions.value,
width: width.value, ...dim,
title: `Proportion of genomes with defense system X per ${selectedTaxoRank.value} taxonomic rank`, title: `Proportion of genomes with defense system X per ${selectedTaxoRank.value} taxonomic rank`,
color: { color: {
...binPlotOptions.value.color, ...binPlotOptions.value.color,
......
...@@ -35,6 +35,7 @@ securityContext: ...@@ -35,6 +35,7 @@ securityContext:
runAsNonRoot: true runAsNonRoot: true
runAsUser: 101 runAsUser: 101
runAsGroup: 101 runAsGroup: 101
allowPrivilegeEscalation: false
# capabilities: # capabilities:
# drop: # drop:
# - ALL # - ALL
......
...@@ -25,6 +25,6 @@ appVersion: "1.16.0" ...@@ -25,6 +25,6 @@ appVersion: "1.16.0"
dependencies: dependencies:
- name: meilisearch - name: meilisearch
version: 0.3.0 version: 0.5.0
repository: "https://meilisearch.github.io/meilisearch-kubernetes" repository: "https://meilisearch.github.io/meilisearch-kubernetes"
...@@ -7,7 +7,7 @@ services: ...@@ -7,7 +7,7 @@ services:
args: args:
BASE_URL: /wiki BASE_URL: /wiki
MEILI_HOST: http://localhost:7700 MEILI_HOST: http://localhost:7700
MEILI_API_KEY: f9cc073016cbb392365aae86517878cb3f3408bb85c1fafd06e27f73ccb35e3d MEILI_API_KEY: f5f5f1bc48e6379fc2509f5bf0aed1fce96c1bbf86e0a194c605b258d7cfe890
HOST_URL: http://localhost:8082 HOST_URL: http://localhost:8082
container_name: nuxt container_name: nuxt
environment: environment:
...@@ -31,7 +31,7 @@ services: ...@@ -31,7 +31,7 @@ services:
- main - main
meilisearch: meilisearch:
image: getmeili/meilisearch:v1.5 image: getmeili/meilisearch:v1.7
# command: # command:
# - meilisearch # - meilisearch
# - --http-addr # - --http-addr
......
...@@ -137,7 +137,9 @@ def get_env_var( ...@@ -137,7 +137,9 @@ def get_env_var(
keys = client.get_keys() keys = client.get_keys()
api_key = [res.key for res in keys.results if res.name == "Default Search API Key"] api_key = [res.key for res in keys.results if res.name == "Default Search API Key"]
print(ctx.obj.host)
if len(api_key) == 1: if len(api_key) == 1:
with open(output, "a") as outfile: with open(output, "a") as outfile:
outfile.write(f"MEILI_HOST={ctx.obj.host}\n") print(ctx.obj.host)
outfile.write(f"MEILI_API_KEY={api_key[0]}\n") outfile.write(f'MEILI_HOST="{ctx.obj.host}"\n')
outfile.write(f'MEILI_API_KEY="{api_key[0]}"\n')
#!/bin/bash
# REFSEQ
df-wiki-cli meilisearch delete-all-documents refseq
df-wiki-cli meilisearch update --file ../data/refseq_res.csv --document refseq
# REF SEQ TAXO
df-wiki-cli content refseq-group-per-assembly --input ../data/refseq_res.csv --output /tmp/refseqtaxo.csv
df-wiki-cli meilisearch delete-all-documents refseqtaxo
df-wiki-cli meilisearch update --file /tmp/refseqtaxo.csv --document refseqtaxo
# REFSEQ TAXO TYPE
df-wiki-cli content refseq-group-per-assembly-and-type --input ../data/refseq_res.csv --output /tmp/refseqtaxotype.csv
df-wiki-cli meilisearch delete-all-documents refseqtaxotype
df-wiki-cli meilisearch update --file /tmp/refseqtaxotype.csv --document refseqtaxotype
# SANITIZED REFSEQ
df-wiki-cli content refseq-sanitized-hits --input ../data/refseq_res.csv --output /tmp/refseq-sanitized.csv
df-wiki-cli meilisearch delete-all-documents refseqsanitized
df-wiki-cli meilisearch update --file /tmp/refseq-sanitized.csv --document refseqsanitized
# systems
df-wiki-cli content systems --dir ../content/3.defense-systems/ --pfam ../public/pfam-a-hmm.csv --output /tmp/list-systems.json
df-wiki-cli meilisearch update --file /tmp/list-systems.json --document systems
# STRUCTURE
df-wiki-cli meilisearch update --file ../data/all_predictions_statistics_clean.csv --document structure
# ARTICLES
# df-wiki-cli meilisearch delete-all-documents article
# df-wiki-cli meilisearch
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