Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ChIA-PET_network
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
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
ReGArDS
ChIA-PET_network
Commits
c229c568
Commit
c229c568
authored
5 years ago
by
alapendr
Browse files
Options
Downloads
Patches
Plain Diff
get_fill_metadata.py: problems solving
parent
8fe9d7f8
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/db_utils/projects_metadata/get_fill_metadata.py
+15
-10
15 additions, 10 deletions
src/db_utils/projects_metadata/get_fill_metadata.py
with
15 additions
and
10 deletions
src/db_utils/projects_metadata/get_fill_metadata.py
+
15
−
10
View file @
c229c568
...
...
@@ -15,6 +15,8 @@ import pandas as pd
from
io
import
StringIO
from
..populate_database
import
populate_df
import
re
import
logging
from
...logging_conf
import
logging_def
def
launch_PmagicGEO_script
()
->
None
:
...
...
@@ -25,8 +27,8 @@ def launch_PmagicGEO_script() -> None:
:param GSM_file: A file with the list of GSM or GSE for which we want to
\
obtain metadata.
"""
subprocess
.
check_output
(
f
"
PmagicGEO.pl -i
{
Config
.
geo_id_file
}
"
\
f
"
-p
{
Config
.
output
}
"
f
"
-o
{
Config
.
outfile
}
"
,
\
subprocess
.
check_output
(
f
"
PmagicGEO.pl -i
{
Config
.
geo_id_file
}
"
f
"
-p
{
Config
.
output
}
"
f
"
-o
{
Config
.
outfile
}
"
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
)
...
...
@@ -67,24 +69,27 @@ def merge_metadata() -> pd.DataFrame:
"""
Merging of metadata obtained through PmagicGEO.pl and manually.
"""
projects
=
load_metadata
().
merge
(
load_manual_metadata
(),
left_on
=
"
gsm
"
,
\
right_on
=
"
GSM
"
)
projects
=
load_metadata
().
merge
(
load_manual_metadata
(),
left_on
=
"
gsm
"
,
right_on
=
"
GSM
"
)
projects
=
projects
.
drop
([
"
gsm
"
,
"
GSM
"
],
axis
=
1
)
projects
.
rename
(
columns
=
{
"
GSM-GSE
"
:
"
id_project
"
,
"
GSM-Title
"
:
"
name
"
,
\
"
GSM-Characteristics
"
:
"
description
"
,
\
"
GSM_FAMILYSOFT-contact_institute
"
:
"
institute
"
,
\
"
GSEA-Citation(s)
"
:
"
citation
"
,
"
Cell line
"
:
"
cell_line
"
,
\
"
Real source
"
:
"
database
"
,
"
Kept GSM
"
:
"
id_sample
"
,
\
projects
.
rename
(
columns
=
{
"
GSM-GSE
"
:
"
id_project
"
,
"
GSM-Title
"
:
"
name
"
,
"
GSM-Characteristics
"
:
"
description
"
,
"
GSM_FAMILYSOFT-contact_institute
"
:
"
institute
"
,
"
GSEA-Citation(s)
"
:
"
citation
"
,
"
Cell line
"
:
"
cell_line
"
,
"
Real source
"
:
"
database
"
,
"
Kept GSM
"
:
"
id_sample
"
,
"
Antibody
"
:
"
antibody
"
},
inplace
=
True
)
projects
=
projects
.
reset_index
().
rename
(
columns
=
{
"
index
"
:
"
id
"
})
logging
.
debug
(
projects
.
head
())
return
projects
def
fill_projects_table
()
->
None
:
def
fill_projects_table
(
logging_level
:
str
=
"
DISABLE
"
,
)
->
None
:
"""
Fill the table projects
:param logging_level: The level of data to display.
"""
logging_def
(
Config
.
output
,
__file__
,
logging_level
)
logging
.
debug
(
'
Filling cin_projects
'
)
populate_df
(
table
=
'
cin_projects
'
,
df
=
merge_metadata
(),
clean
=
'
y
'
)
...
...
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