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
9fe16e32
Commit
9fe16e32
authored
4 years ago
by
Alexander Rose
Browse files
Options
Downloads
Patches
Plain Diff
add script to generate martini lipid names
parent
697e9986
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+4
-0
4 additions, 0 deletions
README.md
src/cli/lipid-params/index.ts
+35
-6
35 additions, 6 deletions
src/cli/lipid-params/index.ts
src/mol-model/structure/model/types/lipids.ts
+9
-0
9 additions, 0 deletions
src/mol-model/structure/model/types/lipids.ts
with
48 additions
and
6 deletions
README.md
+
4
−
0
View file @
9fe16e32
...
@@ -95,6 +95,10 @@ and navigate to `build/viewer`
...
@@ -95,6 +95,10 @@ and navigate to `build/viewer`
node ./lib/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/bird.ts -p BIRD
node ./lib/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/bird.ts -p BIRD
node ./lib/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/cif-core.ts -p CifCore -aa
node ./lib/cli/cifschema -mip ../../../../mol-data -o src/mol-io/reader/cif/schema/cif-core.ts -p CifCore -aa
**Lipid names**
node .\lib\cli\lipid-params -o src\mol-model\structure\model\types\lipids.ts
**GraphQL schemas**
**GraphQL schemas**
./node_modules/.bin/graphql-codegen -c ./src/extensions/rcsb/graphql/codegen.yml
./node_modules/.bin/graphql-codegen -c ./src/extensions/rcsb/graphql/codegen.yml
...
...
This diff is collapsed.
Click to expand it.
src/cli/lipid-params/index.ts
+
35
−
6
View file @
9fe16e32
...
@@ -9,9 +9,9 @@ import * as argparse from 'argparse';
...
@@ -9,9 +9,9 @@ import * as argparse from 'argparse';
import
*
as
fs
from
'
fs
'
;
import
*
as
fs
from
'
fs
'
;
import
*
as
path
from
'
path
'
;
import
*
as
path
from
'
path
'
;
import
fetch
from
'
node-fetch
'
;
import
fetch
from
'
node-fetch
'
;
import
{
UniqueArray
}
from
'
../../mol-data/generic
'
;
const
BUILD_DIR
=
path
.
resolve
(
__dirname
,
'
../build/
'
);
const
LIPIDS_DIR
=
path
.
resolve
(
__dirname
,
'
../../../build/lipids/
'
);
const
LIPIDS_DIR
=
path
.
resolve
(
BUILD_DIR
,
'
lipids/
'
);
const
MARTINI_LIPIDS_PATH
=
path
.
resolve
(
LIPIDS_DIR
,
'
martini_lipids.itp
'
);
const
MARTINI_LIPIDS_PATH
=
path
.
resolve
(
LIPIDS_DIR
,
'
martini_lipids.itp
'
);
const
MARTINI_LIPIDS_URL
=
'
http://www.cgmartini.nl/images/parameters/lipids/Collections/martini_v2.0_lipids_all_201506.itp
'
;
const
MARTINI_LIPIDS_URL
=
'
http://www.cgmartini.nl/images/parameters/lipids/Collections/martini_v2.0_lipids_all_201506.itp
'
;
...
@@ -31,29 +31,58 @@ async function ensureAvailable(path: string, url: string) {
...
@@ -31,29 +31,58 @@ async function ensureAvailable(path: string, url: string) {
async
function
ensureLipidsAvailable
()
{
await
ensureAvailable
(
MARTINI_LIPIDS_PATH
,
MARTINI_LIPIDS_URL
);
}
async
function
ensureLipidsAvailable
()
{
await
ensureAvailable
(
MARTINI_LIPIDS_PATH
,
MARTINI_LIPIDS_URL
);
}
async
function
run
()
{
async
function
run
(
out
:
string
)
{
await
ensureLipidsAvailable
();
await
ensureLipidsAvailable
();
const
lipidsItpStr
=
fs
.
readFileSync
(
MARTINI_LIPIDS_PATH
,
'
utf8
'
);
const
lipidsItpStr
=
fs
.
readFileSync
(
MARTINI_LIPIDS_PATH
,
'
utf8
'
);
const
m
=
lipidsItpStr
.
match
(
/
\[
moleculetype
\]\n
; molname nrexcl
\n(
DGPC
)
/g
);
const
lipids
=
UniqueArray
.
create
<
string
>
();
console
.
log
(
m
);
const
reLipid
=
/
\[
moleculetype
\]\n
; molname nrexcl
\n
+
([
a-zA-Z
]{3,5})
/g
;
let
m
:
RegExpExecArray
|
null
;
while
((
m
=
reLipid
.
exec
(
lipidsItpStr
))
!==
null
)
{
const
v
=
m
[
0
].
substr
(
m
[
0
].
lastIndexOf
(
'
'
)
+
1
);
UniqueArray
.
add
(
lipids
,
v
,
v
);
}
const
lipidNames
=
JSON
.
stringify
(
lipids
.
array
);
if
(
out
)
{
const
output
=
`/**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* Code-generated lipid params file. Names extracted from Martini FF lipids itp.
*
* @author molstar/lipid-params cli
*/
export const LipidNames = new Set(
${
lipidNames
.
replace
(
/"/g
,
"
'
"
).
replace
(
/,/g
,
'
,
'
)}
);
`
;
fs
.
writeFileSync
(
out
,
output
);
}
else
{
console
.
log
(
lipidNames
);
}
}
}
const
parser
=
new
argparse
.
ArgumentParser
({
const
parser
=
new
argparse
.
ArgumentParser
({
addHelp
:
true
,
addHelp
:
true
,
description
:
'
Create lipid params (from martini lipids itp)
'
description
:
'
Create lipid params (from martini lipids itp)
'
});
});
parser
.
addArgument
([
'
--out
'
,
'
-o
'
],
{
help
:
'
Generated lipid params output path, if not given printed to stdout
'
});
parser
.
addArgument
([
'
--forceDownload
'
,
'
-f
'
],
{
parser
.
addArgument
([
'
--forceDownload
'
,
'
-f
'
],
{
action
:
'
storeTrue
'
,
action
:
'
storeTrue
'
,
help
:
'
Force download of martini lipids itp
'
help
:
'
Force download of martini lipids itp
'
});
});
interface
Args
{
interface
Args
{
out
:
string
forceDownload
:
boolean
forceDownload
:
boolean
}
}
const
args
:
Args
=
parser
.
parseArgs
();
const
args
:
Args
=
parser
.
parseArgs
();
const
FORCE_DOWNLOAD
=
args
.
forceDownload
;
const
FORCE_DOWNLOAD
=
args
.
forceDownload
;
run
().
catch
(
e
=>
{
run
(
args
.
out
||
''
).
catch
(
e
=>
{
console
.
error
(
e
);
console
.
error
(
e
);
});
});
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/mol-model/structure/model/types/lipids.ts
0 → 100644
+
9
−
0
View file @
9fe16e32
/**
* Copyright (c) 2020 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* Code-generated lipid params file. Names extracted from Martini FF lipids itp.
*
* @author molstar/lipid-params cli
*/
export
const
LipidNames
=
new
Set
([
'
DAPC
'
,
'
DBPC
'
,
'
DFPC
'
,
'
DGPC
'
,
'
DIPC
'
,
'
DLPC
'
,
'
DNPC
'
,
'
DOPC
'
,
'
DPPC
'
,
'
DRPC
'
,
'
DTPC
'
,
'
DVPC
'
,
'
DXPC
'
,
'
DYPC
'
,
'
LPPC
'
,
'
PAPC
'
,
'
PEPC
'
,
'
PGPC
'
,
'
PIPC
'
,
'
POPC
'
,
'
PRPC
'
,
'
PUPC
'
,
'
DAPE
'
,
'
DBPE
'
,
'
DFPE
'
,
'
DGPE
'
,
'
DIPE
'
,
'
DLPE
'
,
'
DNPE
'
,
'
DOPE
'
,
'
DPPE
'
,
'
DRPE
'
,
'
DTPE
'
,
'
DUPE
'
,
'
DVPE
'
,
'
DXPE
'
,
'
DYPE
'
,
'
LPPE
'
,
'
PAPE
'
,
'
PGPE
'
,
'
PIPE
'
,
'
POPE
'
,
'
PQPE
'
,
'
PRPE
'
,
'
PUPE
'
,
'
DAPS
'
,
'
DBPS
'
,
'
DFPS
'
,
'
DGPS
'
,
'
DIPS
'
,
'
DLPS
'
,
'
DNPS
'
,
'
DOPS
'
,
'
DPPS
'
,
'
DRPS
'
,
'
D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
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment