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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michal Malý
Molstar
Commits
8891fa32
Commit
8891fa32
authored
3 years ago
by
dsehnal
Browse files
Options
Downloads
Patches
Plain Diff
cif2bcif BCIF => CIF conversion support
parent
a23c06c4
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
README.md
+6
-1
6 additions, 1 deletion
README.md
src/cli/cif2bcif/converter.ts
+1
-1
1 addition, 1 deletion
src/cli/cif2bcif/converter.ts
src/cli/cif2bcif/index.ts
+4
-4
4 additions, 4 deletions
src/cli/cif2bcif/index.ts
with
15 additions
and
6 deletions
CHANGELOG.md
+
4
−
0
View file @
8891fa32
...
@@ -6,7 +6,11 @@ Note that since we don't clearly distinguish between a public and private interf
...
@@ -6,7 +6,11 @@ Note that since we don't clearly distinguish between a public and private interf
## [Unreleased]
## [Unreleased]
## [v3.5.0] - 2022-03-25
-
Fix issues with bounding-sphere & color-smoothing (mostly for small geometries)
-
Fix issues with bounding-sphere & color-smoothing (mostly for small geometries)
-
Support BCIF => CIF conversion in
``cif2bcif``
CLI tool
## [v3.4.0] - 2022-03-13
## [v3.4.0] - 2022-03-13
...
...
This diff is collapsed.
Click to expand it.
README.md
+
6
−
1
View file @
8891fa32
...
@@ -141,7 +141,7 @@ and navigate to `build/viewer`
...
@@ -141,7 +141,7 @@ and navigate to `build/viewer`
export NODE_PATH="lib"; node build/state-docs
export NODE_PATH="lib"; node build/state-docs
**Convert any CIF to BinaryCIF**
**Convert any CIF to BinaryCIF
(or vice versa)
**
node lib/commonjs/servers/model/preprocess -i file.cif -ob file.bcif
node lib/commonjs/servers/model/preprocess -i file.cif -ob file.bcif
...
@@ -151,6 +151,11 @@ Or
...
@@ -151,6 +151,11 @@ Or
node lib/commonjs/cli/cif2bcif
node lib/commonjs/cli/cif2bcif
E.g.
node lib/commonjs/cli/cif2bcif src.cif out.bcif.gz
node lib/commonjs/cli/cif2bcif src.bcif.gz out.cif
## Development
## Development
### Installation
### Installation
...
...
This diff is collapsed.
Click to expand it.
src/cli/cif2bcif/converter.ts
+
1
−
1
View file @
8891fa32
...
@@ -71,7 +71,7 @@ function classify(name: string, field: CifField): CifWriter.Field {
...
@@ -71,7 +71,7 @@ function classify(name: string, field: CifField): CifWriter.Field {
}
}
export
function
convert
(
path
:
string
,
asText
=
false
,
hints
?:
EncodingStrategyHint
[],
filter
?:
string
)
{
export
function
convert
(
path
:
string
,
asText
=
false
,
hints
?:
EncodingStrategyHint
[],
filter
?:
string
)
{
return
Task
.
create
<
Uint8Array
>
(
'
Binary
CIF
'
,
async
ctx
=>
{
return
Task
.
create
<
Uint8Array
>
(
'
Convert
CIF
'
,
async
ctx
=>
{
const
encodingProvider
:
BinaryEncodingProvider
=
hints
const
encodingProvider
:
BinaryEncodingProvider
=
hints
?
CifWriter
.
createEncodingProviderFromJsonConfig
(
hints
)
?
CifWriter
.
createEncodingProviderFromJsonConfig
(
hints
)
:
{
get
:
(
c
,
f
)
=>
void
0
};
:
{
get
:
(
c
,
f
)
=>
void
0
};
...
...
This diff is collapsed.
Click to expand it.
src/cli/cif2bcif/index.ts
+
4
−
4
View file @
8891fa32
...
@@ -18,7 +18,7 @@ async function process(srcPath: string, outPath: string, configPath?: string, fi
...
@@ -18,7 +18,7 @@ async function process(srcPath: string, outPath: string, configPath?: string, fi
const
config
=
configPath
?
JSON
.
parse
(
fs
.
readFileSync
(
configPath
,
'
utf8
'
))
:
void
0
;
const
config
=
configPath
?
JSON
.
parse
(
fs
.
readFileSync
(
configPath
,
'
utf8
'
))
:
void
0
;
const
filter
=
filterPath
?
fs
.
readFileSync
(
filterPath
,
'
utf8
'
)
:
void
0
;
const
filter
=
filterPath
?
fs
.
readFileSync
(
filterPath
,
'
utf8
'
)
:
void
0
;
const
res
=
await
convert
(
srcPath
,
false
,
config
,
filter
);
const
res
=
await
convert
(
srcPath
,
srcPath
.
toLowerCase
().
indexOf
(
'
.bcif
'
)
>
0
,
config
,
filter
);
await
write
(
outPath
,
res
);
await
write
(
outPath
,
res
);
}
}
...
@@ -38,13 +38,13 @@ function run(args: Args) {
...
@@ -38,13 +38,13 @@ function run(args: Args) {
const
parser
=
new
argparse
.
ArgumentParser
({
const
parser
=
new
argparse
.
ArgumentParser
({
add_help
:
true
,
add_help
:
true
,
description
:
'
Convert any CIF file to a
B
CIF file
'
description
:
'
Convert any
B
CIF file to a CIF file
or vice versa
'
});
});
parser
.
add_argument
(
'
src
'
,
{
parser
.
add_argument
(
'
src
'
,
{
help
:
'
Source
CIF
path
'
help
:
'
Source
file
path
'
});
});
parser
.
add_argument
(
'
out
'
,
{
parser
.
add_argument
(
'
out
'
,
{
help
:
'
Output
BCIF
path
'
help
:
'
Output
file
path
'
});
});
parser
.
add_argument
(
'
-c
'
,
'
--config
'
,
{
parser
.
add_argument
(
'
-c
'
,
'
--config
'
,
{
help
:
'
Optional encoding strategy/precision config path
'
,
help
:
'
Optional encoding strategy/precision config path
'
,
...
...
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