Skip to content

Commit

Permalink
Enable structure even when custom sequence doesn't activate; add desc…
Browse files Browse the repository at this point in the history
…riptions
  • Loading branch information
liambai committed Nov 2, 2024
1 parent 7cbd8dc commit 0da75d7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
21 changes: 13 additions & 8 deletions viz/src/SAEConfigs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,30 @@ export const SAE_CONFIGS: Record<string, SAEConfig> = {
plmLayer: 24,
curated: [
{
name: "free alpha helices",
name: "free alpha helix alternating",
dim: 2293,
desc: "Activates on every 4th or 8th amino acid in free alpha helices",
desc: "This feature activates on interspersed amino acids in alpha helices that tend to be isolated from other structures. It seems to fire strongly in every other turn of the helix (and weakly on the other turns).",
},
{
name: "beta strand channel",
dim: 3883,
desc: "This feature activates on channel-like structures consisting of beta strands. It fires only on a subset of beta strands consisting of the channel and fires more strongly one side of the channel.",
},
{
name: "hugging helices",
dim: 3348,
desc: "Activates on the interfacing residues of bunched-together alpha helices. It does seem to understand the geometric orientation of the helices because it fires on 2 adjacent amino acids when the orientation is such that both those amino acids are facing the opposing helix.",
},
{
name: "long helix interspersed",
dim: 214,
desc: "Activates on interspersed residues in long helices, in the pattern 100100010010001...",
desc: "Activates on interspersed amino acids in long helices in the pattern 100100010010001..., which corresponds to every turn.",
},
{
name: "alpha helix turn",
dim: 56,
desc: "Activates on the turn between two alpha helices in ABC transporter proteins",
},
{
name: "hugging helices",
dim: 3348,
desc: "Activates on the interfacing residues of bunched-together alpha helices",
},
{
name: "single beta strand",
dim: 1299,
Expand Down
8 changes: 6 additions & 2 deletions viz/src/components/CustomSeqPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,17 @@ const CustomSeqPlayground = ({ feature }: CustomSeqPlaygroundProps) => {
}}
/>
</div>
{customSeqActivations.every((act) => act === 0) && (
<p className="text-sm mb-2">
This feature did not activate on your sequence. Try a sequence more similar to the
ones below.
</p>
)}
<CustomStructureViewer
viewerId="custom-viewer"
seq={submittedSeqRef.current}
activations={customSeqActivations}
onLoad={onStructureLoad}
requireActivations={true}
/>
</>
)}
Expand Down Expand Up @@ -283,7 +288,6 @@ const CustomSeqPlayground = ({ feature }: CustomSeqPlaygroundProps) => {
seq={steeredSeq}
activations={steeredActivations}
onLoad={onStructureLoad}
requireActivations={false}
/>
</>
)}
Expand Down
11 changes: 1 addition & 10 deletions viz/src/components/CustomStructureViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ interface CustomStructureViewerProps {
seq: string;
activations: number[];
onLoad?: () => void;
requireActivations?: boolean;
}

const CustomStructureViewer = ({
viewerId,
seq,
activations,
onLoad,
requireActivations = true,
}: CustomStructureViewerProps) => {
const [isLoading, setIsLoading] = useState(false);
const [message, setMessage] = useState("");
Expand Down Expand Up @@ -177,13 +175,6 @@ const CustomStructureViewer = ({
onLoad?.();
return;
}
if (requireActivations && activations.every((act) => act === 0)) {
setError(
"This feature did not activate on your sequence. Try a sequence more similar to ones below."
);
onLoad?.();
return;
}
renderStructure().finally(() => {
setIsLoading(false);
onLoad?.();
Expand All @@ -195,7 +186,7 @@ const CustomStructureViewer = ({
pluginRef.current = null;
}
};
}, [seq, activations, onLoad, viewerId, requireActivations]);
}, [seq, activations, onLoad, viewerId]);

if (!seq || activations.length === 0) return null;
if (isLoading) {
Expand Down

0 comments on commit 0da75d7

Please sign in to comment.