Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Wiki
Manage
Activity
Members
Labels
Plan
Issues
53
Issue boards
Milestones
Wiki
Code
Merge requests
6
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MDM Lab
Wiki
Commits
38d5c8cb
Commit
38d5c8cb
authored
1 year ago
by
Remi PLANEL
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Wrong pfam format
parent
3861d26c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#120015
passed with stages
in 9 minutes and 35 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
data/list-systems.json
+4056
-235
4056 additions, 235 deletions
data/list-systems.json
packages/df-wiki-cli/df_wiki_cli/content/main.py
+9
-8
9 additions, 8 deletions
packages/df-wiki-cli/df_wiki_cli/content/main.py
with
4065 additions
and
243 deletions
data/list-systems.json
+
4056
−
235
View file @
38d5c8cb
source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
packages/df-wiki-cli/df_wiki_cli/content/main.py
+
9
−
8
View file @
38d5c8cb
...
@@ -178,7 +178,7 @@ def systems(
...
@@ -178,7 +178,7 @@ def systems(
with
open
(
pfam
,
"
r
"
)
as
pf
:
with
open
(
pfam
,
"
r
"
)
as
pf
:
pfam_df
=
pd
.
read_csv
(
pf
,
index_col
=
"
AC
"
,
keep_default_na
=
False
)
pfam_df
=
pd
.
read_csv
(
pf
,
index_col
=
"
AC
"
,
keep_default_na
=
False
)
systems
=
[]
systems
=
[]
if
(
output
.
exists
()
)
:
if
output
.
exists
():
output
.
unlink
()
output
.
unlink
()
with
open
(
output
,
"
a
"
)
as
ty
:
with
open
(
output
,
"
a
"
)
as
ty
:
for
file
in
dir
.
iterdir
():
for
file
in
dir
.
iterdir
():
...
@@ -188,8 +188,8 @@ def systems(
...
@@ -188,8 +188,8 @@ def systems(
metadata
,
_
=
frontmatter
.
parse
(
f
.
read
())
metadata
,
_
=
frontmatter
.
parse
(
f
.
read
())
del
metadata
[
"
layout
"
]
del
metadata
[
"
layout
"
]
sanitizedMetadata
=
{
**
metadata
}
sanitizedMetadata
=
{
**
metadata
}
if
"
tableColumns
"
in
m
etadata
:
if
"
tableColumns
"
in
sanitizedM
etadata
:
table_data
=
m
etadata
[
"
tableColumns
"
]
table_data
=
sanitizedM
etadata
[
"
tableColumns
"
]
if
"
PFAM
"
in
table_data
:
if
"
PFAM
"
in
table_data
:
pfams_list
=
[
pfams_list
=
[
pfam
.
strip
()
pfam
.
strip
()
...
@@ -204,7 +204,6 @@ def systems(
...
@@ -204,7 +204,6 @@ def systems(
pfam_to_dict
[
pfam
][
"
AC
"
]
=
pfam
pfam_to_dict
[
pfam
][
"
AC
"
]
=
pfam
flatten_value
=
pfam_to_dict
[
pfam
]
flatten_value
=
pfam_to_dict
[
pfam
]
pfam_metadata
.
append
(
flatten_value
)
pfam_metadata
.
append
(
flatten_value
)
except
KeyError
as
err
:
except
KeyError
as
err
:
console
.
print
(
f
"
[bold red]
{
err
}
"
,
style
=
"
red
"
)
console
.
print
(
f
"
[bold red]
{
err
}
"
,
style
=
"
red
"
)
console
.
print
(
console
.
print
(
...
@@ -215,14 +214,16 @@ def systems(
...
@@ -215,14 +214,16 @@ def systems(
sanitizedMetadata
[
"
PFAM
"
]
=
pfam_metadata
sanitizedMetadata
[
"
PFAM
"
]
=
pfam_metadata
if
"
article
"
in
table_data
:
if
"
article
"
in
table_data
:
m
etadata
[
"
doi
"
]
=
table_data
[
"
article
"
][
"
doi
"
]
sanitizedM
etadata
[
"
doi
"
]
=
table_data
[
"
article
"
][
"
doi
"
]
if
"
abstract
"
in
table_data
[
"
article
"
]:
if
"
abstract
"
in
table_data
[
"
article
"
]:
m
etadata
[
"
abstract
"
]
=
table_data
[
"
article
"
][
sanitizedM
etadata
[
"
abstract
"
]
=
table_data
[
"
article
"
][
"
abstract
"
"
abstract
"
]
]
del
table_data
[
"
article
"
]
del
table_data
[
"
article
"
]
del
metadata
[
"
tableColumns
"
]
if
"
PFAM
"
in
table_data
:
sanitizedMetadata
=
{
**
metadata
,
**
table_data
}
del
table_data
[
"
PFAM
"
]
del
sanitizedMetadata
[
"
tableColumns
"
]
sanitizedMetadata
=
{
**
sanitizedMetadata
,
**
table_data
}
systems
.
append
(
sanitizedMetadata
)
systems
.
append
(
sanitizedMetadata
)
json_object
=
json
.
dumps
(
systems
,
indent
=
2
)
json_object
=
json
.
dumps
(
systems
,
indent
=
2
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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