Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/justinmc/parse-pdb
A small utility for parsing PDB files into useable JSON
https://github.com/justinmc/parse-pdb
json molecular-data molecule pdb
Last synced: 27 days ago
JSON representation
A small utility for parsing PDB files into useable JSON
- Host: GitHub
- URL: https://github.com/justinmc/parse-pdb
- Owner: justinmc
- License: mit
- Created: 2017-12-16T20:24:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-25T01:53:00.000Z (almost 2 years ago)
- Last Synced: 2024-09-26T20:47:59.659Z (about 1 month ago)
- Topics: json, molecular-data, molecule, pdb
- Language: JavaScript
- Size: 106 KB
- Stars: 9
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# parse-pdb
A simple utility for parsing PDB files into an easily useable JSON format that handles atoms, residues, and chains.See also [parse-pdb-rust](https://github.com/justinmc/parse-pdb-rust).
## Getting Started
npm install --save parse-pdb
```
const parsePdb = require('parse-pdb');
const { readFileSync } = require('fs');const pdbString = readFileSync('./3aid.pdb', 'utf8');
const parsed = parsePdb(pdbString);
console.log(parsed.atoms);
/*
[ { serial: 1,
name: 'N',
altLoc: '',
resName: 'PRO',
chainID: 'A',
resSeq: 1,
iCode: '',
x: -2.555,
y: 9.253,
z: 34.411,
occupancy: 1,
tempFactor: 30.6,
element: 'N',
charge: '' },
...1845 others
]
*/
```## JSON Format
The output json is an object containing arrays of each structure keyed on record name, according to the [pdb spec](http://www.wwpdb.org/documentation/file-format-content/format33/sect9.html).```
atoms:
serial: integer
name: string
altLoc: string
resName: string
chainID: string
resSeq: integer
iCode: string
x: float
y: float
z: float
occupancy: float
tempFactor: float
element: string
charge: string
seqRes:
serNum: integer
chainID: string
numRes: integer
resNames: array of strings
residues:
id: integer (count)
serNum: integer
chainID: string
resName: string
atoms: array of atoms
chains: Map
key: chainID
value:
id: integer (count)
chainID: string
residues: array of residues
```## License
MIT. See LICENSE file.