Skip to content

Commit bda2b36

Browse files
AmirMohammad CheraghaliAmirMohammad Cheraghali
authored andcommitted
fix: Replace final broken PDB ID (1H1F -> 5NL0) and add verification script
- Replaced 1H1F (failed download) with 5NL0 (Histone H1). - Added 'scripts/verify_library.js' to audit library integrity. - Verified that all 300 proteins now have valid local files.
1 parent c6c535c commit bda2b36

2 files changed

Lines changed: 49 additions & 1 deletion

File tree

scripts/verify_library.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
import fs from 'fs';
3+
import path from 'path';
4+
import { fileURLToPath } from 'url';
5+
6+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
7+
const LIBRARY_PATH = path.join(__dirname, '../src/data/library.ts');
8+
const MODELS_DIR = path.join(__dirname, '../public/models');
9+
10+
// Extract IDs from library.ts
11+
const content = fs.readFileSync(LIBRARY_PATH, 'utf-8');
12+
const idMatch = content.matchAll(/id:\s*'([a-zA-Z0-9]{4})'/g);
13+
const expectedIds = Array.from(idMatch).map(m => m[1]);
14+
15+
console.log(`Checking ${expectedIds.length} expected proteins...`);
16+
17+
const missing = [];
18+
const empty = [];
19+
20+
expectedIds.forEach(id => {
21+
const filePath = path.join(MODELS_DIR, `${id}.pdb`);
22+
23+
if (!fs.existsSync(filePath)) {
24+
missing.push(id);
25+
} else {
26+
const stats = fs.statSync(filePath);
27+
if (stats.size < 100) { // arbitrary small size for failed/empty file
28+
empty.push(id);
29+
}
30+
}
31+
});
32+
33+
console.log('--- REPORT ---');
34+
if (missing.length > 0) {
35+
console.log(`MISSING (${missing.length}):`, missing.join(', '));
36+
} else {
37+
console.log('No missing files.');
38+
}
39+
40+
if (empty.length > 0) {
41+
console.log(`EMPTY/CORRUPT (${empty.length}):`, empty.join(', '));
42+
} else {
43+
console.log('No empty files.');
44+
}
45+
46+
if (missing.length === 0 && empty.length === 0) {
47+
console.log('✅ ALL OK.');
48+
}

src/data/library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ export const OFFLINE_LIBRARY: LibraryEntry[] = [
345345
{ id: '1D4B', title: 'DNA Pol Beta', category: 'DNA/RNA', description: 'DNA repair.', details: 'The smallest eukaryotic DNA polymerase. It performs "base excision repair" to fix damaged DNA bases.' },
346346
{ id: '1TOS', title: 'Streptokinase', category: 'Enzymes', description: 'Clot activator.', details: 'A bacterial protein that activates human plasminogen. It is used medically to dissolve blood clots in heart attacks.' },
347347
{ id: '1KDM', title: 'Collagenase', category: 'Enzymes', description: 'Tissue remodeling.', details: 'Matrix Metalloproteinase 1 (MMP-1). It is one of the few enzymes capable of cutting the tough triple helix of collagen.' },
348-
{ id: '1H1F', title: 'Histone H1', category: 'DNA/RNA', description: 'Linker histone.', details: 'Unlike core histones, H1 sits on the outside of the nucleosome to seal the DNA wrap, helping condense chromatin into chromosomes.' },
348+
{ id: '5NL0', title: 'Histone H1', category: 'DNA/RNA', description: 'Linker histone.', details: 'Unlike core histones, H1 sits on the outside of the nucleosome to seal the DNA wrap, helping condense chromatin into chromosomes.' },
349349
{ id: '1DXT', title: 'Diphtheria Toxin', category: 'Toxins', description: 'Deadly inhibitor.', details: 'A potent toxin that shuts down protein synthesis in host cells by modifying Elongation Factor 2.' },
350350
{ id: '1JIJ', title: 'Luciferase', category: 'Enzymes', description: 'Bioluminescence.', details: 'The enzyme from fireflies that converts chemical energy (ATP) into visible light. Used as a reporter in biological assays.' },
351351
{ id: '5N2E', title: 'Cas13a', category: 'Enzymes', description: 'RNA targeting.', details: 'A CRISPR enzyme that targets RNA instead of DNA. It is used for precise RNA editing and diagnostic detection.' },

0 commit comments

Comments
 (0)