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
df6092c7
Commit
df6092c7
authored
6 years ago
by
David Sehnal
Browse files
Options
Downloads
Patches
Plain Diff
refactoring custom props
parent
43932093
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/mol-model-props/pdbe/structure-quality-report.ts
+4
-6
4 additions, 6 deletions
src/mol-model-props/pdbe/structure-quality-report.ts
src/servers/model/test.ts
+13
-6
13 additions, 6 deletions
src/servers/model/test.ts
with
17 additions
and
12 deletions
src/mol-model-props/pdbe/structure-quality-report.ts
+
4
−
6
View file @
df6092c7
...
...
@@ -33,7 +33,7 @@ export namespace StructureQualityReport {
id
:
Column
.
Schema
.
int
,
...
mmCIF_residueId_schema
,
pdbx_PDB_model_num
:
Column
.
Schema
.
int
,
issue_group_id
:
Column
.
Schema
.
int
issue_
type_
group_id
:
Column
.
Schema
.
int
},
pdbe_structure_quality_report_issue_types
:
{
group_id
:
Column
.
Schema
.
int
,
...
...
@@ -129,7 +129,7 @@ export namespace StructureQualityReport {
const
_structure_quality_report_issues_fields
=
CifWriter
.
fields
<
number
,
ReportExportContext
[
'
models
'
][
0
]
>
()
.
index
(
'
id
'
)
.
many
(
residueIdFields
((
i
,
d
)
=>
d
.
elements
[
i
],
{
includeModelNum
:
true
}))
.
int
(
'
group_id
'
,
(
i
,
d
)
=>
d
.
groupId
[
i
])
.
int
(
'
issue_type_
group_id
'
,
(
i
,
d
)
=>
d
.
groupId
[
i
])
.
getFields
();
interface
ReportExportContext
{
...
...
@@ -208,18 +208,16 @@ function createIssueMapFromCif(modelData: Model,
groupData
:
Table
<
typeof
StructureQualityReport
.
Schema
.
pdbe_structure_quality_report_issue_types
>
):
StructureQualityReport
.
IssueMap
|
undefined
{
const
ret
=
new
Map
<
ResidueIndex
,
string
[]
>
();
const
{
label_entity_id
,
label_asym_id
,
auth_seq_id
,
pdbx_PDB_ins_code
,
issue_group_id
,
pdbx_PDB_model_num
,
_rowCount
}
=
residueData
;
const
{
label_entity_id
,
label_asym_id
,
auth_seq_id
,
pdbx_PDB_ins_code
,
issue_
type_
group_id
,
pdbx_PDB_model_num
,
_rowCount
}
=
residueData
;
const
groups
=
parseIssueTypes
(
groupData
);
for
(
let
i
=
0
;
i
<
_rowCount
;
i
++
)
{
if
(
pdbx_PDB_model_num
.
value
(
i
)
!==
modelData
.
modelNum
)
continue
;
const
idx
=
modelData
.
atomicHierarchy
.
index
.
findResidue
(
label_entity_id
.
value
(
i
),
label_asym_id
.
value
(
i
),
auth_seq_id
.
value
(
i
),
pdbx_PDB_ins_code
.
value
(
i
));
ret
.
set
(
idx
,
groups
.
get
(
issue_group_id
.
value
(
i
))
!
);
ret
.
set
(
idx
,
groups
.
get
(
issue_
type_
group_id
.
value
(
i
))
!
);
}
console
.
log
(
ret
);
return
IndexedCustomProperty
.
fromResidueMap
(
ret
);
}
...
...
This diff is collapsed.
Click to expand it.
src/servers/model/test.ts
+
13
−
6
View file @
df6092c7
...
...
@@ -34,22 +34,28 @@ function wrapFile(fn: string) {
return
w
;
}
const
basePath
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
..
'
,
'
..
'
)
const
examplesPath
=
path
.
join
(
basePath
,
'
examples
'
)
const
outPath
=
path
.
join
(
basePath
,
'
build
'
,
'
test
'
)
export
const
basePath
=
path
.
join
(
__dirname
,
'
..
'
,
'
..
'
,
'
..
'
,
'
..
'
)
export
const
examplesPath
=
path
.
join
(
basePath
,
'
examples
'
)
export
const
outPath
=
path
.
join
(
basePath
,
'
build
'
,
'
test
'
)
if
(
!
fs
.
existsSync
(
outPath
))
fs
.
mkdirSync
(
outPath
);
async
function
run
()
{
try
{
// const testFile = '1crn.cif'
// const testFile = '1grm_updated.cif'
// const testFile = 'C:/Projects/mol-star/molstar-proto/build/test/in/1grm_updated.cif'
// const request = createJob({
// entryId: testFile,
// queryName: 'full',
// queryParams: { },
// });
const
testFile
=
'
1grm_updated.cif
'
//const testFile = 'C:/Projects/mol-star/molstar-proto/build/test/1grm_updated.cif'
const
request
=
createJob
({
entryId
:
path
.
join
(
examplesPath
,
testFile
),
queryName
:
'
full
'
,
queryParams
:
{
},
// options: { modelNums: [ 2, 3 ] }
queryParams
:
{
}
});
// const request = createJob({
// entryId: path.join(examplesPath, testFile),
// queryName: 'atoms',
...
...
@@ -67,6 +73,7 @@ async function run() {
// });
const
encoder
=
await
resolveJob
(
request
);
const
writer
=
wrapFile
(
path
.
join
(
outPath
,
testFile
));
// const writer = wrapFile(path.join(outPath, '1grm_test.cif'));
encoder
.
writeTo
(
writer
);
writer
.
end
();
}
catch
(
e
)
{
...
...
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