From e5c4fd0c8bb30440ed5bc767eb4ccaaf95277c93 Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Thu, 19 Jun 2014 21:24:52 -0600 Subject: [PATCH 1/8] Add get_processed_params_tables util --- qiita_db/test/test_util.py | 6 +++++- qiita_db/util.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/qiita_db/test/test_util.py b/qiita_db/test/test_util.py index 77af27230..967c70dcf 100644 --- a/qiita_db/test/test_util.py +++ b/qiita_db/test/test_util.py @@ -17,7 +17,7 @@ compute_checksum, check_table_cols, check_required_columns, convert_to_id, get_table_cols, get_filetypes, get_filepath_types, - get_count, check_count) + get_count, check_count, get_processed_params_tables) @qiita_test_checker() @@ -150,6 +150,10 @@ def test_check_count(self): self.assertTrue(check_count('qiita.study_person', 3)) self.assertFalse(check_count('qiita.study_person', 2)) + def test_get_processed_params_tables(self): + obs = get_processed_params_tables() + self.assertEqual(obs, ['processed_params_uclust']) + class UtilTests(TestCase): """Tests for the util functions that do not need to access the DB""" diff --git a/qiita_db/util.py b/qiita_db/util.py index ccee908ec..6baf27dc8 100644 --- a/qiita_db/util.py +++ b/qiita_db/util.py @@ -467,3 +467,17 @@ def check_count(table, exp_count): """ obs_count = get_count(table) return obs_count == exp_count + + +def get_processed_params_tables(): + """Returns a list of all tables starting with "processed_params_" + + Returns + ------- + list of str + """ + sql = ("select * from information_schema.tables where table_schema = " + "'qiita' and substr(table_name, 1, 17) = 'processed_params_'") + + conn = SQLConnectionHandler() + return [x[2] for x in conn.execute_fetchall(sql)] From a0274e5bc3f2c49aa9abe1e991022aead4aa6ba8 Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Thu, 19 Jun 2014 22:34:57 -0600 Subject: [PATCH 2/8] Add load_processed_data command and tests --- qiita_db/commands.py | 43 +++++++++++++++++++++++++++- qiita_db/test/test_commands.py | 52 +++++++++++++++++++++++++++++++++- scripts/qiita_db | 34 ++++++++++++++++++++-- 3 files changed, 125 insertions(+), 4 deletions(-) diff --git a/qiita_db/commands.py b/qiita_db/commands.py index a9a6906e3..20b135afd 100644 --- a/qiita_db/commands.py +++ b/qiita_db/commands.py @@ -18,7 +18,7 @@ from .study import Study, StudyPerson from .user import User from .util import get_filetypes, get_filepath_types -from .data import RawData +from .data import RawData, PreprocessedData, ProcessedData from .metadata_template import SampleTemplate @@ -108,3 +108,44 @@ def load_raw_data_cmd(filepaths, filepath_types, filetype, study_ids): return RawData.create(filetype_id, list(zip(filepaths, filepath_types)), studies) + + +def load_processed_data_cmd(fps, fp_types, processed_params_table_name, + processed_params_id, preprocessed_data_id=None, + processed_date=None): + """Add a new processed data entry + + Parameters + ---------- + fps : list of str + Paths to the processed data files to associate with the ProcessedData + object + fp_types: list of str + The types of files, one per fp + processed_params_table_name : str + The name of the processed_params_ table to use + processed_params_id : int + The ID of the row in the processed_params_ table + preprocessed_data_id : int, optional + Defaults to ``None``. The ID of the row in the preprocessed_data table. + processed_date : datetime, optional + Defaults to ``None``. The date and time to use as the processing date. + + Returns + ------- + qiita_db.ProcessedData + The newly created `qiita_db.ProcessedData` object + """ + if len(fps) != len(fp_types): + raise ValueError("Please pass exactly one fp_type for each " + "and every fp") + + fp_types_dict = get_filepath_types() + fp_types = [fp_types_dict[x] for x in fp_types] + + if preprocessed_data_id is not None: + preprocessed_data = PreprocessedData(preprocessed_data_id) + + return ProcessedData.create(processed_params_table_name, + processed_params_id, list(zip(fps, fp_types)), + preprocessed_data, processed_date) diff --git a/qiita_db/test/test_commands.py b/qiita_db/test/test_commands.py index ba60eaee3..9d7568092 100644 --- a/qiita_db/test/test_commands.py +++ b/qiita_db/test/test_commands.py @@ -19,10 +19,11 @@ from configparser import NoOptionError from qiita_db.commands import (make_study_from_cmd, load_raw_data_cmd, - sample_template_adder) + sample_template_adder, load_processed_data_cmd) from qiita_db.study import Study, StudyPerson from qiita_db.user import User from qiita_db.util import get_count, check_count, get_db_files_base_dir +from qiita_db.data import PreprocessedData from qiita_core.util import qiita_test_checker @@ -148,6 +149,55 @@ def test_load_data_from_cmd(self): study_ids) +@qiita_test_checker() +class TestLoadProcessedDataFromCmd(TestCase): + def setUp(self): + fd, self.otu_table_fp = mkstemp(suffix='_otu_table.biom') + close(fd) + + with open(self.otu_table_fp, "w") as f: + f.write("\n") + + self.files_to_remove = [] + self.files_to_remove.append(self.otu_table_fp) + + self.db_test_processed_data_dir = join(get_db_files_base_dir(), + 'processed_data') + + def tearDown(self): + for fp in self.files_to_remove: + if exists(fp): + remove(fp) + + def test_load_processed_data_from_cmd(self): + filepaths = [self.otu_table_fp] + filepath_types = ['biom'] + + initial_processed_data_count = get_count('qiita.processed_data') + initial_processed_fp_count = get_count('qiita.processed_filepath') + initial_fp_count = get_count('qiita.filepath') + + new = load_processed_data_cmd(filepaths, filepath_types, + 'processed_params_uclust', 1, 1, None) + processed_data_id = new.id + self.files_to_remove.append( + join(self.db_test_processed_data_dir, + '%d_%s' % (processed_data_id, basename(self.otu_table_fp)))) + + self.assertTrue(check_count('qiita.processed_data', + initial_processed_data_count + 1)) + self.assertTrue(check_count('qiita.processed_filepath', + initial_processed_fp_count + 1)) + self.assertTrue(check_count('qiita.filepath', + initial_fp_count + 1)) + + # Ensure that the ValueError is raised when a filepath_type is not + # provided for each and every filepath + with self.assertRaises(ValueError): + load_processed_data_cmd(filepaths, [], 'processed_params_uclust', + 1, 1, None) + + CONFIG_1 = """[required] timeseries_type_id = 1 metadata_complete = True diff --git a/scripts/qiita_db b/scripts/qiita_db index b704ffd34..953afcca4 100755 --- a/scripts/qiita_db +++ b/scripts/qiita_db @@ -9,10 +9,12 @@ # ----------------------------------------------------------------------------- import click +from datetime import datetime -from qiita_db.util import get_filetypes, get_filepath_types +from qiita_db.util import (get_filetypes, get_filepath_types, + get_processed_params_tables) from qiita_db.commands import (sample_template_adder, make_study_from_cmd, - load_raw_data_cmd) + load_raw_data_cmd, load_processed_data_cmd) @click.group() @@ -39,6 +41,34 @@ def load_raw_data(fp, fp_type, filetype, study): load_raw_data_cmd(fp, fp_type, filetype, study) +@qiita_db.command() +@click.option('--fp', required=True, type=click.Path(resolve_path=True, + readable=True, exists=True), multiple=True, help='Path to the ' + 'processed data. This option can be used multilpe times if ' + 'there are multiple processed data files.') +@click.option('--fp_type', required=True, multiple=True, help='Describes the ' + 'contents of the file. Pass one fp_type per fp.', + type=click.Choice(get_filepath_types().keys())) +@click.option('--processed_params_table', required=True, + type=click.Choice(get_processed_params_tables()), + help='The table containing the processed parameters used to ' + 'generate this file') +@click.option('--processed_params_id', required=True, type=int, + help='The ID of the row in the processed_params table') +@click.option('--preprocessed_data_id', type=int, default=None, help='The ' + 'ID of the row in the preprocessed_data table from which ' + 'this processed data was created') +@click.option('--processed_date', type=datetime, default=None, + help='The date to use as the processed_date. If None, then ' + 'the current date and time will be used.') +def load_processed_data(fp, fp_type, processed_params_table, + processed_params_id, preprocessed_data_id, + processed_date): + load_processed_data_cmd(fp, fp_type, processed_params_table, + processed_params_id, preprocessed_data_id, + processed_date) + + @qiita_db.command() @click.option('--owner', help="The email address of the owner of the study") @click.option('--title', help="The title of the study") From 397bc5e5bba6402d5d5919bbc0f321b49fd3441f Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Thu, 19 Jun 2014 23:43:45 -0600 Subject: [PATCH 3/8] Fix processed_filepath table Allow multiple filepaths to be associated with each processed_data_id --- qiita_db/support_files/qiita-db.dbs | 6 +- qiita_db/support_files/qiita-db.html | 3191 +++++++++++++------------- qiita_db/support_files/qiita-db.sql | 29 +- 3 files changed, 1573 insertions(+), 1653 deletions(-) diff --git a/qiita_db/support_files/qiita-db.dbs b/qiita_db/support_files/qiita-db.dbs index a0bbac529..2c16de96c 100644 --- a/qiita_db/support_files/qiita-db.dbs +++ b/qiita_db/support_files/qiita-db.dbs @@ -635,10 +635,8 @@ Linked by y being raw_data_id from raw data table. - + - - @@ -1262,8 +1260,8 @@ Controlled Vocabulary]]> - + analysis tables diff --git a/qiita_db/support_files/qiita-db.html b/qiita_db/support_files/qiita-db.html index c74056231..30f1ca77c 100644 --- a/qiita_db/support_files/qiita-db.html +++ b/qiita_db/support_files/qiita-db.html @@ -5,94 +5,12 @@ Database Documentation @@ -103,33 +21,33 @@ text:hover { fill:#a00000; font-size:12px;} text.colType { fill:#a9bdc6; } text.tableTitle { fill:#000000; } - path { stroke:#5c5750; stroke-width:1.2; fill:none; } + path { stroke:#797979; stroke-width:1.3; fill:none; } rect.table { fill:#ffffff; stroke:#4e4c4c; stroke-width:0.3; filter:url(#shadow); } line.table { stroke:#9ea1a4; stroke-width:0.3; } - rect.callout { fill:url(#calloutGradient); stroke:#bebdbd; stroke-width:0.5; } + rect.callout { fill:url(#calloutGradient); stroke:#aea913; stroke-width:0.5; } rect.grp { opacity:0.5; stroke:#b1b1b1; stroke-width:1.7; } - - - + + + - + - + - + @@ -139,17 +57,9 @@ - + - - - - - - - - - + - + - + @@ -232,58 +142,58 @@ d='M 0,0 3,3 M 0,3 3,0 z'/> - + - + - + Project qiita Layout qiita - Hint: Read the column comments as mouse-over tooltips. + Tip: Move the mouse over columns to read the comments Generated using DbSchema - + Group_analyses - + Group_users - + Group_study - + Group_vocabularies - + Group_ontology - + Group_logging - + Group_filepaths @@ -686,62 +596,62 @@ term_synonymTable qiita.term_synonym - Primary Key ( synonym_id ) -synonym_idsynonym_id bigserial not null -References term ( synonym_id -> term_id ) - Index ( term_id ) -term_idterm_id bigint not null -References term ( term_id ) - synonym_valuesynonym_value varchar not null - synonym_type_idsynonym_type_id bigint not null + Primary Key ( synonym_id ) +synonym_idsynonym_id bigserial not null +References term ( synonym_id -> term_id ) + Index ( term_id ) +term_idterm_id bigint not null +References term ( term_id ) + synonym_valuesynonym_value varchar not null + synonym_type_idsynonym_type_id bigint not null controlled_vocab_valuesTable qiita.controlled_vocab_values - Primary Key ( vocab_value_id ) -vocab_value_idvocab_value_id bigserial not null - Index ( controlled_vocab_id ) -controlled_vocab_idcontrolled_vocab_id bigint not null -References controlled_vocabularies ( controlled_vocab_id ) - termterm varchar not null - order_byorder_by varchar not null - default_itemdefault_item varchar + Primary Key ( vocab_value_id ) +vocab_value_idvocab_value_id bigserial not null + Index ( controlled_vocab_id ) +controlled_vocab_idcontrolled_vocab_id bigint not null +References controlled_vocabularies ( controlled_vocab_id ) + termterm varchar not null + order_byorder_by varchar not null + default_itemdefault_item varchar controlled_vocabulariesTable qiita.controlled_vocabularies - Primary Key ( controlled_vocab_id ) -controlled_vocab_idcontrolled_vocab_id bigserial not null -Referred by column_controlled_vocabularies ( controlled_vocab_id ) + <use id='nn' x='47' y='1347' xlink:href='#nn'/><a xlink:href='#controlled_vocab_id'><use id='pk' x='47' y='1346' xlink:href='#pk'/><title>Primary Key ( controlled_vocab_id ) +controlled_vocab_idcontrolled_vocab_id bigserial not null +Referred by column_controlled_vocabularies ( controlled_vocab_id ) Referred by controlled_vocab_values ( controlled_vocab_id ) - vocab_namevocab_name varchar not null + vocab_namevocab_name varchar not null severityTable qiita.severity - Primary Key ( severity_id ) -severity_idseverity_id serial not null -Referred by logging ( severity_id ) - severityseverity varchar not null + Primary Key ( severity_id ) +severity_idseverity_id serial not null +Referred by logging ( severity_id ) + severityseverity varchar not null loggingTable qiita.logging - Primary Key ( log_id ) -log_idlog_id bigserial not null -Referred by job ( log_id ) - timetime timestamp not null + <use id='nn' x='1367' y='1227' xlink:href='#nn'/><a xlink:href='#log_id'><use id='pk' x='1367' y='1226' xlink:href='#pk'/><title>Primary Key ( log_id ) +log_idlog_id bigserial not null +Referred by job ( log_id ) + timetime timestamp not null Time the error was thrown - Index ( severity_id ) -severity_idseverity_id integer not null -References severity ( severity_id ) - msgmsg varchar not null + <use id='nn' x='1367' y='1257' xlink:href='#nn'/><a xlink:href='#severity_id'><use id='idx' x='1367' y='1256' xlink:href='#idx'/><title>Index ( severity_id ) +severity_idseverity_id integer not null +References severity ( severity_id ) + msgmsg varchar not null Error message thrown - informationinformation varchar + <a xlink:href='#information'><text x='1383' y='1297'>information</text><title>information varchar Other applicable information (depending on error) @@ -749,110 +659,109 @@ study_personTable qiita.study_person Contact information for the various people involved in a study - Primary Key ( study_person_id ) -study_person_idstudy_person_id bigserial not null -Referred by investigation ( contact_person_id -> study_person_id ) + <use id='nn' x='2042' y='117' xlink:href='#nn'/><a xlink:href='#study_person_id'><use id='pk' x='2042' y='116' xlink:href='#pk'/><title>Primary Key ( study_person_id ) +study_person_idstudy_person_id bigserial not null +Referred by investigation ( contact_person_id -> study_person_id ) Referred by study ( emp_person_id -> study_person_id ) Referred by study ( lab_person_id -> study_person_id ) Referred by study ( principal_investigator_id -> study_person_id ) - namename varchar not null - emailemail varchar not null - addressaddress varchar(100) - phonephone varchar + namename varchar not null + emailemail varchar not null + addressaddress varchar(100) + phonephone varchar investigationTable qiita.investigation -Overarching investigation information. -An investigation comprises one or more individual studies. - Primary Key ( investigation_id ) -investigation_idinvestigation_id bigserial not null -Referred by investigation_study ( investigation_id ) - namename varchar not null - descriptiondescription varchar not null +Overarching investigation information.<br>An investigation comprises one or more individual studies. + Primary Key ( investigation_id ) +investigation_idinvestigation_id bigserial not null +Referred by investigation_study ( investigation_id ) + namename varchar not null + descriptiondescription varchar not null Describes the overarching goal of the investigation - Index ( contact_person_id ) -contact_person_idcontact_person_id bigint -References study_person ( contact_person_id -> study_person_id ) + Index ( contact_person_id ) +contact_person_idcontact_person_id bigint +References study_person ( contact_person_id -> study_person_id ) investigation_studyTable qiita.investigation_study - Primary Key ( investigation_id, study_id ) Index ( investigation_id ) -investigation_idinvestigation_id bigint not null -References investigation ( investigation_id ) - Primary Key ( investigation_id, study_id ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) + Primary Key ( investigation_id, study_id ) Index ( investigation_id ) +investigation_idinvestigation_id bigint not null +References investigation ( investigation_id ) + Primary Key ( investigation_id, study_id ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) study_statusTable qiita.study_status - Primary Key ( study_status_id ) -study_status_idstudy_status_id bigserial not null -Referred by study ( study_status_id ) - statusstatus varchar not null - descriptiondescription varchar not null + Primary Key ( study_status_id ) +study_status_idstudy_status_id bigserial not null +Referred by study ( study_status_id ) + statusstatus varchar not null + descriptiondescription varchar not null study_experimental_factorTable qiita.study_experimental_factor EFO ontological link of experimental factors to studies - Primary Key ( study_id, efo_id ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, efo_id ) -efo_idefo_id bigint not null + Primary Key ( study_id, efo_id ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, efo_id ) +efo_idefo_id bigint not null study_pmidTable qiita.study_pmid Links a study to all PMIDs for papers created from study - Primary Key ( study_id, pmid ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, pmid ) -pmidpmid varchar not null + Primary Key ( study_id, pmid ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, pmid ) +pmidpmid varchar not null analysis_statusTable qiita.analysis_status - Primary Key ( analysis_status_id ) -analysis_status_idanalysis_status_id bigserial not null -Referred by analysis ( analysis_status_id ) - statusstatus varchar not null + Primary Key ( analysis_status_id ) +analysis_status_idanalysis_status_id bigserial not null +Referred by analysis ( analysis_status_id ) + statusstatus varchar not null analysisTable qiita.analysis hHolds analysis information - Primary Key ( analysis_id ) -analysis_idanalysis_id bigserial not null + <use id='nn' x='227' y='732' xlink:href='#nn'/><a xlink:href='#analysis_id'><use id='pk' x='227' y='731' xlink:href='#pk'/><title>Primary Key ( analysis_id ) +analysis_idanalysis_id bigserial not null Unique identifier for analysis -Referred by analysis_chain ( parent_id -> analysis_id ) +<a xlink:href='#analysis_id'><use id='ref' x='348' y='731' xlink:href='#ref'/><title>Referred by analysis_chain ( parent_id -> analysis_id ) Referred by analysis_chain ( child_id -> analysis_id ) Referred by analysis_filepath ( analysis_id ) Referred by analysis_job ( analysis_id ) Referred by analysis_sample ( analysis_id ) Referred by analysis_users ( analysis_id ) - Index ( email ) -emailemail varchar not null + <use id='nn' x='227' y='747' xlink:href='#nn'/><a xlink:href='#email'><use id='idx' x='227' y='746' xlink:href='#idx'/><title>Index ( email ) +emailemail varchar not null Email for user who owns the analysis -References qiita_user ( email ) - namename varchar not null +<a xlink:href='#email'><use id='fk' x='348' y='746' xlink:href='#fk'/><title>References qiita_user ( email ) + namename varchar not null Name of the analysis - descriptiondescription varchar not null - Index ( analysis_status_id ) -analysis_status_idanalysis_status_id bigint not null -References analysis_status ( analysis_status_id ) - pmidpmid varchar + <use id='nn' x='227' y='777' xlink:href='#nn'/><a xlink:href='#description'><text x='243' y='787'>description</text><title>description varchar not null + Index ( analysis_status_id ) +analysis_status_idanalysis_status_id bigint not null +References analysis_status ( analysis_status_id ) + pmidpmid varchar PMID of paper from the analysis @@ -860,221 +769,220 @@ analysis_filepathTable qiita.analysis_filepath Stores link between analysis and the data file used for the analysis. - Index ( analysis_id ) Primary Key ( analysis_id, filepath_id ) -analysis_idanalysis_id bigint not null -References analysis ( analysis_id ) - Index ( filepath_id ) Primary Key ( analysis_id, filepath_id ) -filepath_idfilepath_id bigint not null -References filepath ( filepath_id ) + Index ( analysis_id ) Primary Key ( analysis_id, filepath_id ) +analysis_idanalysis_id bigint not null +References analysis ( analysis_id ) + Index ( filepath_id ) Primary Key ( analysis_id, filepath_id ) +filepath_idfilepath_id bigint not null +References filepath ( filepath_id ) job_results_filepathTable qiita.job_results_filepath Holds connection between jobs and the result filepaths - Primary Key ( job_id, filepath_id ) Index ( job_id ) -job_idjob_id bigint not null -References job ( job_id ) - Primary Key ( job_id, filepath_id ) Index ( filepath_id ) -filepath_idfilepath_id bigint not null -References filepath ( filepath_id ) + Primary Key ( job_id, filepath_id ) Index ( job_id ) +job_idjob_id bigint not null +References job ( job_id ) + Primary Key ( job_id, filepath_id ) Index ( filepath_id ) +filepath_idfilepath_id bigint not null +References filepath ( filepath_id ) jobTable qiita.job - Primary Key ( job_id ) -job_idjob_id bigserial not null + <use id='nn' x='407' y='1017' xlink:href='#nn'/><a xlink:href='#job_id'><use id='pk' x='407' y='1016' xlink:href='#pk'/><title>Primary Key ( job_id ) +job_idjob_id bigserial not null Unique identifier for job -Referred by analysis_job ( job_id ) +<a xlink:href='#job_id'><use id='ref' x='498' y='1016' xlink:href='#ref'/><title>Referred by analysis_job ( job_id ) Referred by job_results_filepath ( job_id ) - Index ( data_type_id ) -data_type_iddata_type_id bigint not null + <use id='nn' x='407' y='1032' xlink:href='#nn'/><a xlink:href='#data_type_id'><use id='idx' x='407' y='1031' xlink:href='#idx'/><title>Index ( data_type_id ) +data_type_iddata_type_id bigint not null What datatype (16s, metabolome, etc) job is run on. -References data_type ( data_type_id ) - Index ( job_status_id ) -job_status_idjob_status_id bigint not null -References job_status ( job_status_id ) - Index ( command_id ) -command_idcommand_id bigint not null +<a xlink:href='#data_type_id'><use id='fk' x='498' y='1031' xlink:href='#fk'/><title>References data_type ( data_type_id ) + Index ( job_status_id ) +job_status_idjob_status_id bigint not null +References job_status ( job_status_id ) + Index ( command_id ) +command_idcommand_id bigint not null The Qiime or other function being run (alpha diversity, etc) -References command ( command_id ) - optionsoptions varchar +<a xlink:href='#command_id'><use id='fk' x='498' y='1061' xlink:href='#fk'/><title>References command ( command_id ) + optionsoptions varchar Holds all options set for the job as a json string - Index ( log_id ) -log_idlog_id bigint + <a xlink:href='#log_id'><use id='idx' x='407' y='1091' xlink:href='#idx'/><title>Index ( log_id ) +log_idlog_id bigint Reference to error if status is error -References logging ( log_id ) +References logging ( log_id ) analysis_jobTable qiita.analysis_job Holds information for a one-to-many relation of analysis to the jobs in it - Primary Key ( analysis_id, job_id ) Index ( analysis_id ) -analysis_idanalysis_id bigint not null + <use id='nn' x='287' y='942' xlink:href='#nn'/><a xlink:href='#analysis_id'><use id='pk' x='287' y='941' xlink:href='#pk'/><title>Primary Key ( analysis_id, job_id ) Index ( analysis_id ) +analysis_idanalysis_id bigint not null Id of the analysis -References analysis ( analysis_id ) - Primary Key ( analysis_id, job_id ) Index ( job_id ) -job_idjob_id bigint not null +<a xlink:href='#analysis_id'><use id='fk' x='363' y='941' xlink:href='#fk'/><title>References analysis ( analysis_id ) + Primary Key ( analysis_id, job_id ) Index ( job_id ) +job_idjob_id bigint not null Id for a job that is part of the analysis -References job ( job_id ) +References job ( job_id ) analysis_chainTable qiita.analysis_chain -Keeps track of the chain of analysis edits. Tracks what previous analysis a given analysis came from. -If a given analysis is not in child_id, it is the root of the chain. - Index ( parent_id ) Primary Key ( parent_id, child_id ) -parent_idparent_id bigint not null -References analysis ( parent_id -> analysis_id ) - Index ( child_id ) Primary Key ( parent_id, child_id ) -child_idchild_id bigint not null -References analysis ( child_id -> analysis_id ) +Keeps track of the chain of analysis edits. Tracks what previous analysis a given analysis came from.
If a given analysis is not in child_id, it is the root of the chain. + Index ( parent_id ) Primary Key ( parent_id, child_id ) +parent_idparent_id bigint not null +References analysis ( parent_id -> analysis_id ) + Index ( child_id ) Primary Key ( parent_id, child_id ) +child_idchild_id bigint not null +References analysis ( child_id -> analysis_id ) job_statusTable qiita.job_status - Primary Key ( job_status_id ) -job_status_idjob_status_id bigserial not null -Referred by job ( job_status_id ) - statusstatus varchar not null + Primary Key ( job_status_id ) +job_status_idjob_status_id bigserial not null +Referred by job ( job_status_id ) + statusstatus varchar not null commandTable qiita.command Available commands for jobs - Primary Key ( command_id ) -command_idcommand_id bigserial not null + <use id='nn' x='212' y='1122' xlink:href='#nn'/><a xlink:href='#command_id'><use id='pk' x='212' y='1121' xlink:href='#pk'/><title>Primary Key ( command_id ) +command_idcommand_id bigserial not null Unique identifier for function -Referred by job ( command_id ) - namename varchar not null - commandcommand varchar not null +<a xlink:href='#command_id'><use id='ref' x='303' y='1121' xlink:href='#ref'/><title>Referred by job ( command_id ) + namename varchar not null + commandcommand varchar not null What command to call to run this function analysis_sampleTable qiita.analysis_sample - Index ( analysis_id ) -analysis_idanalysis_id bigint not null -References analysis ( analysis_id ) - Index ( processed_data_id ) -processed_data_idprocessed_data_id bigint not null -References processed_data ( processed_data_id ) - Index ( sample_id ) -sample_idsample_id varchar not null -References required_sample_info ( sample_id ) + Index ( analysis_id ) +analysis_idanalysis_id bigint not null +References analysis ( analysis_id ) + Index ( processed_data_id ) +processed_data_idprocessed_data_id bigint not null +References processed_data ( processed_data_id ) + Index ( sample_id ) +sample_idsample_id varchar not null +References required_sample_info ( sample_id ) column_controlled_vocabulariesTable qiita.column_controlled_vocabularies Table relates a column with a controlled vocabulary. - Primary Key ( controlled_vocab_id, column_name ) Index ( controlled_vocab_id ) -controlled_vocab_idcontrolled_vocab_id bigserial not null -References controlled_vocabularies ( controlled_vocab_id ) - Primary Key ( controlled_vocab_id, column_name ) Index ( column_name ) -column_namecolumn_name varchar not null -References mixs_field_description ( column_name ) + Primary Key ( controlled_vocab_id, column_name ) Index ( controlled_vocab_id ) +controlled_vocab_idcontrolled_vocab_id bigserial not null +References controlled_vocabularies ( controlled_vocab_id ) + Primary Key ( controlled_vocab_id, column_name ) Index ( column_name ) +column_namecolumn_name varchar not null +References mixs_field_description ( column_name ) mixs_field_descriptionTable qiita.mixs_field_description - Primary Key ( column_name ) -column_namecolumn_name varchar not null -Referred by column_controlled_vocabularies ( column_name ) + <use id='nn' x='302' y='1512' xlink:href='#nn'/><a xlink:href='#column_name'><use id='pk' x='302' y='1511' xlink:href='#pk'/><title>Primary Key ( column_name ) +column_namecolumn_name varchar not null +Referred by column_controlled_vocabularies ( column_name ) Referred by column_ontology ( column_name ) - data_typedata_type varchar not null - desc_or_valuedesc_or_value varchar not null - definitiondefinition varchar not null - min_lengthmin_length integer - activeactive integer not null + data_typedata_type varchar not null + desc_or_valuedesc_or_value varchar not null + definitiondefinition varchar not null + min_lengthmin_length integer + activeactive integer not null column_ontologyTable qiita.column_ontology This table relates a column with an ontology. - Primary Key ( column_name, ontology_short_name ) Index ( column_name ) -column_namecolumn_name varchar not null -References mixs_field_description ( column_name ) - Primary Key ( column_name, ontology_short_name ) -ontology_short_nameontology_short_name varchar not null - bioportal_idbioportal_id integer not null - ontology_branch_idontology_branch_id integer not null + Primary Key ( column_name, ontology_short_name ) Index ( column_name ) +column_namecolumn_name varchar not null +References mixs_field_description ( column_name ) + Primary Key ( column_name, ontology_short_name ) +ontology_short_nameontology_short_name varchar not null + bioportal_idbioportal_id integer not null + ontology_branch_idontology_branch_id integer not null term_relationshipTable qiita.term_relationship - Primary Key ( term_relationship_id ) -term_relationship_idterm_relationship_id bigserial not null - Index ( subject_term_id ) -subject_term_idsubject_term_id bigint not null -References term ( subject_term_id -> term_id ) - Index ( predicate_term_id ) -predicate_term_idpredicate_term_id bigint not null -References term ( predicate_term_id -> term_id ) - Index ( object_term_id ) -object_term_idobject_term_id bigint not null -References term ( object_term_id -> term_id ) - Index ( ontology_id ) -ontology_idontology_id bigint not null -References ontology ( ontology_id ) + Primary Key ( term_relationship_id ) +term_relationship_idterm_relationship_id bigserial not null + Index ( subject_term_id ) +subject_term_idsubject_term_id bigint not null +References term ( subject_term_id -> term_id ) + Index ( predicate_term_id ) +predicate_term_idpredicate_term_id bigint not null +References term ( predicate_term_id -> term_id ) + Index ( object_term_id ) +object_term_idobject_term_id bigint not null +References term ( object_term_id -> term_id ) + Index ( ontology_id ) +ontology_idontology_id bigint not null +References ontology ( ontology_id ) term_pathTable qiita.term_path - Primary Key ( term_path_id ) -term_path_idterm_path_id bigserial not null - Index ( subject_term_id ) -subject_term_idsubject_term_id bigint not null -References term ( subject_term_id -> term_id ) - Index ( predicate_term_id ) -predicate_term_idpredicate_term_id bigint not null -References term ( predicate_term_id -> term_id ) - Index ( object_term_id ) -object_term_idobject_term_id bigint not null -References term ( object_term_id -> term_id ) - Index ( ontology_id ) -ontology_idontology_id bigint not null -References ontology ( ontology_id ) - Index ( relationship_type_id ) -relationship_type_idrelationship_type_id integer not null -References relationship_type ( relationship_type_id ) - distancedistance integer + Primary Key ( term_path_id ) +term_path_idterm_path_id bigserial not null + Index ( subject_term_id ) +subject_term_idsubject_term_id bigint not null +References term ( subject_term_id -> term_id ) + Index ( predicate_term_id ) +predicate_term_idpredicate_term_id bigint not null +References term ( predicate_term_id -> term_id ) + Index ( object_term_id ) +object_term_idobject_term_id bigint not null +References term ( object_term_id -> term_id ) + Index ( ontology_id ) +ontology_idontology_id bigint not null +References ontology ( ontology_id ) + Index ( relationship_type_id ) +relationship_type_idrelationship_type_id integer not null +References relationship_type ( relationship_type_id ) + distancedistance integer ontologyTable qiita.ontology - Primary Key ( ontology_id ) -ontology_idontology_id bigserial not null -Referred by term ( ontology_id ) + <use id='nn' x='767' y='1347' xlink:href='#nn'/><a xlink:href='#ontology_id'><use id='pk' x='767' y='1346' xlink:href='#pk'/><title>Primary Key ( ontology_id ) +ontology_idontology_id bigserial not null +Referred by term ( ontology_id ) Referred by term_path ( ontology_id ) Referred by term_relationship ( ontology_id ) - shortnameshortname varchar not null - fully_loadedfully_loaded bool not null - fullnamefullname varchar - query_urlquery_url varchar - source_urlsource_url varchar - definitiondefinition text - load_dateload_date date not null - versionversion varchar + shortnameshortname varchar not null + fully_loadedfully_loaded bool not null + fullnamefullname varchar + query_urlquery_url varchar + source_urlsource_url varchar + definitiondefinition text + load_dateload_date date not null + versionversion varchar termTable qiita.term - Primary Key ( term_id ) -term_idterm_id bigserial not null -Referred by annotation ( term_id ) + <use id='nn' x='797' y='1647' xlink:href='#nn'/><a xlink:href='#term_id'><use id='pk' x='797' y='1646' xlink:href='#pk'/><title>Primary Key ( term_id ) +term_idterm_id bigserial not null +Referred by annotation ( term_id ) Referred by dbxref ( term_id ) Referred by term_path ( subject_term_id -> term_id ) Referred by term_path ( predicate_term_id -> term_id ) @@ -1084,186 +992,186 @@ Referred by term_relationship ( object_term_id -> term_id ) Referred by term_synonym ( term_id ) Referred by term_synonym ( synonym_id -> term_id ) - Unique Index ( ontology_id ) -ontology_idontology_id bigint not null -References ontology ( ontology_id ) - term_nameterm_name varchar not null - identifieridentifier varchar - definitiondefinition varchar - namespacenamespace varchar - is_obsoleteis_obsolete bool not null default 'false' - is_root_termis_root_term bool not null - is_leafis_leaf bool not null + Unique Index ( ontology_id ) +ontology_idontology_id bigint not null +References ontology ( ontology_id ) + term_nameterm_name varchar not null + identifieridentifier varchar + definitiondefinition varchar + namespacenamespace varchar + is_obsoleteis_obsolete bool not null default 'false' + is_root_termis_root_term bool not null + is_leafis_leaf bool not null annotationTable qiita.annotation - Primary Key ( annotation_id ) -annotation_idannotation_id bigserial not null - Index ( term_id ) -term_idterm_id bigint not null -References term ( term_id ) - annotation_nameannotation_name varchar not null - annotation_num_valueannotation_num_value bigint - annotation_str_valueannotation_str_value varchar + Primary Key ( annotation_id ) +annotation_idannotation_id bigserial not null + Index ( term_id ) +term_idterm_id bigint not null +References term ( term_id ) + annotation_nameannotation_name varchar not null + annotation_num_valueannotation_num_value bigint + annotation_str_valueannotation_str_value varchar dbxrefTable qiita.dbxref - Primary Key ( dbxref_id ) -dbxref_iddbxref_id bigserial not null - Index ( term_id ) -term_idterm_id bigint not null -References term ( term_id ) - dbnamedbname varchar not null - accessionaccession varchar not null - descriptiondescription varchar not null - xref_typexref_type varchar not null + Primary Key ( dbxref_id ) +dbxref_iddbxref_id bigserial not null + Index ( term_id ) +term_idterm_id bigint not null +References term ( term_id ) + dbnamedbname varchar not null + accessionaccession varchar not null + descriptiondescription varchar not null + xref_typexref_type varchar not null relationship_typeTable qiita.relationship_type - Primary Key ( relationship_type_id ) -relationship_type_idrelationship_type_id bigserial not null -Referred by term_path ( relationship_type_id ) - relationship_typerelationship_type varchar not null + Primary Key ( relationship_type_id ) +relationship_type_idrelationship_type_id bigserial not null +Referred by term_path ( relationship_type_id ) + relationship_typerelationship_type varchar not null analysis_usersTable qiita.analysis_users Links analyses to the users they are shared with - Primary Key ( analysis_id, email ) Index ( analysis_id ) -analysis_idanalysis_id bigint not null -References analysis ( analysis_id ) - Primary Key ( analysis_id, email ) Index ( email ) -emailemail varchar not null -References qiita_user ( email ) + Primary Key ( analysis_id, email ) Index ( analysis_id ) +analysis_idanalysis_id bigint not null +References analysis ( analysis_id ) + Primary Key ( analysis_id, email ) Index ( email ) +emailemail varchar not null +References qiita_user ( email ) user_levelTable qiita.user_level Holds available user levels - Primary Key ( user_level_id ) -user_level_iduser_level_id serial not null -Referred by qiita_user ( user_level_id ) - namename varchar not null + <use id='nn' x='167' y='87' xlink:href='#nn'/><a xlink:href='#user_level_id'><use id='pk' x='167' y='86' xlink:href='#pk'/><title>Primary Key ( user_level_id ) +user_level_iduser_level_id serial not null +Referred by qiita_user ( user_level_id ) + namename varchar not null One of the user levels (admin, user, guest, etc) - descriptiondescription text not null + descriptiondescription text not null qiita_userTable qiita.qiita_user Holds all user information - Primary Key ( email ) -emailemail varchar not null -Referred by analysis ( email ) + <use id='nn' x='332' y='102' xlink:href='#nn'/><a xlink:href='#email'><use id='pk' x='332' y='101' xlink:href='#pk'/><title>Primary Key ( email ) +emailemail varchar not null +Referred by analysis ( email ) Referred by analysis_users ( email ) Referred by study ( email ) Referred by study_users ( email ) - Index ( user_level_id ) -user_level_iduser_level_id integer not null default 5 + <use id='nn' x='332' y='117' xlink:href='#nn'/><a xlink:href='#user_level_id'><use id='idx' x='332' y='116' xlink:href='#idx'/><title>Index ( user_level_id ) +user_level_iduser_level_id integer not null default 5 user level -References user_level ( user_level_id ) - passwordpassword varchar not null - namename varchar - affiliationaffiliation varchar - addressaddress varchar - phonephone varchar - user_verify_codeuser_verify_code varchar +<a xlink:href='#user_level_id'><use id='fk' x='468' y='116' xlink:href='#fk'/><title>References user_level ( user_level_id ) + passwordpassword varchar not null + namename varchar + affiliationaffiliation varchar + addressaddress varchar + phonephone varchar + user_verify_codeuser_verify_code varchar Code for initial user email verification - pass_reset_codepass_reset_code varchar + <a xlink:href='#pass_reset_code'><text x='348' y='232'>pass_reset_code</text><title>pass_reset_code varchar Randomly generated code for password reset - pass_reset_timestamppass_reset_timestamp timestamp + <a xlink:href='#pass_reset_timestamp'><text x='348' y='247'>pass_reset_timestamp</text><title>pass_reset_timestamp timestamp Time the reset code was generated filepath_typeTable qiita.filepath_type - Primary Key ( filepath_type_id ) -filepath_type_idfilepath_type_id bigserial not null -Referred by filepath ( filepath_type_id ) - filepath_typefilepath_type varchar + Primary Key ( filepath_type_id ) +filepath_type_idfilepath_type_id bigserial not null +Referred by filepath ( filepath_type_id ) + filepath_typefilepath_type varchar checksum_algorithmTable qiita.checksum_algorithm - Primary Key ( checksum_algorithm_id ) -checksum_algorithm_idchecksum_algorithm_id bigserial not null -Referred by filepath ( checksum_algorithm_id ) - namename varchar not null + Primary Key ( checksum_algorithm_id ) +checksum_algorithm_idchecksum_algorithm_id bigserial not null +Referred by filepath ( checksum_algorithm_id ) + namename varchar not null data_typeTable qiita.data_type - Primary Key ( data_type_id ) -data_type_iddata_type_id bigserial not null -Referred by common_prep_info ( data_type_id ) + <use id='nn' x='692' y='1032' xlink:href='#nn'/><a xlink:href='#data_type_id'><use id='pk' x='692' y='1031' xlink:href='#pk'/><title>Primary Key ( data_type_id ) +data_type_iddata_type_id bigserial not null +Referred by common_prep_info ( data_type_id ) Referred by job ( data_type_id ) - data_typedata_type varchar not null + <use id='nn' x='692' y='1047' xlink:href='#nn'/><a xlink:href='#data_type'><text x='708' y='1057'>data_type</text><title>data_type varchar not null Data type (16S, metabolome, etc) the job will use filepathTable qiita.filepath - Primary Key ( filepath_id ) -filepath_idfilepath_id bigserial not null -Referred by analysis_filepath ( filepath_id ) + <use id='nn' x='662' y='702' xlink:href='#nn'/><a xlink:href='#filepath_id'><use id='pk' x='662' y='701' xlink:href='#pk'/><title>Primary Key ( filepath_id ) +filepath_idfilepath_id bigserial not null +Referred by analysis_filepath ( filepath_id ) Referred by job_results_filepath ( filepath_id ) Referred by preprocessed_filepath ( filepath_id ) Referred by processed_filepath ( filepath_id ) Referred by raw_filepath ( filepath_id ) - filepathfilepath varchar not null - Index ( filepath_type_id ) -filepath_type_idfilepath_type_id bigint not null -References filepath_type ( filepath_type_id ) - checksumchecksum varchar not null - checksum_algorithm_idchecksum_algorithm_id bigint not null -References checksum_algorithm ( checksum_algorithm_id ) + filepathfilepath varchar not null + Index ( filepath_type_id ) +filepath_type_idfilepath_type_id bigint not null +References filepath_type ( filepath_type_id ) + checksumchecksum varchar not null + checksum_algorithm_idchecksum_algorithm_id bigint not null +References checksum_algorithm ( checksum_algorithm_id ) processed_dataTable qiita.processed_data - Primary Key ( processed_data_id ) -processed_data_idprocessed_data_id bigserial not null -Referred by analysis_sample ( processed_data_id ) + <use id='nn' x='1217' y='957' xlink:href='#nn'/><a xlink:href='#processed_data_id'><use id='pk' x='1217' y='956' xlink:href='#pk'/><title>Primary Key ( processed_data_id ) +processed_data_idprocessed_data_id bigserial not null +Referred by analysis_sample ( processed_data_id ) Referred by preprocessed_processed_data ( processed_data_id ) Referred by processed_filepath ( processed_data_id ) - processed_params_tableprocessed_params_table varchar not null + <use id='nn' x='1217' y='972' xlink:href='#nn'/><a xlink:href='#processed_params_table'><text x='1233' y='982'>processed_params_table</text><title>processed_params_table varchar not null Name of table holding processing params - processed_params_idprocessed_params_id bigint not null + <use id='nn' x='1217' y='987' xlink:href='#nn'/><a xlink:href='#processed_params_id'><text x='1233' y='997'>processed_params_id</text><title>processed_params_id bigint not null Link to a table with the parameters used to generate processed data - processed_dateprocessed_date timestamp not null + processed_dateprocessed_date timestamp not null study_preprocessed_dataTable qiita.study_preprocessed_data - Primary Key ( study_id, preprocessed_data_id ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, preprocessed_data_id ) Index ( preprocessed_data_id ) -preprocessed_data_idpreprocessed_data_id bigint not null -References preprocessed_data ( preprocessed_data_id ) + Primary Key ( study_id, preprocessed_data_id ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, preprocessed_data_id ) Index ( preprocessed_data_id ) +preprocessed_data_idpreprocessed_data_id bigint not null +References preprocessed_data ( preprocessed_data_id ) studyTable qiita.study - Primary Key ( study_id ) -study_idstudy_id bigserial not null + <use id='nn' x='1757' y='72' xlink:href='#nn'/><a xlink:href='#study_id'><use id='pk' x='1757' y='71' xlink:href='#pk'/><title>Primary Key ( study_id ) +study_idstudy_id bigserial not null Unique name for study -Referred by investigation_study ( study_id ) +<a xlink:href='#study_id'><use id='ref' x='1923' y='71' xlink:href='#ref'/><title>Referred by investigation_study ( study_id ) Referred by required_sample_info ( study_id ) Referred by study_experimental_factor ( study_id ) Referred by study_pmid ( study_id ) @@ -1271,96 +1179,92 @@ Referred by study_raw_data ( study_id ) Referred by study_sample_columns ( study_id ) Referred by study_users ( study_id ) - Index ( email ) -emailemail varchar not null + <use id='nn' x='1757' y='87' xlink:href='#nn'/><a xlink:href='#email'><use id='idx' x='1757' y='86' xlink:href='#idx'/><title>Index ( email ) +emailemail varchar not null Email of study owner -References qiita_user ( email ) - Index ( study_status_id ) -study_status_idstudy_status_id bigint not null -References study_status ( study_status_id ) - Index ( emp_person_id ) -emp_person_idemp_person_id bigint -References study_person ( emp_person_id -> study_person_id ) - first_contactfirst_contact varchar not null - fundingfunding varchar - Index ( timeseries_type_id ) -timeseries_type_idtimeseries_type_id bigint not null -What type of timeseries this study is (or is not) -Controlled Vocabulary -References timeseries_type ( timeseries_type_id ) - Index ( lab_person_id ) -lab_person_idlab_person_id bigint -References study_person ( lab_person_id -> study_person_id ) - metadata_completemetadata_complete bool not null - mixs_compliantmixs_compliant bool not null - most_recent_contactmost_recent_contact varchar - number_samples_collectednumber_samples_collected integer not null - number_samples_promisednumber_samples_promised integer not null - Index ( portal_type_id ) -portal_type_idportal_type_id bigint not null -References portal_type ( portal_type_id ) - Index ( principal_investigator_id ) -principal_investigator_idprincipal_investigator_id bigint not null -References study_person ( principal_investigator_id -> study_person_id ) - reprocessreprocess bool not null - spatial_seriesspatial_series bool - study_titlestudy_title varchar not null - study_aliasstudy_alias varchar not null - study_descriptionstudy_description text not null - study_abstractstudy_abstract text not null - vamps_idvamps_id varchar +References qiita_user ( email ) + Index ( study_status_id ) +study_status_idstudy_status_id bigint not null +References study_status ( study_status_id ) + Index ( emp_person_id ) +emp_person_idemp_person_id bigint +References study_person ( emp_person_id -> study_person_id ) + first_contactfirst_contact varchar not null + fundingfunding varchar + Index ( timeseries_type_id ) +timeseries_type_idtimeseries_type_id bigint not null +What type of timeseries this study is (or is not)<br>Controlled Vocabulary +References timeseries_type ( timeseries_type_id ) + Index ( lab_person_id ) +lab_person_idlab_person_id bigint +References study_person ( lab_person_id -> study_person_id ) + metadata_completemetadata_complete bool not null + mixs_compliantmixs_compliant bool not null + most_recent_contactmost_recent_contact varchar + number_samples_collectednumber_samples_collected integer not null + number_samples_promisednumber_samples_promised integer not null + Index ( portal_type_id ) +portal_type_idportal_type_id bigint not null +References portal_type ( portal_type_id ) + Index ( principal_investigator_id ) +principal_investigator_idprincipal_investigator_id bigint not null +References study_person ( principal_investigator_id -> study_person_id ) + reprocessreprocess bool not null + spatial_seriesspatial_series bool + study_titlestudy_title varchar not null + study_aliasstudy_alias varchar not null + study_descriptionstudy_description text not null + study_abstractstudy_abstract text not null + vamps_idvamps_id varchar study_usersTable qiita.study_users Links shared studies to users they are shared with - Primary Key ( study_id, email ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, email ) Index ( email ) -emailemail varchar not null -References qiita_user ( email ) + Primary Key ( study_id, email ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, email ) Index ( email ) +emailemail varchar not null +References qiita_user ( email ) required_sample_infoTable qiita.required_sample_info Required info for each sample. One row is one sample. - Primary Key ( study_id, sample_id ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, sample_id ) Unique Index ( sample_id ) -sample_idsample_id varchar not null -Referred by analysis_sample ( sample_id ) + <use id='nn' x='1352' y='132' xlink:href='#nn'/><a xlink:href='#study_id'><use id='pk' x='1352' y='131' xlink:href='#pk'/><title>Primary Key ( study_id, sample_id ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, sample_id ) Unique Index ( sample_id ) +sample_idsample_id varchar not null +Referred by analysis_sample ( sample_id ) Referred by common_prep_info ( sample_id ) - physical_locationphysical_location varchar not null + <use id='nn' x='1352' y='162' xlink:href='#nn'/><a xlink:href='#physical_location'><text x='1368' y='172'>physical_location</text><title>physical_location varchar not null Where the sample itself is stored - has_physical_specimenhas_physical_specimen bool not null + <use id='nn' x='1352' y='177' xlink:href='#nn'/><a xlink:href='#has_physical_specimen'><text x='1368' y='187'>has_physical_specimen</text><title>has_physical_specimen bool not null Whether we have the full speciment or just DNA - has_extracted_datahas_extracted_data bool not null - sample_typesample_type varchar not null + <use id='nn' x='1352' y='192' xlink:href='#nn'/><a xlink:href='#has_extracted_data'><text x='1368' y='202'>has_extracted_data</text><title>has_extracted_data bool not null + sample_typesample_type varchar not null Controlled vocabulary of sample types - Index ( required_sample_info_status_id ) -required_sample_info_status_idrequired_sample_info_status_id bigint not null + <use id='nn' x='1352' y='222' xlink:href='#nn'/><a xlink:href='#required_sample_info_status_id'><use id='idx' x='1352' y='221' xlink:href='#idx'/><title>Index ( required_sample_info_status_id ) +required_sample_info_status_idrequired_sample_info_status_id bigint not null What step of the pipeline the samples are in -References required_sample_info_status ( required_sample_info_status_id ) - collection_timestampcollection_timestamp timestamp not null - host_subject_idhost_subject_id varchar not null - descriptiondescription varchar not null +References required_sample_info_status ( required_sample_info_status_id ) + collection_timestampcollection_timestamp timestamp not null + host_subject_idhost_subject_id varchar not null + descriptiondescription varchar not null sample_xTable qiita.sample_x -data for samples in study x (sample template) -x is the study_id from study table - -MAKE SURE sample_id IS FK TO sample_id IN required_sample_info TABLE - Primary Key ( sample_id ) -sample_idsample_id varchar not null - descriptiondescription varchar not null - other_mapping_columnsother_mapping_columns varchar +data for samples in study x (sample template)<br>x is the study_id from study table<br><br>MAKE SURE sample_id IS FK TO sample_id IN required_sample_info TABLE + Primary Key ( sample_id ) +sample_idsample_id varchar not null + descriptiondescription varchar not null + other_mapping_columnsother_mapping_columns varchar Represents whatever other columns go with this study @@ -1368,292 +1272,291 @@ study_sample_columnsTable qiita.study_sample_columns Holds information on which metadata columns are available for the study sample template - Primary Key ( study_id, column_name, column_type ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, column_name, column_type ) -column_namecolumn_name varchar(100) not null - Primary Key ( study_id, column_name, column_type ) -column_typecolumn_type varchar not null + Primary Key ( study_id, column_name, column_type ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, column_name, column_type ) +column_namecolumn_name varchar(100) not null + Primary Key ( study_id, column_name, column_type ) +column_typecolumn_type varchar not null required_sample_info_statusTable qiita.required_sample_info_status - Primary Key ( required_sample_info_status_id ) -required_sample_info_status_idrequired_sample_info_status_id bigserial not null -Referred by required_sample_info ( required_sample_info_status_id ) - statusstatus varchar + Primary Key ( required_sample_info_status_id ) +required_sample_info_status_idrequired_sample_info_status_id bigserial not null +Referred by required_sample_info ( required_sample_info_status_id ) + statusstatus varchar prep_yTable qiita.prep_y -Information on how raw data y was prepared (prep template) -Linked by y being raw_data_id from raw data table. - Primary Key ( sample_id ) -sample_idsample_id varchar not null - datadata bigint +Information on how raw data y was prepared (prep template)<br>Linked by y being raw_data_id from raw data table. + Primary Key ( sample_id ) +sample_idsample_id varchar not null + datadata bigint STUFFFFF common_prep_infoTable qiita.common_prep_info - Index ( raw_data_id ) Primary Key ( raw_data_id, sample_id ) -raw_data_idraw_data_id bigserial not null -References raw_data ( raw_data_id ) - Primary Key ( raw_data_id, sample_id ) Index ( sample_id ) -sample_idsample_id varchar not null -References required_sample_info ( sample_id ) - center_namecenter_name varchar - center_project_namecenter_project_name varchar - ebi_submission_accessionebi_submission_accession varchar - ebi_study_accessionebi_study_accession varchar - Index ( emp_status_id ) -emp_status_idemp_status_id bigint not null -References emp_status ( emp_status_id ) - Index ( data_type_id ) -data_type_iddata_type_id bigint not null -References data_type ( data_type_id ) + Index ( raw_data_id ) Primary Key ( raw_data_id, sample_id ) +raw_data_idraw_data_id bigserial not null +References raw_data ( raw_data_id ) + Primary Key ( raw_data_id, sample_id ) Index ( sample_id ) +sample_idsample_id varchar not null +References required_sample_info ( sample_id ) + center_namecenter_name varchar + center_project_namecenter_project_name varchar + ebi_submission_accessionebi_submission_accession varchar + ebi_study_accessionebi_study_accession varchar + Index ( emp_status_id ) +emp_status_idemp_status_id bigint not null +References emp_status ( emp_status_id ) + Index ( data_type_id ) +data_type_iddata_type_id bigint not null +References data_type ( data_type_id ) emp_statusTable qiita.emp_status All possible statuses for projects relating to EMP. Whether they are part of, processed in accordance to, or not part of EMP. - Primary Key ( emp_status_id ) -emp_status_idemp_status_id bigserial not null -Referred by common_prep_info ( emp_status_id ) - emp_statusemp_status varchar not null + Primary Key ( emp_status_id ) +emp_status_idemp_status_id bigserial not null +Referred by common_prep_info ( emp_status_id ) + emp_statusemp_status varchar not null raw_data_prep_columnsTable qiita.raw_data_prep_columns Holds the columns available for a given raw data prep - Primary Key ( raw_data_id, column_name, column_type ) Index ( raw_data_id ) -raw_data_idraw_data_id bigint not null -References raw_data ( raw_data_id ) - Primary Key ( raw_data_id, column_name, column_type ) -column_namecolumn_name varchar not null - Primary Key ( raw_data_id, column_name, column_type ) -column_typecolumn_type varchar not null + Primary Key ( raw_data_id, column_name, column_type ) Index ( raw_data_id ) +raw_data_idraw_data_id bigint not null +References raw_data ( raw_data_id ) + Primary Key ( raw_data_id, column_name, column_type ) +column_namecolumn_name varchar not null + Primary Key ( raw_data_id, column_name, column_type ) +column_typecolumn_type varchar not null filetypeTable qiita.filetype Type of file (FASTA, FASTQ, SPECTRA, etc) - Primary Key ( filetype_id ) -filetype_idfiletype_id bigserial not null -Referred by raw_data ( filetype_id ) - typetype varchar not null + Primary Key ( filetype_id ) +filetype_idfiletype_id bigserial not null +Referred by raw_data ( filetype_id ) + typetype varchar not null raw_filepathTable qiita.raw_filepath - Primary Key ( raw_data_id, filepath_id ) Index ( raw_data_id ) -raw_data_idraw_data_id bigint not null -References raw_data ( raw_data_id ) - Primary Key ( raw_data_id, filepath_id ) Index ( filepath_id ) -filepath_idfilepath_id bigint not null -References filepath ( filepath_id ) + Primary Key ( raw_data_id, filepath_id ) Index ( raw_data_id ) +raw_data_idraw_data_id bigint not null +References raw_data ( raw_data_id ) + Primary Key ( raw_data_id, filepath_id ) Index ( filepath_id ) +filepath_idfilepath_id bigint not null +References filepath ( filepath_id ) preprocessed_processed_dataTable qiita.preprocessed_processed_data - Primary Key ( preprocessed_data_id, processed_data_id ) Index ( preprocessed_data_id ) -preprocessed_data_idpreprocessed_data_id bigint not null -References preprocessed_data ( preprocessed_data_id ) - Primary Key ( preprocessed_data_id, processed_data_id ) Index ( processed_data_id ) -processed_data_idprocessed_data_id bigint not null -References processed_data ( processed_data_id ) + Primary Key ( preprocessed_data_id, processed_data_id ) Index ( preprocessed_data_id ) +preprocessed_data_idpreprocessed_data_id bigint not null +References preprocessed_data ( preprocessed_data_id ) + Primary Key ( preprocessed_data_id, processed_data_id ) Index ( processed_data_id ) +processed_data_idprocessed_data_id bigint not null +References processed_data ( processed_data_id ) study_raw_dataTable qiita.study_raw_data links study to its raw data - Index ( study_id ) Primary Key ( study_id, raw_data_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, raw_data_id ) -raw_data_idraw_data_id bigint not null -References raw_data ( raw_data_id ) + Index ( study_id ) Primary Key ( study_id, raw_data_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, raw_data_id ) +raw_data_idraw_data_id bigint not null +References raw_data ( raw_data_id ) processed_params_uclustTable qiita.processed_params_uclust Parameters used for processing data using method uclust - Primary Key ( processed_params_id ) -processed_params_idprocessed_params_id bigserial not null - Index ( reference_id ) -reference_idreference_id bigint not null + <use id='nn' x='1397' y='957' xlink:href='#nn'/><a xlink:href='#processed_params_id'><use id='pk' x='1397' y='956' xlink:href='#pk'/><title>Primary Key ( processed_params_id ) +processed_params_idprocessed_params_id bigserial not null + Index ( reference_id ) +reference_idreference_id bigint not null What version of reference or type of reference used -References reference ( reference_id ) - similaritysimilarity float8 not null default 0.97 - enable_rev_strand_matchenable_rev_strand_match bool not null default TRUE - suppress_new_clusterssuppress_new_clusters bool not null default TRUE +References reference ( reference_id ) + similaritysimilarity float8 not null default 0.97 + enable_rev_strand_matchenable_rev_strand_match bool not null default TRUE + suppress_new_clusterssuppress_new_clusters bool not null default TRUE referenceTable qiita.reference - Primary Key ( reference_id ) -reference_idreference_id bigserial not null -Referred by processed_params_uclust ( reference_id ) - reference_namereference_name varchar not null - reference_versionreference_version varchar - sequence_filepathsequence_filepath varchar not null - taxonomy_filepathtaxonomy_filepath varchar - tree_filepathtree_filepath varchar + Primary Key ( reference_id ) +reference_idreference_id bigserial not null +Referred by processed_params_uclust ( reference_id ) + reference_namereference_name varchar not null + reference_versionreference_version varchar + sequence_filepathsequence_filepath varchar not null + taxonomy_filepathtaxonomy_filepath varchar + tree_filepathtree_filepath varchar preprocessed_sequence_illumina_paramsTable qiita.preprocessed_sequence_illumina_params Parameters used for processing illumina sequence data. - Primary Key ( preprocessed_params_id ) -preprocessed_params_idpreprocessed_params_id bigserial not null - trim_lengthtrim_length integer not null - max_bad_run_lengthmax_bad_run_length integer not null default 3 - min_per_read_length_fractionmin_per_read_length_fraction real not null default 0.75 - sequence_max_nsequence_max_n integer not null default 0 + Primary Key ( preprocessed_params_id ) +preprocessed_params_idpreprocessed_params_id bigserial not null + trim_lengthtrim_length integer not null + max_bad_run_lengthmax_bad_run_length integer not null default 3 + min_per_read_length_fractionmin_per_read_length_fraction real not null default 0.75 + sequence_max_nsequence_max_n integer not null default 0 preprocessed_spectra_paramsTable qiita.preprocessed_spectra_params Parameters used for processing spectra data. - Primary Key ( preprocessed_params_id ) -preprocessed_params_idpreprocessed_params_id bigserial not null - colcol varchar + Primary Key ( preprocessed_params_id ) +preprocessed_params_idpreprocessed_params_id bigserial not null + colcol varchar preprocessed_sequence_454_paramsTable qiita.preprocessed_sequence_454_params Parameters used for processing sequence data. - Primary Key ( preprocessed_params_id ) -preprocessed_params_idpreprocessed_params_id bigserial not null - trim_lengthtrim_length integer not null + Primary Key ( preprocessed_params_id ) +preprocessed_params_idpreprocessed_params_id bigserial not null + trim_lengthtrim_length integer not null timeseries_typeTable qiita.timeseries_type - Primary Key ( timeseries_type_id ) -timeseries_type_idtimeseries_type_id bigserial not null -Referred by study ( timeseries_type_id ) - timeseries_typetimeseries_type varchar not null + Primary Key ( timeseries_type_id ) +timeseries_type_idtimeseries_type_id bigserial not null +Referred by study ( timeseries_type_id ) + timeseries_typetimeseries_type varchar not null portal_typeTable qiita.portal_type What portals are available to show a study in - Primary Key ( portal_type_id ) -portal_type_idportal_type_id bigserial not null -Referred by study ( portal_type_id ) - portalportal varchar not null - descriptiondescription varchar not null + Primary Key ( portal_type_id ) +portal_type_idportal_type_id bigserial not null +Referred by study ( portal_type_id ) + portalportal varchar not null + descriptiondescription varchar not null raw_dataTable qiita.raw_data - Unique Index ( raw_data_id ) -raw_data_idraw_data_id bigserial not null -Referred by common_prep_info ( raw_data_id ) + <use id='nn' x='1232' y='507' xlink:href='#nn'/><a xlink:href='#raw_data_id'><use id='unq' x='1232' y='506' xlink:href='#unq'/><title>Unique Index ( raw_data_id ) +raw_data_idraw_data_id bigserial not null +Referred by common_prep_info ( raw_data_id ) Referred by raw_data_prep_columns ( raw_data_id ) Referred by raw_filepath ( raw_data_id ) Referred by raw_preprocessed_data ( raw_data_id ) Referred by study_raw_data ( raw_data_id ) - Index ( filetype_id ) -filetype_idfiletype_id bigint not null -References filetype ( filetype_id ) + Index ( filetype_id ) +filetype_idfiletype_id bigint not null +References filetype ( filetype_id ) raw_preprocessed_dataTable qiita.raw_preprocessed_data - Primary Key ( raw_data_id, preprocessed_data_id ) Index ( raw_data_id ) -raw_data_idraw_data_id bigint not null -References raw_data ( raw_data_id ) - Primary Key ( raw_data_id, preprocessed_data_id ) Index ( preprocessed_data_id ) -preprocessed_data_idpreprocessed_data_id bigint not null -References preprocessed_data ( preprocessed_data_id ) + Primary Key ( raw_data_id, preprocessed_data_id ) Index ( raw_data_id ) +raw_data_idraw_data_id bigint not null +References raw_data ( raw_data_id ) + Primary Key ( raw_data_id, preprocessed_data_id ) Index ( preprocessed_data_id ) +preprocessed_data_idpreprocessed_data_id bigint not null +References preprocessed_data ( preprocessed_data_id ) preprocessed_filepathTable qiita.preprocessed_filepath - Primary Key ( preprocessed_data_id, filepath_id ) Index ( preprocessed_data_id ) -preprocessed_data_idpreprocessed_data_id bigint not null -References preprocessed_data ( preprocessed_data_id ) - Primary Key ( preprocessed_data_id, filepath_id ) Index ( filepath_id ) -filepath_idfilepath_id bigint not null -References filepath ( filepath_id ) - - - - -processed_filepathTable qiita.processed_filepath - Unique Index ( processed_data_id ) -processed_data_idprocessed_data_id bigint not null -References processed_data ( processed_data_id ) - Index ( filepath_id ) -filepath_idfilepath_id bigint not null -References filepath ( filepath_id ) + Primary Key ( preprocessed_data_id, filepath_id ) Index ( preprocessed_data_id ) +preprocessed_data_idpreprocessed_data_id bigint not null +References preprocessed_data ( preprocessed_data_id ) + Primary Key ( preprocessed_data_id, filepath_id ) Index ( filepath_id ) +filepath_idfilepath_id bigint not null +References filepath ( filepath_id ) preprocessed_dataTable qiita.preprocessed_data - Primary Key ( preprocessed_data_id ) -preprocessed_data_idpreprocessed_data_id bigserial not null -Referred by preprocessed_filepath ( preprocessed_data_id ) + <use id='nn' x='1202' y='717' xlink:href='#nn'/><a xlink:href='#preprocessed_data_id'><use id='pk' x='1202' y='716' xlink:href='#pk'/><title>Primary Key ( preprocessed_data_id ) +preprocessed_data_idpreprocessed_data_id bigserial not null +Referred by preprocessed_filepath ( preprocessed_data_id ) Referred by preprocessed_processed_data ( preprocessed_data_id ) Referred by raw_preprocessed_data ( preprocessed_data_id ) Referred by study_preprocessed_data ( preprocessed_data_id ) - preprocessed_params_tablepreprocessed_params_table varchar not null + <use id='nn' x='1202' y='732' xlink:href='#nn'/><a xlink:href='#preprocessed_params_table'><text x='1218' y='742'>preprocessed_params_table</text><title>preprocessed_params_table varchar not null Name of table holding the params - preprocessed_params_idpreprocessed_params_id bigint not null - submitted_to_insdcsubmitted_to_insdc bool not null + preprocessed_params_idpreprocessed_params_id bigint not null + submitted_to_insdcsubmitted_to_insdc bool not null + + + + +processed_filepathTable qiita.processed_filepath + Primary Key ( processed_data_id, filepath_id ) +processed_data_idprocessed_data_id bigint not null +References processed_data ( processed_data_id ) + Primary Key ( processed_data_id, filepath_id ) +filepath_idfilepath_id bigint not null +References filepath ( filepath_id )


-
+
- + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1662,7 +1565,7 @@ - + @@ -1677,37 +1580,37 @@
Table term_synonym
term_synonym
synonym_id bigserial NOT NULL synonym_id bigserial NOT NULL
term_id bigint NOT NULL term_id bigint NOT NULL
synonym_value varchar NOT NULL synonym_value varchar NOT NULL
synonym_type_id bigint NOT NULL synonym_type_id bigint NOT NULL
Indexes
Indexes
pk_term_synonym primary key ON synonym_id ON term_id
Foreign Keys
Foreign Keys
fk_term_synonym_term ( term_id ) ref term (term_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1716,7 +1619,7 @@ - + @@ -1726,22 +1629,22 @@
Table controlled_vocab_values
controlled_vocab_values
vocab_value_id bigserial NOT NULL vocab_value_id bigserial NOT NULL
controlled_vocab_id bigint NOT NULL controlled_vocab_id bigint NOT NULL
term varchar NOT NULL term varchar NOT NULL
order_by varchar NOT NULL order_by varchar NOT NULL
default_item varchar default_item varchar
Indexes
Indexes
pk_controlled_vocab_values primary key ON vocab_value_id ON controlled_vocab_id
Foreign Keys
Foreign Keys
fk_controlled_vocab_values ( controlled_vocab_id ) ref controlled_vocabularies (controlled_vocab_id)


- +
- + - - - + + + - - - + + + - + @@ -1750,22 +1653,22 @@
Table controlled_vocabularies
controlled_vocabularies
controlled_vocab_id bigserial NOT NULL controlled_vocab_id bigserial NOT NULL
vocab_name varchar NOT NULL vocab_name varchar NOT NULL
Indexes
Indexes
pk_controlled_vocabularies primary key ON controlled_vocab_id


- +
- + - - - + + + - - - + + + - + @@ -1774,37 +1677,37 @@
Table severity
severity
severity_id serial NOT NULL severity_id serial NOT NULL
severity varchar NOT NULL severity varchar NOT NULL
Indexes
Indexes
pk_severity primary key ON severity_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1813,7 +1716,7 @@ - + @@ -1823,38 +1726,38 @@
Table logging
logging
log_id bigserial NOT NULL log_id bigserial NOT NULL
time timestamp NOT NULL Time the error was thrown time timestamp NOT NULL Time the error was thrown
severity_id integer NOT NULL severity_id integer NOT NULL
msg varchar NOT NULL Error message thrown msg varchar NOT NULL Error message thrown
information varchar Other applicable information (depending on error) information varchar Other applicable information (depending on error)
Indexes
Indexes
pk_logging primary key ON log_id ON severity_id
Foreign Keys
Foreign Keys
fk_logging_severity ( severity_id ) ref severity (severity_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1863,34 +1766,34 @@
Table study_person
study_person
Contact information for the various people involved in a study
study_person_id bigserial NOT NULL study_person_id bigserial NOT NULL
name varchar NOT NULL name varchar NOT NULL
email varchar NOT NULL email varchar NOT NULL
address varchar( 100 ) address varchar( 100 )
phone varchar phone varchar
Indexes
Indexes
pk_study_person primary key ON study_person_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1899,7 +1802,7 @@ - + @@ -1909,22 +1812,22 @@
Table investigation
investigation
Overarching investigation information. An investigation comprises one or more individual studies.
investigation_id bigserial NOT NULL investigation_id bigserial NOT NULL
name varchar NOT NULL name varchar NOT NULL
description varchar NOT NULL Describes the overarching goal of the investigation description varchar NOT NULL Describes the overarching goal of the investigation
contact_person_id bigint contact_person_id bigint
Indexes
Indexes
pk_investigation primary key ON investigation_id ON contact_person_id
Foreign Keys
Foreign Keys
fk_investigation_study_person ( contact_person_id ) ref study_person (study_person_id)


- +
- + - - - + + + - - - + + + - + @@ -1937,7 +1840,7 @@ - + @@ -1952,27 +1855,27 @@
Table investigation_study
investigation_study
investigation_id bigint NOT NULL investigation_id bigint NOT NULL
study_id bigint NOT NULL study_id bigint NOT NULL
Indexes
Indexes
idx_investigation_study primary key ON investigation_id, study_id ON study_id
Foreign Keys
Foreign Keys
fk_investigation_study ( investigation_id ) ref investigation (investigation_id)


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -1981,23 +1884,23 @@
Table study_status
study_status
study_status_id bigserial NOT NULL study_status_id bigserial NOT NULL
status varchar NOT NULL status varchar NOT NULL
description varchar NOT NULL description varchar NOT NULL
Indexes
Indexes
pk_study_status primary key ON study_status_id


- +
- + - - - + + + - - - + + + - + @@ -2006,7 +1909,7 @@ - + @@ -2016,23 +1919,23 @@
Table study_experimental_factor
study_experimental_factor
EFO ontological link of experimental factors to studies
study_id bigint NOT NULL study_id bigint NOT NULL
efo_id bigint NOT NULL efo_id bigint NOT NULL
Indexes
Indexes
idx_study_experimental_factor primary key ON study_id, efo_id ON study_id
Foreign Keys
Foreign Keys
fk_study_experimental_factor ( study_id ) ref study (study_id)


- +
- + - - - + + + - - - + + + - + @@ -2041,7 +1944,7 @@ - + @@ -2051,22 +1954,22 @@
Table study_pmid
study_pmid
Links a study to all PMIDs for papers created from study
study_id bigint NOT NULL study_id bigint NOT NULL
pmid varchar NOT NULL pmid varchar NOT NULL
Indexes
Indexes
idx_study_pmid primary key ON study_id, pmid ON study_id
Foreign Keys
Foreign Keys
fk_study_pmid_study ( study_id ) ref study (study_id)


- +
- + - - - + + + - - - + + + - + @@ -2075,43 +1978,43 @@
Table analysis_status
analysis_status
analysis_status_id bigserial NOT NULL analysis_status_id bigserial NOT NULL
status varchar NOT NULL status varchar NOT NULL
Indexes
Indexes
pk_analysis_status primary key ON analysis_status_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2124,7 +2027,7 @@ - + @@ -2139,23 +2042,23 @@
Table analysis
analysis
hHolds analysis information
analysis_id bigserial NOT NULL Unique identifier for analysis analysis_id bigserial NOT NULL Unique identifier for analysis
email varchar NOT NULL Email for user who owns the analysis email varchar NOT NULL Email for user who owns the analysis
name varchar NOT NULL Name of the analysis name varchar NOT NULL Name of the analysis
description varchar NOT NULL description varchar NOT NULL
analysis_status_id bigint NOT NULL analysis_status_id bigint NOT NULL
pmid varchar PMID of paper from the analysis pmid varchar PMID of paper from the analysis
Indexes
Indexes
pk_analysis primary key ON analysis_id ON analysis_status_id
Foreign Keys
Foreign Keys
fk_analysis_user ( email ) ref qiita_user (email)


- +
- + - - - + + + - - - + + + - + @@ -2168,7 +2071,7 @@ - + @@ -2183,23 +2086,23 @@
Table analysis_filepath
analysis_filepath
Stores link between analysis and the data file used for the analysis.
analysis_id bigint NOT NULL analysis_id bigint NOT NULL
filepath_id bigint NOT NULL filepath_id bigint NOT NULL
Indexes
Indexes
idx_analysis_filepath ON analysis_id ON analysis_id, filepath_id
Foreign Keys
Foreign Keys
fk_analysis_filepath ( analysis_id ) ref analysis (analysis_id)


- +
- + - - - + + + - - - + + + - + @@ -2212,7 +2115,7 @@ - + @@ -2227,42 +2130,42 @@
Table job_results_filepath
job_results_filepath
Holds connection between jobs and the result filepaths
job_id bigint NOT NULL job_id bigint NOT NULL
filepath_id bigint NOT NULL filepath_id bigint NOT NULL
Indexes
Indexes
idx_job_results_filepath primary key ON job_id, filepath_id ON filepath_id
Foreign Keys
Foreign Keys
fk_job_results_filepath ( job_id ) ref job (job_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2283,7 +2186,7 @@ - + @@ -2308,23 +2211,23 @@
Table job
job
job_id bigserial NOT NULL Unique identifier for job job_id bigserial NOT NULL Unique identifier for job
data_type_id bigint NOT NULL What datatype (16s, metabolome, etc) job is run on. data_type_id bigint NOT NULL What datatype (16s, metabolome, etc) job is run on.
job_status_id bigint NOT NULL job_status_id bigint NOT NULL
command_id bigint NOT NULL The Qiime or other function being run (alpha diversity, etc) command_id bigint NOT NULL The Qiime or other function being run (alpha diversity, etc)
options varchar Holds all options set for the job as a json string options varchar Holds all options set for the job as a json string
log_id bigint Reference to error if status is error log_id bigint Reference to error if status is error
Indexes
Indexes
pk_job primary key ON job_id ON log_id
Foreign Keys
Foreign Keys
fk_job_function ( command_id ) ref command (command_id)


- +
- + - - - + + + - - - + + + - + @@ -2337,7 +2240,7 @@ - + @@ -2352,24 +2255,24 @@
Table analysis_job
analysis_job
Holds information for a one-to-many relation of analysis to the jobs in it
analysis_id bigint NOT NULL Id of the analysis analysis_id bigint NOT NULL Id of the analysis
job_id bigint NOT NULL Id for a job that is part of the analysis job_id bigint NOT NULL Id for a job that is part of the analysis
Indexes
Indexes
idx_analysis_jobs primary key ON analysis_id, job_id ON job_id
Foreign Keys
Foreign Keys
fk_analysis_job_analysis ( analysis_id ) ref analysis (analysis_id)


- +
- + - - - + + + - - - + + + - + @@ -2382,7 +2285,7 @@ - + @@ -2397,22 +2300,22 @@
Table analysis_chain
analysis_chain
Keeps track of the chain of analysis edits. Tracks what previous analysis a given analysis came from. If a given analysis is not in child_id, it is the root of the chain.
parent_id bigint NOT NULL parent_id bigint NOT NULL
child_id bigint NOT NULL child_id bigint NOT NULL
Indexes
Indexes
idx_analysis_chain ON parent_id ON parent_id, child_id
Foreign Keys
Foreign Keys
fk_analysis_chain ( parent_id ) ref analysis (analysis_id)


- +
- + - - - + + + - - - + + + - + @@ -2421,28 +2324,28 @@
Table job_status
job_status
job_status_id bigserial NOT NULL job_status_id bigserial NOT NULL
status varchar NOT NULL status varchar NOT NULL
Indexes
Indexes
pk_job_status primary key ON job_status_id


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -2451,27 +2354,27 @@
Table command
command
Available commands for jobs
command_id bigserial NOT NULL Unique identifier for function command_id bigserial NOT NULL Unique identifier for function
name varchar NOT NULL name varchar NOT NULL
command varchar NOT NULL What command to call to run this function command varchar NOT NULL What command to call to run this function
Indexes
Indexes
pk_command primary key ON command_id


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -2484,7 +2387,7 @@ - + @@ -2504,23 +2407,23 @@
Table analysis_sample
analysis_sample
analysis_id bigint NOT NULL analysis_id bigint NOT NULL
processed_data_id bigint NOT NULL processed_data_id bigint NOT NULL
sample_id varchar NOT NULL sample_id varchar NOT NULL
Indexes
Indexes
idx_analysis_sample ON analysis_id ON sample_id
Foreign Keys
Foreign Keys
fk_analysis_sample_analysis ( analysis_id ) ref analysis (analysis_id)


- +
- + - - - + + + - - - + + + - + @@ -2533,7 +2436,7 @@ - + @@ -2548,42 +2451,42 @@
Table column_controlled_vocabularies
column_controlled_vocabularies
Table relates a column with a controlled vocabulary.
controlled_vocab_id bigserial NOT NULL controlled_vocab_id bigserial NOT NULL
column_name varchar NOT NULL column_name varchar NOT NULL
Indexes
Indexes
idx_column_controlled_vocabularies primary key ON controlled_vocab_id, column_name ON controlled_vocab_id
Foreign Keys
Foreign Keys
fk_column_controlled_vocabularies ( column_name ) ref mixs_field_description (column_name)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2592,33 +2495,33 @@
Table mixs_field_description
mixs_field_description
column_name varchar NOT NULL column_name varchar NOT NULL
data_type varchar NOT NULL data_type varchar NOT NULL
desc_or_value varchar NOT NULL desc_or_value varchar NOT NULL
definition varchar NOT NULL definition varchar NOT NULL
min_length integer min_length integer
active integer NOT NULL active integer NOT NULL
Indexes
Indexes
pk_mixs_field_description primary key ON column_name


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2627,7 +2530,7 @@ - + @@ -2637,37 +2540,37 @@
Table column_ontology
column_ontology
This table relates a column with an ontology.
column_name varchar NOT NULL column_name varchar NOT NULL
ontology_short_name varchar NOT NULL ontology_short_name varchar NOT NULL
bioportal_id integer NOT NULL bioportal_id integer NOT NULL
ontology_branch_id integer NOT NULL ontology_branch_id integer NOT NULL
Indexes
Indexes
idx_column_ontology primary key ON column_name, ontology_short_name ON column_name
Foreign Keys
Foreign Keys
fk_column_ontology ( column_name ) ref mixs_field_description (column_name)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2688,7 +2591,7 @@ - + @@ -2713,47 +2616,47 @@
Table term_relationship
term_relationship
term_relationship_id bigserial NOT NULL term_relationship_id bigserial NOT NULL
subject_term_id bigint NOT NULL subject_term_id bigint NOT NULL
predicate_term_id bigint NOT NULL predicate_term_id bigint NOT NULL
object_term_id bigint NOT NULL object_term_id bigint NOT NULL
ontology_id bigint NOT NULL ontology_id bigint NOT NULL
Indexes
Indexes
pk_term_relationship primary key ON term_relationship_id ON ontology_id
Foreign Keys
Foreign Keys
fk_term_relationship_subj_term ( subject_term_id ) ref term (term_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2778,7 +2681,7 @@ - + @@ -2808,57 +2711,57 @@
Table term_path
term_path
term_path_id bigserial NOT NULL term_path_id bigserial NOT NULL
subject_term_id bigint NOT NULL subject_term_id bigint NOT NULL
predicate_term_id bigint NOT NULL predicate_term_id bigint NOT NULL
object_term_id bigint NOT NULL object_term_id bigint NOT NULL
ontology_id bigint NOT NULL ontology_id bigint NOT NULL
relationship_type_id integer NOT NULL relationship_type_id integer NOT NULL
distance integer distance integer
Indexes
Indexes
pk_term_path primary key ON term_path_id ON object_term_id
Foreign Keys
Foreign Keys
fk_term_path_ontology ( ontology_id ) ref ontology (ontology_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2867,57 +2770,57 @@
Table ontology
ontology
ontology_id bigserial NOT NULL ontology_id bigserial NOT NULL
shortname varchar NOT NULL shortname varchar NOT NULL
fully_loaded bool NOT NULL fully_loaded bool NOT NULL
fullname varchar fullname varchar
query_url varchar query_url varchar
source_url varchar source_url varchar
definition text definition text
load_date date NOT NULL load_date date NOT NULL
version varchar version varchar
Indexes
Indexes
pk_ontology primary key ON ontology_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2926,7 +2829,7 @@ - + @@ -2936,37 +2839,37 @@
Table term
term
term_id bigserial NOT NULL term_id bigserial NOT NULL
ontology_id bigint NOT NULL ontology_id bigint NOT NULL
term_name varchar NOT NULL term_name varchar NOT NULL
identifier varchar identifier varchar
definition varchar definition varchar
namespace varchar namespace varchar
is_obsolete bool NOT NULL DEFO 'false' is_obsolete bool NOT NULL DEFO 'false'
is_root_term bool NOT NULL is_root_term bool NOT NULL
is_leaf bool NOT NULL is_leaf bool NOT NULL
Indexes
Indexes
pk_term primary key ON term_id ON ontology_id
Foreign Keys
Foreign Keys
fk_term_ontology ( ontology_id ) ref ontology (ontology_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2975,7 +2878,7 @@ - + @@ -2985,42 +2888,42 @@
Table annotation
annotation
annotation_id bigserial NOT NULL annotation_id bigserial NOT NULL
term_id bigint NOT NULL term_id bigint NOT NULL
annotation_name varchar NOT NULL annotation_name varchar NOT NULL
annotation_num_value bigint annotation_num_value bigint
annotation_str_value varchar annotation_str_value varchar
Indexes
Indexes
pk_annotation primary key ON annotation_id ON term_id
Foreign Keys
Foreign Keys
fk_annotation_term ( term_id ) ref term (term_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3029,7 +2932,7 @@ - + @@ -3039,22 +2942,22 @@
Table dbxref
dbxref
dbxref_id bigserial NOT NULL dbxref_id bigserial NOT NULL
term_id bigint NOT NULL term_id bigint NOT NULL
dbname varchar NOT NULL dbname varchar NOT NULL
accession varchar NOT NULL accession varchar NOT NULL
description varchar NOT NULL description varchar NOT NULL
xref_type varchar NOT NULL xref_type varchar NOT NULL
Indexes
Indexes
pk_dbxref primary key ON dbxref_id ON term_id
Foreign Keys
Foreign Keys
fk_dbxref_term ( term_id ) ref term (term_id)


- +
- + - - - + + + - - - + + + - + @@ -3063,23 +2966,23 @@
Table relationship_type
relationship_type
relationship_type_id bigserial NOT NULL relationship_type_id bigserial NOT NULL
relationship_type varchar NOT NULL relationship_type varchar NOT NULL
Indexes
Indexes
pk_relationship_type primary key ON relationship_type_id


- +
- + - - - + + + - - - + + + - + @@ -3092,7 +2995,7 @@ - + @@ -3107,28 +3010,28 @@
Table analysis_users
analysis_users
Links analyses to the users they are shared with
analysis_id bigint NOT NULL analysis_id bigint NOT NULL
email varchar NOT NULL email varchar NOT NULL
Indexes
Indexes
idx_analysis_users primary key ON analysis_id, email ON email
Foreign Keys
Foreign Keys
fk_analysis_users_analysis ( analysis_id ) ref analysis (analysis_id)


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -3137,63 +3040,63 @@
Table user_level
user_level
Holds available user levels
user_level_id serial NOT NULL user_level_id serial NOT NULL
name varchar NOT NULL One of the user levels (admin, user, guest, etc) name varchar NOT NULL One of the user levels (admin, user, guest, etc)
description text NOT NULL description text NOT NULL
Indexes
Indexes
pk_user_level primary key ON user_level_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3202,7 +3105,7 @@ - + @@ -3212,22 +3115,22 @@
Table qiita_user
qiita_user
Holds all user information
email varchar NOT NULL email varchar NOT NULL
user_level_id integer NOT NULL DEFO 5 user level user_level_id integer NOT NULL DEFO 5 user level
password varchar NOT NULL password varchar NOT NULL
name varchar name varchar
affiliation varchar affiliation varchar
address varchar address varchar
phone varchar phone varchar
user_verify_code varchar Code for initial user email verification user_verify_code varchar Code for initial user email verification
pass_reset_code varchar Randomly generated code for password reset pass_reset_code varchar Randomly generated code for password reset
pass_reset_timestamp timestamp Time the reset code was generated pass_reset_timestamp timestamp Time the reset code was generated
Indexes
Indexes
pk_user primary key ON email ON user_level_id
Foreign Keys
Foreign Keys
fk_user_user_level ( user_level_id ) ref user_level (user_level_id)


- +
- + - - - + + + - - - + + + - + @@ -3236,22 +3139,22 @@
Table filepath_type
filepath_type
filepath_type_id bigserial NOT NULL filepath_type_id bigserial NOT NULL
filepath_type varchar filepath_type varchar
Indexes
Indexes
pk_filepath_type primary key ON filepath_type_id


- +
- + - - - + + + - - - + + + - + @@ -3260,22 +3163,22 @@
Table checksum_algorithm
checksum_algorithm
checksum_algorithm_id bigserial NOT NULL checksum_algorithm_id bigserial NOT NULL
name varchar NOT NULL name varchar NOT NULL
Indexes
Indexes
pk_checksum_algorithm primary key ON checksum_algorithm_id


- +
- + - - - + + + - - - + + + - + @@ -3284,37 +3187,37 @@
Table data_type
data_type
data_type_id bigserial NOT NULL data_type_id bigserial NOT NULL
data_type varchar NOT NULL Data type (16S, metabolome, etc) the job will use data_type varchar NOT NULL Data type (16S, metabolome, etc) the job will use
Indexes
Indexes
pk_data_type primary key ON data_type_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3323,7 +3226,7 @@ - + @@ -3338,32 +3241,32 @@
Table filepath
filepath
filepath_id bigserial NOT NULL filepath_id bigserial NOT NULL
filepath varchar NOT NULL filepath varchar NOT NULL
filepath_type_id bigint NOT NULL filepath_type_id bigint NOT NULL
checksum varchar NOT NULL checksum varchar NOT NULL
checksum_algorithm_id bigint NOT NULL checksum_algorithm_id bigint NOT NULL
Indexes
Indexes
pk_filepath primary key ON filepath_id ON filepath_type_id
Foreign Keys
Foreign Keys
fk_filepath ( filepath_type_id ) ref filepath_type (filepath_type_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3372,22 +3275,22 @@
Table processed_data
processed_data
processed_data_id bigserial NOT NULL processed_data_id bigserial NOT NULL
processed_params_table varchar NOT NULL Name of table holding processing params processed_params_table varchar NOT NULL Name of table holding processing params
processed_params_id bigint NOT NULL Link to a table with the parameters used to generate processed data processed_params_id bigint NOT NULL Link to a table with the parameters used to generate processed data
processed_date timestamp NOT NULL processed_date timestamp NOT NULL
Indexes
Indexes
pk_processed_data primary key ON processed_data_id


- +
- + - - - + + + - - - + + + - + @@ -3400,7 +3303,7 @@ - + @@ -3415,123 +3318,123 @@
Table study_preprocessed_data
study_preprocessed_data
study_id bigint NOT NULL study_id bigint NOT NULL
preprocessed_data_id bigint NOT NULL preprocessed_data_id bigint NOT NULL
Indexes
Indexes
idx_study_preprocessed_data primary key ON study_id, preprocessed_data_id ON preprocessed_data_id
Foreign Keys
Foreign Keys
fk_study_preprocessed_data ( study_id ) ref study (study_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3564,7 +3467,7 @@ - + @@ -3604,23 +3507,23 @@
Table study
study
study_id bigserial NOT NULL Unique name for study study_id bigserial NOT NULL Unique name for study
email varchar NOT NULL Email of study owner email varchar NOT NULL Email of study owner
study_status_id bigint NOT NULL study_status_id bigint NOT NULL
emp_person_id bigint emp_person_id bigint
first_contact varchar NOT NULL first_contact varchar NOT NULL
funding varchar funding varchar
timeseries_type_id bigint NOT NULL What type of timeseries this study is (or is not) + timeseries_type_id bigint NOT NULL What type of timeseries this study is (or is not) Controlled Vocabulary
lab_person_id bigint lab_person_id bigint
metadata_complete bool NOT NULL metadata_complete bool NOT NULL
mixs_compliant bool NOT NULL mixs_compliant bool NOT NULL
most_recent_contact varchar most_recent_contact varchar
number_samples_collected integer NOT NULL number_samples_collected integer NOT NULL
number_samples_promised integer NOT NULL number_samples_promised integer NOT NULL
portal_type_id bigint NOT NULL portal_type_id bigint NOT NULL
principal_investigator_id bigint NOT NULL principal_investigator_id bigint NOT NULL
reprocess bool NOT NULL reprocess bool NOT NULL
spatial_series bool spatial_series bool
study_title varchar NOT NULL study_title varchar NOT NULL
study_alias varchar NOT NULL study_alias varchar NOT NULL
study_description text NOT NULL study_description text NOT NULL
study_abstract text NOT NULL study_abstract text NOT NULL
vamps_id varchar vamps_id varchar
Indexes
Indexes
pk_study primary key ON study_id ON portal_type_id
Foreign Keys
Foreign Keys
fk_study_user ( email ) ref qiita_user (email)


- +
- + - - - + + + - - - + + + - + @@ -3633,7 +3536,7 @@ - + @@ -3648,63 +3551,63 @@
Table study_users
study_users
Links shared studies to users they are shared with
study_id bigint NOT NULL study_id bigint NOT NULL
email varchar NOT NULL email varchar NOT NULL
Indexes
Indexes
idx_study_users primary key ON study_id, email ON email
Foreign Keys
Foreign Keys
fk_study_users_study ( study_id ) ref study (study_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3721,7 +3624,7 @@ - + @@ -3736,9 +3639,9 @@
Table required_sample_info
required_sample_info
Required info for each sample. One row is one sample.
study_id bigint NOT NULL study_id bigint NOT NULL
sample_id varchar NOT NULL sample_id varchar NOT NULL
physical_location varchar NOT NULL Where the sample itself is stored physical_location varchar NOT NULL Where the sample itself is stored
has_physical_specimen bool NOT NULL Whether we have the full speciment or just DNA has_physical_specimen bool NOT NULL Whether we have the full speciment or just DNA
has_extracted_data bool NOT NULL has_extracted_data bool NOT NULL
sample_type varchar NOT NULL Controlled vocabulary of sample types sample_type varchar NOT NULL Controlled vocabulary of sample types
required_sample_info_status_id bigint NOT NULL What step of the pipeline the samples are in required_sample_info_status_id bigint NOT NULL What step of the pipeline the samples are in
collection_timestamp timestamp NOT NULL collection_timestamp timestamp NOT NULL
host_subject_id varchar NOT NULL host_subject_id varchar NOT NULL
description varchar NOT NULL description varchar NOT NULL
Indexes
Indexes
idx_common_sample_information primary key ON study_id, sample_id ON sample_id
Foreign Keys
Foreign Keys
fk_required_sample_info_study ( study_id ) ref study (study_id)


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -3769,28 +3672,28 @@
Table sample_x
sample_x
data for samples in study x (sample template) x is the study_id from study table @@ -3746,21 +3649,21 @@
sample_id varchar NOT NULL sample_id varchar NOT NULL
description varchar NOT NULL description varchar NOT NULL
other_mapping_columns varchar Represents whatever other columns go with this study other_mapping_columns varchar Represents whatever other columns go with this study
Indexes
Indexes
pk_study_x_y primary key ON sample_id


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -3799,7 +3702,7 @@ - + @@ -3809,22 +3712,22 @@
Table study_sample_columns
study_sample_columns
Holds information on which metadata columns are available for the study sample template
study_id bigint NOT NULL study_id bigint NOT NULL
column_name varchar( 100 ) NOT NULL column_name varchar( 100 ) NOT NULL
column_type varchar NOT NULL column_type varchar NOT NULL
Indexes
Indexes
idx_study_mapping_columns primary key ON study_id, column_name, column_type ON study_id
Foreign Keys
Foreign Keys
fk_study_mapping_columns_study ( study_id ) ref study (study_id)


- +
- + - - - + + + - - - + + + - + @@ -3833,24 +3736,24 @@
Table required_sample_info_status
required_sample_info_status
required_sample_info_status_id bigserial NOT NULL required_sample_info_status_id bigserial NOT NULL
status varchar status varchar
Indexes
Indexes
pk_sample_status primary key ON required_sample_info_status_id


- +
- + - - - + + + - - - + + + - + @@ -3859,52 +3762,52 @@
Table prep_y
prep_y
Information on how raw data y was prepared (prep template) Linked by y being raw_data_id from raw data table.
sample_id varchar NOT NULL sample_id varchar NOT NULL
data bigint STUFFFFF data bigint STUFFFFF
Indexes
Indexes
pk_prep_y primary key ON sample_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3925,7 +3828,7 @@ - + @@ -3950,23 +3853,23 @@
Table common_prep_info
common_prep_info
raw_data_id bigserial NOT NULL raw_data_id bigserial NOT NULL
sample_id varchar NOT NULL sample_id varchar NOT NULL
center_name varchar center_name varchar
center_project_name varchar center_project_name varchar
ebi_submission_accession varchar ebi_submission_accession varchar
ebi_study_accession varchar ebi_study_accession varchar
emp_status_id bigint NOT NULL emp_status_id bigint NOT NULL
data_type_id bigint NOT NULL data_type_id bigint NOT NULL
Indexes
Indexes
idx_required_prep_info ON raw_data_id ON data_type_id
Foreign Keys
Foreign Keys
fk_required_prep_info_raw_data ( raw_data_id ) ref raw_data (raw_data_id)


- +
- + - - - + + + - - - + + + - + @@ -3975,28 +3878,28 @@
Table emp_status
emp_status
All possible statuses for projects relating to EMP. Whether they are part of, processed in accordance to, or not part of EMP.
emp_status_id bigserial NOT NULL emp_status_id bigserial NOT NULL
emp_status varchar NOT NULL emp_status varchar NOT NULL
Indexes
Indexes
pk_emp_status primary key ON emp_status_id


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -4005,7 +3908,7 @@ - + @@ -4015,23 +3918,23 @@
Table raw_data_prep_columns
raw_data_prep_columns
Holds the columns available for a given raw data prep
raw_data_id bigint NOT NULL raw_data_id bigint NOT NULL
column_name varchar NOT NULL column_name varchar NOT NULL
column_type varchar NOT NULL column_type varchar NOT NULL
Indexes
Indexes
idx_raw_data_prep_columns primary key ON raw_data_id, column_name, column_type ON raw_data_id
Foreign Keys
Foreign Keys
fk_prep_columns_raw_data ( raw_data_id ) ref raw_data (raw_data_id)


- +
- + - - - + + + - - - + + + - + @@ -4040,22 +3943,22 @@
Table filetype
filetype
Type of file (FASTA, FASTQ, SPECTRA, etc)
filetype_id bigserial NOT NULL filetype_id bigserial NOT NULL
type varchar NOT NULL type varchar NOT NULL
Indexes
Indexes
pk_filetype primary key ON filetype_id


- +
- + - - - + + + - - - + + + - + @@ -4068,7 +3971,7 @@ - + @@ -4083,22 +3986,22 @@
Table raw_filepath
raw_filepath
raw_data_id bigint NOT NULL raw_data_id bigint NOT NULL
filepath_id bigint NOT NULL filepath_id bigint NOT NULL
Indexes
Indexes
idx_raw_filepath primary key ON raw_data_id, filepath_id ON raw_data_id
Foreign Keys
Foreign Keys
fk_raw_filepath ( filepath_id ) ref filepath (filepath_id)


- +
- + - - - + + + - - - + + + - + @@ -4111,7 +4014,7 @@ - + @@ -4126,23 +4029,23 @@
Table preprocessed_processed_data
preprocessed_processed_data
preprocessed_data_id bigint NOT NULL preprocessed_data_id bigint NOT NULL
processed_data_id bigint NOT NULL processed_data_id bigint NOT NULL
Indexes
Indexes
idx_preprocessed_processed_data primary key ON preprocessed_data_id, processed_data_id ON processed_data_id
Foreign Keys
Foreign Keys
fk_preprocessed_processed_data ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id)


- +
- + - - - + + + - - - + + + - + @@ -4151,7 +4054,7 @@ - + @@ -4166,38 +4069,38 @@
Table study_raw_data
study_raw_data
links study to its raw data
study_id bigint NOT NULL study_id bigint NOT NULL
raw_data_id bigint NOT NULL raw_data_id bigint NOT NULL
Indexes
Indexes
idx_study_raw_data ON study_id ON study_id, raw_data_id
Foreign Keys
Foreign Keys
fk_study_raw_data_study ( study_id ) ref study (study_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -4206,7 +4109,7 @@ - + @@ -4216,42 +4119,42 @@
Table processed_params_uclust
processed_params_uclust
Parameters used for processing data using method uclust
processed_params_id bigserial NOT NULL processed_params_id bigserial NOT NULL
reference_id bigint NOT NULL What version of reference or type of reference used reference_id bigint NOT NULL What version of reference or type of reference used
similarity float8 NOT NULL DEFO 0.97 similarity float8 NOT NULL DEFO 0.97
enable_rev_strand_match bool NOT NULL DEFO TRUE enable_rev_strand_match bool NOT NULL DEFO TRUE
suppress_new_clusters bool NOT NULL DEFO TRUE suppress_new_clusters bool NOT NULL DEFO TRUE
Indexes
Indexes
pk_processed_params_uclust primary key ON processed_params_id ON reference_id
Foreign Keys
Foreign Keys
fk_processed_params_uclust ( reference_id ) ref reference (reference_id)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -4260,38 +4163,38 @@
Table reference
reference
reference_id bigserial NOT NULL reference_id bigserial NOT NULL
reference_name varchar NOT NULL reference_name varchar NOT NULL
reference_version varchar reference_version varchar
sequence_filepath varchar NOT NULL sequence_filepath varchar NOT NULL
taxonomy_filepath varchar taxonomy_filepath varchar
tree_filepath varchar tree_filepath varchar
Indexes
Indexes
pk_reference primary key ON reference_id


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -4300,23 +4203,23 @@
Table preprocessed_sequence_illumina_params
preprocessed_sequence_illumina_params
Parameters used for processing illumina sequence data.
preprocessed_params_id bigserial NOT NULL preprocessed_params_id bigserial NOT NULL
trim_length integer NOT NULL trim_length integer NOT NULL
max_bad_run_length integer NOT NULL DEFO 3 max_bad_run_length integer NOT NULL DEFO 3
min_per_read_length_fraction real NOT NULL DEFO 0.75 min_per_read_length_fraction real NOT NULL DEFO 0.75
sequence_max_n integer NOT NULL DEFO 0 sequence_max_n integer NOT NULL DEFO 0
Indexes
Indexes
pk_preprocessed_sequence_illumina_params primary key ON preprocessed_params_id


- +
- + - - - + + + - - - + + + - + @@ -4325,23 +4228,23 @@
Table preprocessed_spectra_params
preprocessed_spectra_params
Parameters used for processing spectra data.
preprocessed_params_id bigserial NOT NULL preprocessed_params_id bigserial NOT NULL
col varchar col varchar
Indexes
Indexes
pk_preprocessed_spectra_params primary key ON preprocessed_params_id


- +
- + - - - + + + - - - + + + - + @@ -4350,22 +4253,22 @@
Table preprocessed_sequence_454_params
preprocessed_sequence_454_params
Parameters used for processing sequence data.
preprocessed_params_id bigserial NOT NULL preprocessed_params_id bigserial NOT NULL
trim_length integer NOT NULL trim_length integer NOT NULL
Indexes
Indexes
pk_preprocessed_sequence_454_params primary key ON preprocessed_params_id


- +
- + - - - + + + - - - + + + - + @@ -4374,28 +4277,28 @@
Table timeseries_type
timeseries_type
timeseries_type_id bigserial NOT NULL timeseries_type_id bigserial NOT NULL
timeseries_type varchar NOT NULL timeseries_type varchar NOT NULL
Indexes
Indexes
pk_timeseries_type primary key ON timeseries_type_id


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -4404,22 +4307,22 @@
Table portal_type
portal_type
What portals are available to show a study in
portal_type_id bigserial NOT NULL portal_type_id bigserial NOT NULL
portal varchar NOT NULL portal varchar NOT NULL
description varchar NOT NULL description varchar NOT NULL
Indexes
Indexes
pk_portal_type primary key ON portal_type_id


- +
- + - - - + + + - - - + + + - + @@ -4428,7 +4331,7 @@ - + @@ -4438,22 +4341,22 @@
Table raw_data
raw_data
raw_data_id bigserial NOT NULL raw_data_id bigserial NOT NULL
filetype_id bigint NOT NULL filetype_id bigint NOT NULL
Indexes
Indexes
pk_raw_data unique ON raw_data_id ON filetype_id
Foreign Keys
Foreign Keys
fk_raw_data_filetype ( filetype_id ) ref filetype (filetype_id)


- +
- + - - - + + + - - - + + + - + @@ -4466,7 +4369,7 @@ - + @@ -4481,22 +4384,22 @@
Table raw_preprocessed_data
raw_preprocessed_data
raw_data_id bigint NOT NULL raw_data_id bigint NOT NULL
preprocessed_data_id bigint NOT NULL preprocessed_data_id bigint NOT NULL
Indexes
Indexes
idx_raw_preprocessed_data primary key ON raw_data_id, preprocessed_data_id ON preprocessed_data_id
Foreign Keys
Foreign Keys
fk_raw_preprocessed_data ( raw_data_id ) ref raw_data (raw_data_id)


- +
- + - - - + + + - - - + + + - + @@ -4509,7 +4412,7 @@ - + @@ -4524,73 +4427,69 @@
Table preprocessed_filepath
preprocessed_filepath
preprocessed_data_id bigint NOT NULL preprocessed_data_id bigint NOT NULL
filepath_id bigint NOT NULL filepath_id bigint NOT NULL
Indexes
Indexes
idx_preprocessed_filepath primary key ON preprocessed_data_id, filepath_id ON filepath_id
Foreign Keys
Foreign Keys
fk_preprocessed_filepath ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id)


- +
- + - - - + + + - - - + + + - - - - - - - - - - - - - + + + - - + + + + + + +
Table processed_filepath
preprocessed_data
processed_data_id bigint NOT NULL preprocessed_data_id bigserial NOT NULL
filepath_id bigint NOT NULL preprocessed_params_table varchar NOT NULL Name of table holding the params
Indexes
pk_processed_data_filepath unique ON processed_data_id
idx_processed_data_filepath ON filepath_id
Foreign Keys
fk_processed_data_filepath ( processed_data_id ) ref processed_data (processed_data_id) preprocessed_params_id bigint NOT NULL
fk_processed_data_filepath_0 ( filepath_id ) ref filepath (filepath_id) submitted_to_insdc bool NOT NULL
Indexes
pk_preprocessed_data primary key ON preprocessed_data_id


- +
- + - - - + + + - - - + + + - - - + + + + - - + + - - - + + + diff --git a/qiita_db/support_files/qiita-db.sql b/qiita_db/support_files/qiita-db.sql index ad74bd748..992d8e03c 100644 --- a/qiita_db/support_files/qiita-db.sql +++ b/qiita_db/support_files/qiita-db.sql @@ -99,6 +99,17 @@ CREATE TABLE qiita.portal_type ( COMMENT ON TABLE qiita.portal_type IS 'What portals are available to show a study in'; +CREATE TABLE qiita.prep_y ( + sample_id varchar NOT NULL, + data bigint , + CONSTRAINT pk_prep_y PRIMARY KEY ( sample_id ) + ); + +COMMENT ON TABLE qiita.prep_y IS 'Information on how raw data y was prepared (prep template) +Linked by y being raw_data_id from raw data table.'; + +COMMENT ON COLUMN qiita.prep_y.data IS 'STUFFFFF'; + CREATE TABLE qiita.preprocessed_data ( preprocessed_data_id bigserial NOT NULL, preprocessed_params_table varchar NOT NULL, @@ -203,6 +214,20 @@ CREATE TABLE qiita.required_sample_info_status ( CONSTRAINT pk_sample_status PRIMARY KEY ( required_sample_info_status_id ) ); +CREATE TABLE qiita.sample_x ( + sample_id varchar NOT NULL, + description varchar NOT NULL, + other_mapping_columns varchar , + CONSTRAINT pk_study_x_y PRIMARY KEY ( sample_id ) + ); + +COMMENT ON TABLE qiita.sample_x IS 'data for samples in study x (sample template) +x is the study_id from study table + +MAKE SURE sample_id IS FK TO sample_id IN required_sample_info TABLE'; + +COMMENT ON COLUMN qiita.sample_x.other_mapping_columns IS 'Represents whatever other columns go with this study'; + CREATE TABLE qiita.severity ( severity_id serial NOT NULL, severity varchar NOT NULL, @@ -456,13 +481,11 @@ CREATE INDEX idx_preprocessed_processed_data_1 ON qiita.preprocessed_processed_d CREATE TABLE qiita.processed_filepath ( processed_data_id bigint NOT NULL, filepath_id bigint NOT NULL, - CONSTRAINT pk_processed_data_filepath UNIQUE ( processed_data_id ) , + CONSTRAINT idx_processed_filepath PRIMARY KEY ( processed_data_id, filepath_id ), CONSTRAINT fk_processed_data_filepath FOREIGN KEY ( processed_data_id ) REFERENCES qiita.processed_data( processed_data_id ) , CONSTRAINT fk_processed_data_filepath_0 FOREIGN KEY ( filepath_id ) REFERENCES qiita.filepath( filepath_id ) ); -CREATE INDEX idx_processed_data_filepath ON qiita.processed_filepath ( filepath_id ); - CREATE TABLE qiita.processed_params_uclust ( processed_params_id bigserial NOT NULL, reference_id bigint NOT NULL, From a682de3e53d8ca4a05757db6896122bae917b329 Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Thu, 19 Jun 2014 23:45:36 -0600 Subject: [PATCH 4/8] Fix handling of preprocessed_data_id --- qiita_db/commands.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qiita_db/commands.py b/qiita_db/commands.py index 20b135afd..a9a7036f2 100644 --- a/qiita_db/commands.py +++ b/qiita_db/commands.py @@ -145,6 +145,8 @@ def load_processed_data_cmd(fps, fp_types, processed_params_table_name, if preprocessed_data_id is not None: preprocessed_data = PreprocessedData(preprocessed_data_id) + else: + preprocessed_data = None return ProcessedData.create(processed_params_table_name, processed_params_id, list(zip(fps, fp_types)), From 563dc68dd9a36d06aaab255098fd21b48c9ea776 Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Thu, 19 Jun 2014 23:52:32 -0600 Subject: [PATCH 5/8] Add second biom table to test --- qiita_db/test/test_commands.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/qiita_db/test/test_commands.py b/qiita_db/test/test_commands.py index 9d7568092..9e90f260b 100644 --- a/qiita_db/test/test_commands.py +++ b/qiita_db/test/test_commands.py @@ -154,12 +154,17 @@ class TestLoadProcessedDataFromCmd(TestCase): def setUp(self): fd, self.otu_table_fp = mkstemp(suffix='_otu_table.biom') close(fd) + fd, self.otu_table_2_fp = mkstemp(suffix='_otu_table2.biom') + close(fd) with open(self.otu_table_fp, "w") as f: f.write("\n") + with open(self.otu_table_2_fp, "w") as f: + f.write("\n") self.files_to_remove = [] self.files_to_remove.append(self.otu_table_fp) + self.files_to_remove.append(self.otu_table_2_fp) self.db_test_processed_data_dir = join(get_db_files_base_dir(), 'processed_data') @@ -170,8 +175,8 @@ def tearDown(self): remove(fp) def test_load_processed_data_from_cmd(self): - filepaths = [self.otu_table_fp] - filepath_types = ['biom'] + filepaths = [self.otu_table_fp, self.otu_table_2_fp] + filepath_types = ['biom', 'biom'] initial_processed_data_count = get_count('qiita.processed_data') initial_processed_fp_count = get_count('qiita.processed_filepath') @@ -183,19 +188,23 @@ def test_load_processed_data_from_cmd(self): self.files_to_remove.append( join(self.db_test_processed_data_dir, '%d_%s' % (processed_data_id, basename(self.otu_table_fp)))) + self.files_to_remove.append( + join(self.db_test_processed_data_dir, + '%d_%s' % (processed_data_id, + basename(self.otu_table_2_fp)))) self.assertTrue(check_count('qiita.processed_data', initial_processed_data_count + 1)) self.assertTrue(check_count('qiita.processed_filepath', - initial_processed_fp_count + 1)) + initial_processed_fp_count + 2)) self.assertTrue(check_count('qiita.filepath', - initial_fp_count + 1)) + initial_fp_count + 2)) # Ensure that the ValueError is raised when a filepath_type is not # provided for each and every filepath with self.assertRaises(ValueError): - load_processed_data_cmd(filepaths, [], 'processed_params_uclust', - 1, 1, None) + load_processed_data_cmd(filepaths, filepath_types[:-1], + 'processed_params_uclust', 1, 1, None) CONFIG_1 = """[required] From 58b3d37e8185dec4bd8f768a9f2bb8c4177009f6 Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Fri, 20 Jun 2014 00:16:23 -0600 Subject: [PATCH 6/8] Add CLI support for passing processed_date --- qiita_db/commands.py | 7 ++++++- scripts/qiita_db | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/qiita_db/commands.py b/qiita_db/commands.py index a9a7036f2..1526ce332 100644 --- a/qiita_db/commands.py +++ b/qiita_db/commands.py @@ -6,6 +6,7 @@ # The full license is in the file LICENSE, distributed with this software. # ----------------------------------------------------------------------------- +from dateutil.parser import parse import pandas as pd from functools import partial try: @@ -128,8 +129,9 @@ def load_processed_data_cmd(fps, fp_types, processed_params_table_name, The ID of the row in the processed_params_ table preprocessed_data_id : int, optional Defaults to ``None``. The ID of the row in the preprocessed_data table. - processed_date : datetime, optional + processed_date : str, optional Defaults to ``None``. The date and time to use as the processing date. + Must be interpretable as a datetime object Returns ------- @@ -148,6 +150,9 @@ def load_processed_data_cmd(fps, fp_types, processed_params_table_name, else: preprocessed_data = None + if processed_date is not None: + processed_date = parse(processed_date) + return ProcessedData.create(processed_params_table_name, processed_params_id, list(zip(fps, fp_types)), preprocessed_data, processed_date) diff --git a/scripts/qiita_db b/scripts/qiita_db index 953afcca4..5b4e61a63 100755 --- a/scripts/qiita_db +++ b/scripts/qiita_db @@ -9,7 +9,6 @@ # ----------------------------------------------------------------------------- import click -from datetime import datetime from qiita_db.util import (get_filetypes, get_filepath_types, get_processed_params_tables) @@ -58,9 +57,10 @@ def load_raw_data(fp, fp_type, filetype, study): @click.option('--preprocessed_data_id', type=int, default=None, help='The ' 'ID of the row in the preprocessed_data table from which ' 'this processed data was created') -@click.option('--processed_date', type=datetime, default=None, - help='The date to use as the processed_date. If None, then ' - 'the current date and time will be used.') +@click.option('--processed_date', type=str, default=None, + help='The date to use as the processed_date. Must be ' + 'interpretable as a datetime. If None, then the current date ' + 'and time will be used.') def load_processed_data(fp, fp_type, processed_params_table, processed_params_id, preprocessed_data_id, processed_date): From 0624a85ae1c6cc8a79177b3248f81048694ba58c Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Fri, 20 Jun 2014 09:46:06 -0600 Subject: [PATCH 7/8] Uppercase portions of SQL commands --- qiita_db/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qiita_db/util.py b/qiita_db/util.py index 6baf27dc8..4b544ceef 100644 --- a/qiita_db/util.py +++ b/qiita_db/util.py @@ -476,8 +476,8 @@ def get_processed_params_tables(): ------- list of str """ - sql = ("select * from information_schema.tables where table_schema = " - "'qiita' and substr(table_name, 1, 17) = 'processed_params_'") + sql = ("SELECT * FROM information_schema.tables WHERE table_schema = " + "'qiita' AND SUBSTR(table_name, 1, 17) = 'processed_params_'") conn = SQLConnectionHandler() return [x[2] for x in conn.execute_fetchall(sql)] From 067767bfae8c840cc28de63037ab4a4b89092654 Mon Sep 17 00:00:00 2001 From: Adam Robbins-Pianka Date: Fri, 20 Jun 2014 09:49:34 -0600 Subject: [PATCH 8/8] Remove prep_x and sample_y from the SQL export --- qiita_db/support_files/qiita-db.sql | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/qiita_db/support_files/qiita-db.sql b/qiita_db/support_files/qiita-db.sql index 992d8e03c..843aeefc2 100644 --- a/qiita_db/support_files/qiita-db.sql +++ b/qiita_db/support_files/qiita-db.sql @@ -99,17 +99,6 @@ CREATE TABLE qiita.portal_type ( COMMENT ON TABLE qiita.portal_type IS 'What portals are available to show a study in'; -CREATE TABLE qiita.prep_y ( - sample_id varchar NOT NULL, - data bigint , - CONSTRAINT pk_prep_y PRIMARY KEY ( sample_id ) - ); - -COMMENT ON TABLE qiita.prep_y IS 'Information on how raw data y was prepared (prep template) -Linked by y being raw_data_id from raw data table.'; - -COMMENT ON COLUMN qiita.prep_y.data IS 'STUFFFFF'; - CREATE TABLE qiita.preprocessed_data ( preprocessed_data_id bigserial NOT NULL, preprocessed_params_table varchar NOT NULL, @@ -214,20 +203,6 @@ CREATE TABLE qiita.required_sample_info_status ( CONSTRAINT pk_sample_status PRIMARY KEY ( required_sample_info_status_id ) ); -CREATE TABLE qiita.sample_x ( - sample_id varchar NOT NULL, - description varchar NOT NULL, - other_mapping_columns varchar , - CONSTRAINT pk_study_x_y PRIMARY KEY ( sample_id ) - ); - -COMMENT ON TABLE qiita.sample_x IS 'data for samples in study x (sample template) -x is the study_id from study table - -MAKE SURE sample_id IS FK TO sample_id IN required_sample_info TABLE'; - -COMMENT ON COLUMN qiita.sample_x.other_mapping_columns IS 'Represents whatever other columns go with this study'; - CREATE TABLE qiita.severity ( severity_id serial NOT NULL, severity varchar NOT NULL,
Table preprocessed_data
processed_filepath
preprocessed_data_id bigserial NOT NULL processed_data_id bigint NOT NULL
preprocessed_params_table varchar NOT NULL Name of table holding the params filepath_id bigint NOT NULL
preprocessed_params_id bigint NOT NULL
Indexes
idx_processed_filepath primary key ON processed_data_id, filepath_id
Foreign Keys
submitted_to_insdc bool NOT NULL fk_processed_data_filepath ( processed_data_id ) ref processed_data (processed_data_id)
Indexes
pk_preprocessed_data primary key ON preprocessed_data_id
fk_processed_data_filepath_0 ( filepath_id ) ref filepath (filepath_id)