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

Update new refseq datatable

parent b80baf6f
Branches dev
No related tags found
1 merge request!222Refseq no sys
Pipeline #121907 waiting for manual action with stages
in 5 minutes and 59 seconds
...@@ -107,6 +107,8 @@ const scaleTypes = ref<string[]>(['linear', 'sqrt', 'log', 'symlog']) ...@@ -107,6 +107,8 @@ const scaleTypes = ref<string[]>(['linear', 'sqrt', 'log', 'symlog'])
const selectedTaxoRank = ref("Superkingdom"); const selectedTaxoRank = ref("Superkingdom");
const headers = ref([ const headers = ref([
{ title: "Assembly", key: "Assembly" },
{ title: "Replicon", key: "replicon" }, { title: "Replicon", key: "replicon" },
{ {
title: "System", title: "System",
...@@ -474,14 +476,16 @@ async function downloadPng(component: ComponentPublicInstance | null, filename: ...@@ -474,14 +476,16 @@ async function downloadPng(component: ComponentPublicInstance | null, filename:
</CollapsibleChips> </CollapsibleChips>
</template> </template>
<template #[`item.type`]="{ item }"> <template #[`item.type`]="{ item }">
<v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`" target="_blank"> {{ <v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`"
item.type }} target="_blank"> {{
item.type }}
</v-chip> </v-chip>
</template> </template>
<template #[`item.subtype`]="{ item }"> <template #[`item.subtype`]="{ item }">
<v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`" target="_blank"> {{ <v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`"
item.subtype }} target="_blank"> {{
item.subtype }}
</v-chip> </v-chip>
</template> </template>
</ServerDbTable> </ServerDbTable>
......
source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
...@@ -270,6 +270,8 @@ def refseq( ...@@ -270,6 +270,8 @@ def refseq(
writer = csv.DictWriter(out, fieldnames=fieldnames) writer = csv.DictWriter(out, fieldnames=fieldnames)
writer.writeheader() writer.writeheader()
for row in reader: for row in reader:
if row["sys_id"] == "":
row["sys_id"] = f'{row["Assembly"]}_{row["replicon"]}'
result = re.sub(r"^(\w+)\.\d+(_.*)$", r"\1\2", row["sys_id"]) result = re.sub(r"^(\w+)\.\d+(_.*)$", r"\1\2", row["sys_id"])
console.print(f"[green]{row['sys_id']} -> {result}") console.print(f"[green]{row['sys_id']} -> {result}")
row["sys_id"] = result row["sys_id"] = result
......
...@@ -11,15 +11,22 @@ from rich.console import Console ...@@ -11,15 +11,22 @@ from rich.console import Console
console = Console() console = Console()
def emptyStringToNone(val: str) -> None | int:
if val == "":
return None
return int(float(val))
class RefSeqCsv(BaseModel): class RefSeqCsv(BaseModel):
sys_id: str sys_id: str
Assembly: str
replicon: str replicon: str
type: str type: str
subtype: str subtype: str
sys_beg: str sys_beg: str
sys_end: str sys_end: str
protein_in_syst: List[str] protein_in_syst: List[str]
genes_count: int genes_count: Annotated[int | None, BeforeValidator(emptyStringToNone)]
name_of_profiles_in_sys: List[str] name_of_profiles_in_sys: List[str]
accession_in_sys: List[str] accession_in_sys: List[str]
Superkingdom: str Superkingdom: str
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment