diff --git a/components/content/PdockqMatrix.vue b/components/content/PdockqMatrix.vue index aa22e4f0cb8fb9c29bb7413ea42c5642fefa40a4..045526907551078c966ab917855a76f80c9f6f86 100644 --- a/components/content/PdockqMatrix.vue +++ b/components/content/PdockqMatrix.vue @@ -17,7 +17,7 @@ const { mobile } = useDisplay(); const { page } = useContent(); const dbName = "structure" const filterBase = ref<string[]>([ - "prediction_type='multimer(dimer)'", + "prediction_type='multimer(dimer)' OR prediction_type='multimer(homodimer)'", "completed='true'" ]) const structureTitle = ref("Structure") @@ -77,15 +77,9 @@ function extractGeneName(name: string) { const groupedPdocks = computed(() => { const toValData = toValue(data) - // const getSeqName = (d) => { - // if (d.includes("__")) { - // return d.split("__")[1] - // } else { - // return d - // } - // } if (toValData?.hits) { - return d3.groups(toValData.hits.flatMap(({ system, pDockQ, pdb, nb_sys, proteins_in_the_prediction, system_genes }) => { + + const flattenMap = toValData.hits.flatMap(({ system, pDockQ, pdb, nb_sys, proteins_in_the_prediction, system_genes }) => { if (proteins_in_the_prediction.length === 2) { const sanitizedSystemGenes = system_genes.map(extractGeneName) const sanitizedProteins = proteins_in_the_prediction.map(extractGeneName) @@ -102,12 +96,14 @@ const groupedPdocks = computed(() => { }) } else { - return { key, system, system_genes: sanitizedSystemGenes, pDockQ, pdb, nb_sys, proteins_in_the_prediction: sanitizedProteins, protX: sanitizedProteins[0], protY: sanitizedProteins[1] } + return [{ key, system, system_genes: sanitizedSystemGenes, pDockQ, pdb, nb_sys, proteins_in_the_prediction: sanitizedProteins, protX: sanitizedProteins[0], protY: sanitizedProteins[1] }] } } else { throw createError(`More than 2 proteins in a dimer structure for system ${computedSystem.value} !`) } - }), d => d.system_genes.sort().join(" / ")) + }) + const groups = d3.groups(flattenMap, d => d.system_genes.sort().join(" / ")) + return groups } else { return [] } })