Skip to content

Commit

Permalink
feat: show legend
Browse files Browse the repository at this point in the history
  • Loading branch information
xnought committed Apr 18, 2024
1 parent d735b28 commit c099aa2
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
3 changes: 2 additions & 1 deletion frontend/src/lib/venomeMolstarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ export function colorResidues({
return selections;
}

const alphafoldColorscheme = [
export const alphafoldThresholds = ["> 90", "> 70", "> 50", "< 50"];
export const alphafoldColorscheme = [
"rgb(1,83,214)", // > 90
"rgb(100,203,243)", // > 70
"rgb(255,219,18)", // > 50
Expand Down
28 changes: 27 additions & 1 deletion frontend/src/routes/Protein.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@
import DelayedSpinner from "../lib/DelayedSpinner.svelte";
import { user } from "../lib/stores/user";
import { AccordionItem, Accordion } from "flowbite-svelte";
import { pLDDTToAlphaFoldResidueColors } from "../lib/venomeMolstarUtils";
import {
pLDDTToAlphaFoldResidueColors,
alphafoldColorscheme,
alphafoldThresholds,
} from "../lib/venomeMolstarUtils";
import type { ChainColors } from "../lib/venomeMolstarUtils";
const fileDownloadDropdown = ["pdb", "fasta"];
Expand Down Expand Up @@ -189,6 +193,16 @@
>
Color by pLDDT</Button
>
{#if Object.keys(chainColors).length > 0}
{#each alphafoldThresholds as at, i}
<div
class="legend-chip"
style="--color: {alphafoldColorscheme[i]};"
>
{at}
</div>
{/each}
{/if}
</div>
</EntryCard>
</div>
Expand All @@ -215,4 +229,16 @@
font-weight: 500;
color: var(--primary-700);
}
.legend-chip {
--color: black;
color: rgb(0, 0, 0);
background-color: var(--color);
border-radius: 3px;
font-size: 12px;
padding-left: 5px;
padding-right: 5px;
padding-top: 2px;
padding-bottom: 2px;
}
</style>

0 comments on commit c099aa2

Please sign in to comment.