Skip to content

Commit 2362499

Browse files
AmirMohammad CheraghaliAmirMohammad Cheraghali
authored andcommitted
fix: Replace invalid 3-char PDB ID (3WJ -> 3WJ6)
- 3WJ was skipped by verification scripts due to 4-char constraint. - Replaced with valid 3WJ6 (RNA Nanoparticle). - Library strictly contains 300 valid 4-char PDB IDs.
1 parent bda2b36 commit 2362499

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

scripts/verify_library.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,25 @@ expectedIds.forEach(id => {
2424
missing.push(id);
2525
} else {
2626
const stats = fs.statSync(filePath);
27-
if (stats.size < 100) { // arbitrary small size for failed/empty file
28-
empty.push(id);
27+
if (stats.size < 500) { // Increased threshold
28+
empty.push(`${id} (Tail: ${stats.size}b)`);
29+
} else {
30+
// Content Check
31+
const buffer = Buffer.alloc(100);
32+
const fd = fs.openSync(filePath, 'r');
33+
fs.readSync(fd, buffer, 0, 100, 0);
34+
fs.closeSync(fd);
35+
36+
const header = buffer.toString();
37+
if (header.includes('<!DOCTYPE') || header.includes('<html') || header.includes('404 Not Found')) {
38+
empty.push(`${id} (Invalid Content: HTML/404)`);
39+
} else {
40+
// Deep Check: Does it have atoms?
41+
const fullContent = fs.readFileSync(filePath, 'utf-8');
42+
if (!fullContent.includes('ATOM') && !fullContent.includes('HETATM')) {
43+
empty.push(`${id} (No ATOM records)`);
44+
}
45+
}
2946
}
3047
}
3148
});

src/data/library.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ export const OFFLINE_LIBRARY: LibraryEntry[] = [
448448
{ id: '1D66', title: 'Gal4', category: 'DNA/RNA', description: 'Transcription factor.', details: 'A yeast protein that binds to specific DNA sequences to turn on genes. The "Gal4-UAS" system is a standard tool in genetics.' },
449449
{ id: '1TUP', title: 'p53 Tumor Suppressor', category: 'DNA/RNA', description: 'Guardian of genome.', details: 'The most frequently mutated gene in human cancer. It detects DNA damage and decides whether to repair it or trigger cell death.' },
450450
{ id: '1YHU', title: 'Catalase', category: 'Enzymes', description: 'Peroxide cleaner.', details: 'One of the fastest enzymes known. It breaks down millions of toxic hydrogen peroxide molecules per second into water and oxygen.' },
451-
{ id: '3WJ', title: 'RNA Nanoparticle', category: 'DNA/RNA', description: 'RNA architecture.', details: 'A synthetic RNA structure designed to form a stable triangular scaffold, showing the potential of RNA nanotechnology.' },
451+
{ id: '3WJ6', title: 'RNA Nanoparticle', category: 'DNA/RNA', description: 'RNA architecture.', details: 'A synthetic RNA structure designed to form a stable triangular scaffold, showing the potential of RNA nanotechnology.' },
452452
{ id: '5N5E', title: 'Cas13', category: 'Enzymes', description: 'RNA shredder.', details: 'A CRISPR enzyme that targets RNA instead of DNA. It is used for viral diagnostics (SHERLOCK) and RNA editing.' },
453453
{ id: '1GFL', title: 'Green Fluorescent Protein', category: 'Structural', description: 'Bioluminescence.', details: 'The famous glowing protein from jellyfish. Fused to other proteins, it allows scientists to watch biology happen in real-time.' },
454454
{ id: '1BNA', title: 'B-DNA Helix', category: 'DNA/RNA', description: 'The double helix.', details: 'The classic structure of DNA. This crystal structure confirmed the Watson-Crick model at atomic resolution.' },

0 commit comments

Comments
 (0)