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

handle case where cannot remove prefix using __ as separator

parent 357cd886
No related branches found
No related tags found
1 merge request!226Resolve "Design of the structure section in a system's page"
Pipeline #126763 waiting for manual action with stages
in 8 minutes and 5 seconds
...@@ -81,18 +81,22 @@ const computedSystem = computed(() => { ...@@ -81,18 +81,22 @@ const computedSystem = computed(() => {
const groupedPdocks = computed(() => { const groupedPdocks = computed(() => {
const toValData = toValue(data) const toValData = toValue(data)
const getSeqName = (d) => {
if (d.includes("__")) {
return d.split("__")[1]
} else {
return d
}
}
if (toValData?.hits) { if (toValData?.hits) {
return d3.groups(toValData.hits.flatMap(({ System_name_ok, pDockQ, pdb, nb_sys, proteins_in_the_prediction, system_genes }) => { return d3.groups(toValData.hits.flatMap(({ System_name_ok, pDockQ, pdb, nb_sys, proteins_in_the_prediction, system_genes }) => {
if (proteins_in_the_prediction.length === 2) { if (proteins_in_the_prediction.length === 2) {
const sanitizedSystemGenes = system_genes.map(d => d.split("__")[1]) const sanitizedSystemGenes = system_genes.map(getSeqName)
const sanitizedProteins = proteins_in_the_prediction.map(d => d.split("__")[1]) const sanitizedProteins = proteins_in_the_prediction.map(getSeqName)
const setProteins = new Set(sanitizedProteins) const setProteins = new Set(sanitizedProteins)
if (setProteins.size === 2) { if (setProteins.size === 2) {
return sanitizedProteins.map((prot, i) => { return sanitizedProteins.map((prot, i) => {
if (i === 0) { if (i === 0) {
return { System_name_ok, system_genes: sanitizedSystemGenes, pDockQ, pdb, nb_sys, proteins_in_the_prediction: sanitizedProteins, protX: prot, protY: sanitizedProteins[i + 1] } return { System_name_ok, system_genes: sanitizedSystemGenes, pDockQ, pdb, nb_sys, proteins_in_the_prediction: sanitizedProteins, protX: prot, protY: sanitizedProteins[i + 1] }
...@@ -108,7 +112,7 @@ const groupedPdocks = computed(() => { ...@@ -108,7 +112,7 @@ const groupedPdocks = computed(() => {
} else { } else {
throw createError(`More than 2 proteins in a dimer structure for system ${computedSystem.value} !`) throw createError(`More than 2 proteins in a dimer structure for system ${computedSystem.value} !`)
} }
}), d => d.system_genes.sort().join("--")) }), d => d.system_genes.sort().join(" / "))
} else { return [] } } else { return [] }
}) })
......
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