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

Update new refseq datatable

parent b80baf6f
No related branches found
No related tags found
1 merge request!222Refseq no sys
Pipeline #121907 waiting for manual action
......@@ -107,6 +107,8 @@ const scaleTypes = ref<string[]>(['linear', 'sqrt', 'log', 'symlog'])
const selectedTaxoRank = ref("Superkingdom");
const headers = ref([
{ title: "Assembly", key: "Assembly" },
{ title: "Replicon", key: "replicon" },
{
title: "System",
......@@ -474,14 +476,16 @@ async function downloadPng(component: ComponentPublicInstance | null, filename:
</CollapsibleChips>
</template>
<template #[`item.type`]="{ item }">
<v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`" target="_blank"> {{
item.type }}
<v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`"
target="_blank"> {{
item.type }}
</v-chip>
</template>
<template #[`item.subtype`]="{ item }">
<v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`" target="_blank"> {{
item.subtype }}
<v-chip color="info" link size="small" :to="`/defense-systems/${item.type.toLowerCase()}`"
target="_blank"> {{
item.subtype }}
</v-chip>
</template>
</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(
writer = csv.DictWriter(out, fieldnames=fieldnames)
writer.writeheader()
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"])
console.print(f"[green]{row['sys_id']} -> {result}")
row["sys_id"] = result
......
......@@ -11,15 +11,22 @@ from rich.console import Console
console = Console()
def emptyStringToNone(val: str) -> None | int:
if val == "":
return None
return int(float(val))
class RefSeqCsv(BaseModel):
sys_id: str
Assembly: str
replicon: str
type: str
subtype: str
sys_beg: str
sys_end: str
protein_in_syst: List[str]
genes_count: int
genes_count: Annotated[int | None, BeforeValidator(emptyStringToNone)]
name_of_profiles_in_sys: List[str]
accession_in_sys: List[str]
Superkingdom: str
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment