Skip to content
Snippets Groups Projects
Commit a4b7f941 authored by nfontrod's avatar nfontrod
Browse files

src/db_utils/db_creation.py: creation of 2 new tables: cin_de_event and cin_project_tf

parent 307d67ff
No related branches found
No related tags found
No related merge requests found
......@@ -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__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment