Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Molstar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
6ae53728
Commit
6ae53728
authored
6 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
ply spec
parent
88cf0cc6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mol-io/reader/_spec/mol2.spec.ts
+15
-15
15 additions, 15 deletions
src/mol-io/reader/_spec/mol2.spec.ts
src/mol-io/reader/_spec/ply.spec.ts
+79
-5
79 additions, 5 deletions
src/mol-io/reader/_spec/ply.spec.ts
src/mol-io/reader/cif/data-model.ts
+1
-2
1 addition, 2 deletions
src/mol-io/reader/cif/data-model.ts
with
95 additions
and
22 deletions
src/mol-io/reader/_spec/mol2.spec.ts
+
15
−
15
View file @
6ae53728
...
@@ -265,10 +265,10 @@ describe('mol2 reader', () => {
...
@@ -265,10 +265,10 @@ describe('mol2 reader', () => {
expect
(
molecule
.
num_subst
).
toBe
(
0
);
expect
(
molecule
.
num_subst
).
toBe
(
0
);
expect
(
molecule
.
num_feat
).
toBe
(
0
);
expect
(
molecule
.
num_feat
).
toBe
(
0
);
expect
(
molecule
.
num_sets
).
toBe
(
0
);
expect
(
molecule
.
num_sets
).
toBe
(
0
);
expect
(
molecule
.
mol_type
).
toBe
(
"
SMALL
"
)
expect
(
molecule
.
mol_type
).
toBe
(
'
SMALL
'
)
expect
(
molecule
.
charge_type
).
toBe
(
"
GASTEIGER
"
);
expect
(
molecule
.
charge_type
).
toBe
(
'
GASTEIGER
'
);
expect
(
molecule
.
status_bits
).
toBe
(
""
);
expect
(
molecule
.
status_bits
).
toBe
(
''
);
expect
(
molecule
.
mol_comment
).
toBe
(
""
);
expect
(
molecule
.
mol_comment
).
toBe
(
''
);
// required atom fields
// required atom fields
expect
(
atoms
.
count
).
toBe
(
26
);
expect
(
atoms
.
count
).
toBe
(
26
);
...
@@ -277,7 +277,7 @@ describe('mol2 reader', () => {
...
@@ -277,7 +277,7 @@ describe('mol2 reader', () => {
expect
(
atoms
.
x
.
value
(
0
)).
toBeCloseTo
(
1.7394
,
0.001
);
expect
(
atoms
.
x
.
value
(
0
)).
toBeCloseTo
(
1.7394
,
0.001
);
expect
(
atoms
.
y
.
value
(
0
)).
toBeCloseTo
(
-
2.1169
,
0.0001
);
expect
(
atoms
.
y
.
value
(
0
)).
toBeCloseTo
(
-
2.1169
,
0.0001
);
expect
(
atoms
.
z
.
value
(
0
)).
toBeCloseTo
(
-
1.0893
,
0.0001
);
expect
(
atoms
.
z
.
value
(
0
)).
toBeCloseTo
(
-
1.0893
,
0.0001
);
expect
(
atoms
.
atom_type
.
value
(
0
)).
toBe
(
"
O.3
"
);
expect
(
atoms
.
atom_type
.
value
(
0
)).
toBe
(
'
O.3
'
);
// optional atom fields
// optional atom fields
expect
(
atoms
.
subst_id
.
value
(
0
)).
toBe
(
1
);
expect
(
atoms
.
subst_id
.
value
(
0
)).
toBe
(
1
);
...
@@ -316,10 +316,10 @@ describe('mol2 reader', () => {
...
@@ -316,10 +316,10 @@ describe('mol2 reader', () => {
expect
(
molecule
.
num_subst
).
toBe
(
0
);
expect
(
molecule
.
num_subst
).
toBe
(
0
);
expect
(
molecule
.
num_feat
).
toBe
(
0
);
expect
(
molecule
.
num_feat
).
toBe
(
0
);
expect
(
molecule
.
num_sets
).
toBe
(
0
);
expect
(
molecule
.
num_sets
).
toBe
(
0
);
expect
(
molecule
.
mol_type
).
toBe
(
"
SMALL
"
)
expect
(
molecule
.
mol_type
).
toBe
(
'
SMALL
'
)
expect
(
molecule
.
charge_type
).
toBe
(
"
GASTEIGER
"
);
expect
(
molecule
.
charge_type
).
toBe
(
'
GASTEIGER
'
);
expect
(
molecule
.
status_bits
).
toBe
(
""
);
expect
(
molecule
.
status_bits
).
toBe
(
''
);
expect
(
molecule
.
mol_comment
).
toBe
(
""
);
expect
(
molecule
.
mol_comment
).
toBe
(
''
);
// required atom fields
// required atom fields
expect
(
atoms
.
count
).
toBe
(
26
);
expect
(
atoms
.
count
).
toBe
(
26
);
...
@@ -328,7 +328,7 @@ describe('mol2 reader', () => {
...
@@ -328,7 +328,7 @@ describe('mol2 reader', () => {
expect
(
atoms
.
x
.
value
(
0
)).
toBeCloseTo
(
1.7394
,
0.001
);
expect
(
atoms
.
x
.
value
(
0
)).
toBeCloseTo
(
1.7394
,
0.001
);
expect
(
atoms
.
y
.
value
(
0
)).
toBeCloseTo
(
-
2.1169
,
0.0001
);
expect
(
atoms
.
y
.
value
(
0
)).
toBeCloseTo
(
-
2.1169
,
0.0001
);
expect
(
atoms
.
z
.
value
(
0
)).
toBeCloseTo
(
-
1.0893
,
0.0001
);
expect
(
atoms
.
z
.
value
(
0
)).
toBeCloseTo
(
-
1.0893
,
0.0001
);
expect
(
atoms
.
atom_type
.
value
(
0
)).
toBe
(
"
O.3
"
);
expect
(
atoms
.
atom_type
.
value
(
0
)).
toBe
(
'
O.3
'
);
// optional atom fields
// optional atom fields
expect
(
atoms
.
subst_id
.
value
(
0
)).
toBe
(
1
);
expect
(
atoms
.
subst_id
.
value
(
0
)).
toBe
(
1
);
...
@@ -367,10 +367,10 @@ describe('mol2 reader', () => {
...
@@ -367,10 +367,10 @@ describe('mol2 reader', () => {
expect
(
molecule
.
num_subst
).
toBe
(
0
);
expect
(
molecule
.
num_subst
).
toBe
(
0
);
expect
(
molecule
.
num_feat
).
toBe
(
0
);
expect
(
molecule
.
num_feat
).
toBe
(
0
);
expect
(
molecule
.
num_sets
).
toBe
(
0
);
expect
(
molecule
.
num_sets
).
toBe
(
0
);
expect
(
molecule
.
mol_type
).
toBe
(
"
SMALL
"
)
expect
(
molecule
.
mol_type
).
toBe
(
'
SMALL
'
)
expect
(
molecule
.
charge_type
).
toBe
(
"
GASTEIGER
"
);
expect
(
molecule
.
charge_type
).
toBe
(
'
GASTEIGER
'
);
expect
(
molecule
.
status_bits
).
toBe
(
""
);
expect
(
molecule
.
status_bits
).
toBe
(
''
);
expect
(
molecule
.
mol_comment
).
toBe
(
""
);
expect
(
molecule
.
mol_comment
).
toBe
(
''
);
// required atom fields
// required atom fields
expect
(
atoms
.
count
).
toBe
(
26
);
expect
(
atoms
.
count
).
toBe
(
26
);
...
@@ -379,7 +379,7 @@ describe('mol2 reader', () => {
...
@@ -379,7 +379,7 @@ describe('mol2 reader', () => {
expect
(
atoms
.
x
.
value
(
0
)).
toBeCloseTo
(
1.7394
,
0.001
);
expect
(
atoms
.
x
.
value
(
0
)).
toBeCloseTo
(
1.7394
,
0.001
);
expect
(
atoms
.
y
.
value
(
0
)).
toBeCloseTo
(
-
2.1169
,
0.0001
);
expect
(
atoms
.
y
.
value
(
0
)).
toBeCloseTo
(
-
2.1169
,
0.0001
);
expect
(
atoms
.
z
.
value
(
0
)).
toBeCloseTo
(
-
1.0893
,
0.0001
);
expect
(
atoms
.
z
.
value
(
0
)).
toBeCloseTo
(
-
1.0893
,
0.0001
);
expect
(
atoms
.
atom_type
.
value
(
0
)).
toBe
(
"
O.3
"
);
expect
(
atoms
.
atom_type
.
value
(
0
)).
toBe
(
'
O.3
'
);
// optional atom fields
// optional atom fields
expect
(
atoms
.
subst_id
.
value
(
0
)).
toBe
(
0
);
expect
(
atoms
.
subst_id
.
value
(
0
)).
toBe
(
0
);
...
...
This diff is collapsed.
Click to expand it.
src/mol-io/reader/_spec/ply.spec.ts
+
79
−
5
View file @
6ae53728
...
@@ -56,6 +56,60 @@ end_header
...
@@ -56,6 +56,60 @@ end_header
3 3 5 4
3 3 5 4
`
`
const
plyCubeString
=
`ply
format ascii 1.0
comment test cube
element vertex 24
property float32 x
property float32 y
property float32 z
property uint32 material_index
element face 6
property list uint8 int32 vertex_indices
element material 6
property uint8 red
property uint8 green
property uint8 blue
end_header
-1 -1 -1 0
1 -1 -1 0
1 1 -1 0
-1 1 -1 0
1 -1 1 1
-1 -1 1 1
-1 1 1 1
1 1 1 1
1 1 1 2
1 1 -1 2
1 -1 -1 2
1 -1 1 2
-1 1 -1 3
-1 1 1 3
-1 -1 1 3
-1 -1 -1 3
-1 1 1 4
-1 1 -1 4
1 1 -1 4
1 1 1 4
1 -1 1 5
1 -1 -1 5
-1 -1 -1 5
-1 -1 1 5
4 0 1 2 3
4 4 5 6 7
4 8 9 10 11
4 12 13 14 15
4 16 17 18 19
4 20 21 22 23
255 0 0
0 255 0
0 0 255
255 255 0
0 255 255
255 0 255
`
describe
(
'
ply reader
'
,
()
=>
{
describe
(
'
ply reader
'
,
()
=>
{
it
(
'
basic
'
,
async
()
=>
{
it
(
'
basic
'
,
async
()
=>
{
const
parsed
=
await
Ply
(
plyString
).
run
();
const
parsed
=
await
Ply
(
plyString
).
run
();
...
@@ -66,13 +120,33 @@ describe('ply reader', () => {
...
@@ -66,13 +120,33 @@ describe('ply reader', () => {
if
(
!
vertex
)
return
if
(
!
vertex
)
return
const
x
=
vertex
.
getProperty
(
'
x
'
)
const
x
=
vertex
.
getProperty
(
'
x
'
)
if
(
!
x
)
return
if
(
!
x
)
return
console
.
log
(
'
x
'
,
x
.
toArray
())
expect
(
x
.
value
(
0
)).
toEqual
(
130.901
)
const
face
=
plyFile
.
getElement
(
'
face
'
)
as
PlyList
if
(
!
face
)
return
expect
(
face
.
value
(
0
)).
toEqual
({
count
:
3
,
entries
:
[
0
,
2
,
1
]})
expect
(
face
.
value
(
1
)).
toEqual
({
count
:
3
,
entries
:
[
3
,
5
,
4
]})
expect
.
assertions
(
3
)
});
it
(
'
material
'
,
async
()
=>
{
const
parsed
=
await
Ply
(
plyCubeString
).
run
();
if
(
parsed
.
isError
)
return
;
const
plyFile
=
parsed
.
result
;
const
vertex
=
plyFile
.
getElement
(
'
vertex
'
)
as
PlyTable
if
(
!
vertex
)
return
expect
(
vertex
.
rowCount
).
toBe
(
24
)
const
face
=
plyFile
.
getElement
(
'
face
'
)
as
PlyList
const
face
=
plyFile
.
getElement
(
'
face
'
)
as
PlyList
if
(
!
face
)
return
if
(
!
face
)
return
const
f0
=
face
.
value
(
0
)
expect
(
face
.
rowCount
).
toBe
(
6
)
console
.
log
(
'
f0
'
,
f0
)
const
f1
=
face
.
value
(
1
)
const
material
=
plyFile
.
getElement
(
'
face
'
)
as
PlyTable
console
.
log
(
'
f1
'
,
f1
)
if
(
!
material
)
return
expect
(
face
.
rowCount
).
toBe
(
6
)
expect
.
assertions
(
3
)
});
});
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-io/reader/cif/data-model.ts
+
1
−
2
View file @
6ae53728
...
@@ -220,7 +220,6 @@ export namespace CifField {
...
@@ -220,7 +220,6 @@ export namespace CifField {
throw
new
Error
(
'
unsupported
'
)
throw
new
Error
(
'
unsupported
'
)
}
}
return
{
return
{
__array
:
void
0
,
__array
:
void
0
,
binaryEncoding
:
void
0
,
binaryEncoding
:
void
0
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment