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
a4b7f941
Commit
a4b7f941
authored
3 years ago
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/db_utils/db_creation.py: creation of 2 new tables: cin_de_event and cin_project_tf
parent
307d67ff
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/db_creation.py
+44
-0
44 additions, 0 deletions
src/db_utils/db_creation.py
with
44 additions
and
0 deletions
src/db_utils/db_creation.py
+
44
−
0
View file @
a4b7f941
...
...
@@ -199,6 +199,46 @@ def create_cin_ase_event_table(conn: sqlite3.Connection) -> None:
conn
.
commit
()
def
create_cin_project_tf_table
(
conn
:
sqlite3
.
Connection
)
->
None
:
"""
Create table cin_project_splicing_lore
:param conn: Connection to chia-pet database.
"""
c
=
conn
.
cursor
()
c
.
execute
(
'''
CREATE TABLE IF NOT EXISTS cin_project_tf
([id] INT NOT NULL,
[project_name] VARCHAR(45) NULL,
[source_db] VARCHAR(45) NOT NULL,
[db_id_project] VARCHAR(15) NOT NULL,
[tf_name] VARCHAR(45) NOT NULL,
[cl_name] VARCHAR(45) NOT NULL,
PRIMARY KEY ([id]))
'''
)
conn
.
commit
()
def
create_cin_de_event_table
(
conn
:
sqlite3
.
Connection
)
->
None
:
"""
Create table ase_event.
:param conn: Connection to chia-pet database.
"""
c
=
conn
.
cursor
()
c
.
execute
(
'''
CREATE TABLE IF NOT EXISTS cin_de_event
([id] INT NOT NULL,
[id_project] INT NOT NULL,
[gene_id] INT NOT NULL,
[baseMean] FLOAT NULL,
[log2FoldChange] FLOAT NULL,
[pvalue] FLOAT NULL,
[padj] FLOAT NULL,
PRIMARY KEY ([id]),
FOREIGN KEY ([gene_id]) REFERENCES cin_gene([id]),
FOREIGN KEY ([id_project])
REFERENCES cin_project_tf([id]))
'''
)
conn
.
commit
()
def
main_create_db
(
logging_level
:
str
=
"
DISABLE
"
):
"""
Create an empty chia-pet database.
...
...
@@ -223,6 +263,10 @@ def main_create_db(logging_level: str = "DISABLE"):
create_cin_project_splicing_lore_table
(
conn
)
logging
.
debug
(
'
Creation of cin_ase_event_table
'
)
create_cin_ase_event_table
(
conn
)
logging
.
debug
(
'
Creation of cin_project_tf table
'
)
create_cin_project_tf_table
(
conn
)
logging
.
debug
(
'
Creation of cin_de_event table
'
)
create_cin_de_event_table
(
conn
)
if
__name__
==
"
__main__
"
:
...
...
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