Skip to content

Commit

Permalink
Curate features identified by X community
Browse files Browse the repository at this point in the history
  • Loading branch information
liambai committed Nov 9, 2024
1 parent 7db66f5 commit 68a37eb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 4 deletions.
23 changes: 22 additions & 1 deletion viz/src/SAEConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export type CuratedFeature = {
name: string;
dim: number;
desc: string;
contributor?: string;
group?: string;
};

Expand All @@ -14,6 +15,11 @@ export type SAEConfig = {
supportsCustomSequence?: boolean;
};

export const CONTRIBUTORS: Record<string, string> = {
"Diego del Alamo": "https://x.com/ddelalamo",
"Daniel Saltzberg": "https://x.com/dargason",
};

export const SAE_CONFIGS: Record<string, SAEConfig> = {
"SAE4096-L24": {
baseUrl:
Expand All @@ -30,7 +36,22 @@ export const SAE_CONFIGS: Record<string, SAEConfig> = {
{
name: "WD40 middle loop",
dim: 4047,
desc: "This feature activates on the middle loop of WD40 repeat domains.",
desc: "This feature activates on the middle loop of WD40 repeat domains. It highlights every other disordered region at the tip of the propeller.",
group: "structural",
contributor: "Daniel Saltzberg",
},
{
name: "beta barrel",
dim: 4000,
desc: "This feature activates on transmembrane beta barrels. It highlights every other residue along each beta strand, weaving a criss-cross pattern. It activates on de novo designed proteins (PDB 6X1K, 6X9Z), and natural proteins (PDB 2MLH).",
contributor: "Diego del Alamo",
group: "structural",
},
{
name: "membrane exposed helices",
dim: 3732,
desc: "This feature activates on membrane-exposed helices, as well as on transmembrane beta barrels like those recognized by feature 4000.",
contributor: "Diego del Alamo",
group: "structural",
},
{
Expand Down
26 changes: 23 additions & 3 deletions viz/src/SAEVisualizerPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Navigate } from "react-router-dom";

import { SAEContext } from "./SAEContext";
import { NUM_SEQS_TO_DISPLAY } from "./config";
import { CONTRIBUTORS } from "./SAEConfigs";

const SAEVisualizerPage: React.FC = () => {
const { selectedFeature, selectedModel, SAEConfig } = useContext(SAEContext);
Expand All @@ -25,14 +26,33 @@ const SAEVisualizerPage: React.FC = () => {
if (selectedFeature === undefined) {
return <Navigate to={`/sae-viz/${selectedModel}`} />;
}
let desc = <>{dimToCuratedMap.get(selectedFeature)?.desc}</>;
const contributor = dimToCuratedMap.get(selectedFeature)?.contributor;
if (contributor && contributor in CONTRIBUTORS) {
desc = (
<div className="flex flex-col gap-2">
<p>{dimToCuratedMap.get(selectedFeature)?.desc}</p>
<p>
This feature was identified by{" "}
<a
href={CONTRIBUTORS[contributor]}
className="underline"
target="_blank"
rel="noopener noreferrer"
>
{contributor}
</a>
.
</p>
</div>
);
}

return (
<>
<main className="text-left max-w-full overflow-x-auto">
<h1 className="text-3xl font-semibold md:mt-0 mt-16">Feature {selectedFeature}</h1>
{dimToCuratedMap.has(selectedFeature) && (
<p className="mt-3">{dimToCuratedMap.get(selectedFeature)?.desc}</p>
)}
{dimToCuratedMap.has(selectedFeature) && <p className="mt-3">{desc}</p>}
{SAEConfig?.supportsCustomSequence && <CustomSeqPlayground feature={selectedFeature} />}
<h2 className="text-2xl font-semibold mt-8">Top activating sequences</h2>
<div className="p-4 mt-5 border-2 border-gray-200 border-dashed rounded-lg">
Expand Down

0 comments on commit 68a37eb

Please sign in to comment.