Skip to content

Commit

Permalink
add tests for PDBQT
Browse files Browse the repository at this point in the history
  • Loading branch information
papillot committed Jan 8, 2023
1 parent c111f7f commit e68185b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/data/1xdn_gln.pdbqt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ATOM 1 N GLN 52 42.237 16.800 35.823 1.00 0.00 -0.066 N
ATOM 2 CA GLN 52 41.667 17.015 34.477 1.00 0.00 0.275 C
ATOM 3 C GLN 52 40.148 17.010 34.446 1.00 0.00 0.249 C
ATOM 4 O GLN 52 39.564 17.006 33.382 1.00 0.00 -0.271 OA
ATOM 5 CB GLN 52 42.228 15.967 33.522 1.00 0.00 0.052 C
ATOM 6 CG GLN 52 43.746 16.016 33.446 1.00 0.00 0.105 C
ATOM 7 CD GLN 52 44.292 17.263 32.785 1.00 0.00 0.215 C
ATOM 8 OE1 GLN 52 43.587 17.906 32.000 1.00 0.00 -0.274 OA
ATOM 9 NE2 GLN 52 45.513 17.598 33.072 1.00 0.00 -0.370 N
ATOM 10 H2 GLN 52 41.772 15.848 36.146 1.00 0.00 0.275 HD
ATOM 11 H3 GLN 52 43.141 16.691 35.848 1.00 0.00 0.275 HD
ATOM 12 H GLN 52 41.923 17.526 36.434 1.00 0.00 0.275 HD
ATOM 13 2HE2 GLN 52 46.044 17.022 33.735 1.00 0.00 0.159 HD
ATOM 14 1HE2 GLN 52 45.958 18.423 32.653 1.00 0.00 0.159 HD
TER 15 GLN 52
26 changes: 26 additions & 0 deletions test/parser/tests-pdbqt-parser.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import StringStreamer from '../../src/streamer/string-streamer'
import PdbqtParser from '../../src/parser/pdbqt-parser'
import { Structure } from '../../src/ngl'


import { join } from 'path'
import * as fs from 'fs'


describe('parser/pdb-parser', function () {
describe('parsing', function () {
it('translates PDBQT special atom types to elements', function() {
const file = join(__dirname, '/../data/1xdn_gln.pdbqt')
const str = fs.readFileSync(file, 'utf-8')
const streamer = new StringStreamer(str)
const pdbqtParser = new PdbqtParser(streamer)
return pdbqtParser.parse().then(function (structure: Structure) {
const ap = structure.getAtomProxy()
ap.index = 3
expect(ap.element).toBe('O')
ap.index = 12
expect(ap.element).toBe('H')
})
})
})
})

0 comments on commit e68185b

Please sign in to comment.