Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/(reference-data)/genomes/[ref]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function GenomeDetailPage(props: GenomeDetailProps) {
const genomeRef = decodeURIComponent(params.ref);

// Query for genome data - this would need to be implemented in the API
const { data: genomeData, isLoading, error } = useQuery({
const { isLoading, error } = useQuery({
queryKey: ['genome', genomeRef],
queryFn: async () => {
// Placeholder - would need actual API endpoint
Expand Down
4 changes: 3 additions & 1 deletion app/events/plantseed2015/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export default function PlantSEED2015Page() {

<Box textAlign="center" mb={4}>
<a href="http://press3.mcs.anl.gov/plantseed2015/files/2015/09/2015-Wkshp_participants.jpeg" target="_blank" rel="noopener noreferrer">
<img
<Image
src="http://press3.mcs.anl.gov/plantseed2015/files/2015/09/2015-Wkshp_participants.jpeg"
alt="2015 Workshop Group Photo"
width={800}
height={600}
style={{ maxWidth: '100%', height: 'auto', objectFit: 'contain' }}
Comment on lines 44 to 50
/>
</a>
Expand Down
4 changes: 3 additions & 1 deletion app/events/plantseed2016/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export default function PlantSEED2016Page() {

<Box textAlign="center" mb={4}>
<a href="http://bioseed.mcs.anl.gov/~seaver/Files/PlantSEED_Workshop_2016/PlantSEED_Workshop_2016.jpg" target="_blank" rel="noopener noreferrer">
<img
<Image
src="http://bioseed.mcs.anl.gov/~seaver/Files/PlantSEED_Workshop_2016/PlantSEED_Workshop_2016.jpg"
alt="2016 Workshop Group Photo"
width={800}
height={600}
style={{ maxWidth: '100%', height: 'auto', objectFit: 'contain' }}
Comment on lines 44 to 50
/>
</a>
Expand Down
4 changes: 3 additions & 1 deletion app/events/plantseed2017/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ export default function PlantSEED2017Page() {

<Box textAlign="center" mb={4}>
<a href="http://bioseed.mcs.anl.gov/~seaver/Files/PlantSEED_Workshop_2017/PlantSEED_Workshop_2017.png" target="_blank" rel="noopener noreferrer">
<img
<Image
src="http://bioseed.mcs.anl.gov/~seaver/Files/PlantSEED_Workshop_2017/PlantSEED_Workshop_2017.png"
alt="2017 Workshop Group Photo"
width={800}
height={600}
style={{ maxWidth: '100%', height: 'auto', objectFit: 'contain' }}
Comment on lines 44 to 50
/>
</a>
Expand Down
4 changes: 3 additions & 1 deletion app/events/plantseed2018/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ export default function PlantSEED2018Page() {

<Box textAlign="center" mb={4}>
<a href="http://bioseed.mcs.anl.gov/~seaver/Files/PlantSEED_Workshop_2018/PlantSEED_Workshop_2018_Participants.png" target="_blank" rel="noopener noreferrer">
<img
<Image
src="http://bioseed.mcs.anl.gov/~seaver/Files/PlantSEED_Workshop_2018/PlantSEED_Workshop_2018_Participants.png"
alt="2018 Workshop Group Photo"
width={800}
height={600}
style={{ maxWidth: '100%', height: 'auto', objectFit: 'contain' }}
/>
Comment on lines 55 to 63
</a>
Expand Down
2 changes: 1 addition & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Providers from '@/components/Providers';
import { AuthProvider } from '@/components/auth/AuthProvider';
import type { Metadata } from "next";
import "./globals.css";
import "@/styles/icomoon/style.css";

export const metadata: Metadata = {
title: "ModelSEED",
Expand All @@ -23,7 +24,6 @@ export default function RootLayout({
<html lang="en" suppressHydrationWarning>
<head>
<link rel="shortcut icon" href="/img/ModelSEED-favicon.png" />
<link rel="stylesheet" href="/icomoon/style.css" />
<link
href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet"
Expand Down
61 changes: 49 additions & 12 deletions app/model/[...path]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,20 @@ function toSearchableString(value: unknown): string {
return '';
}

function extractReactionIds(value: unknown): string[] {
const raw = toSearchableString(value);
if (!raw.trim()) return [];
const matches = raw.match(/rxn\d{5}/g) ?? [];
const seen = new Set<string>();
const ordered: string[] = [];
for (const match of matches) {
if (seen.has(match)) continue;
seen.add(match);
ordered.push(match);
}
return ordered;
}

function buildReactionRows(model: Record<string, unknown>): Record<string, unknown>[] {
return asArray<Record<string, unknown>>(model.modelreactions ?? model.reactions).map((reaction, index) => ({
id: String((reaction.id ?? extractRefId(reaction.reaction_ref)) || `rxn-${index}`),
Expand Down Expand Up @@ -185,6 +199,7 @@ function buildGeneRows(model: Record<string, unknown>): Record<string, unknown>[
return explicitGenes.map((gene, index) => ({
id: String((gene.id ?? extractRefId(gene.feature_ref)) || `gene-${index}`),
reactions: toSearchableString(gene.reactions ?? []),
reactionIds: extractReactionIds(gene.reactions ?? []),
functions: gene.functions ? toSearchableString(gene.functions) : 'N/A',
}));
}
Expand All @@ -211,6 +226,7 @@ function buildGeneRows(model: Record<string, unknown>): Record<string, unknown>[
return Array.from(geneToReactions.entries()).map(([gene, reactions]) => ({
id: gene,
reactions: Array.from(reactions).join(', '),
reactionIds: Array.from(reactions),
functions: 'View details',
}));
}
Expand Down Expand Up @@ -400,7 +416,36 @@ function buildTableConfig(model: Record<string, unknown>): Record<Exclude<TabKey
rows: buildGeneRows(model),
columns: [
{ field: 'id', headerName: 'Gene', width: 230 },
{ field: 'reactions', headerName: 'Reactions', flex: 1, minWidth: 260 },
{
field: 'reactions',
headerName: 'Reactions',
flex: 1,
minWidth: 320,
renderCell: (params) => {
const row = params.row as Record<string, unknown>;
const reactionIds = Array.isArray(row.reactionIds)
? (row.reactionIds as string[])
: extractReactionIds(params.value);
if (reactionIds.length === 0) {
return <Typography variant="body2" color="text.secondary">N/A</Typography>;
}
return (
<Stack direction="row" spacing={0.5} useFlexGap flexWrap="wrap" sx={{ py: 0.5 }}>
{reactionIds.map((rxnId) => (
<Chip
key={`${String(row.id ?? 'gene')}-${rxnId}`}
label={rxnId}
size="small"
component={Link}
clickable
href={`/biochem/reactions/${rxnId}`}
sx={{ color: '#00acc1' }}
/>
))}
</Stack>
);
},
},
{ field: 'functions', headerName: 'Functions', flex: 1, minWidth: 260 },
],
},
Expand Down Expand Up @@ -1711,7 +1756,8 @@ export default function ModelDetailPage({ params }: { params: Promise<{ path: st
modelName,
);

const genomeRef = String(modelObject.genome_ref ?? modelObject.genome_id ?? '-');
const genomeRefRaw = String(modelObject.genome_ref ?? modelObject.genome_id ?? '-');
const genomeRef = genomeRefRaw.replace(/\|\|+$/, '').trim() || '-';

const visibleTabs = MODEL_TABS.filter((tab) => !(isPlantModel && tab.key === 'edits'));
const activeTabVisible = visibleTabs.some((tab) => tab.key === activeTab);
Expand All @@ -1727,16 +1773,7 @@ export default function ModelDetailPage({ params }: { params: Promise<{ path: st
},
{
label: 'Genome Ref',
value: genomeRef !== '-' ? (
<Link
href={`https://www.bv-brc.org/view/Genome/${genomeRef}`}
target="_blank"
rel="noreferrer"
style={{ color: '#00acc1', textDecoration: 'none' }}
>
{genomeRef}
</Link>
) : '-',
value: genomeRef,
},
Comment on lines 1759 to 1777
{ label: 'Type', value: String(modelObject.type ?? '-') },
{
Expand Down
Loading
Loading