Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-pdb

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-pdb

A parser for the Protein Data Bank (PDB) molecule format

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

parse-pdb

A simple utility for parsing PDB files into an easily useable JSON format that handles atoms ,residues, and chains.

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.

  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.

Keywords

FAQs

Package last updated on 24 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc