From d0e030853f6051c28c70d931ba641820e4198399 Mon Sep 17 00:00:00 2001 From: Jose Navas Date: Fri, 20 Jun 2014 14:08:02 -0600 Subject: [PATCH 1/5] Adding study_processed_table --- qiita_db/support_files/qiita-db.dbs | 34 +- qiita_db/support_files/qiita-db.html | 3502 ++++++++++++++------------ qiita_db/support_files/qiita-db.sql | 75 +- 3 files changed, 1905 insertions(+), 1706 deletions(-) diff --git a/qiita_db/support_files/qiita-db.dbs b/qiita_db/support_files/qiita-db.dbs index 2c16de96c..bf0582b1f 100644 --- a/qiita_db/support_files/qiita-db.dbs +++ b/qiita_db/support_files/qiita-db.dbs @@ -631,6 +631,9 @@ Linked by y being raw_data_id from raw data table. + + + @@ -995,6 +998,23 @@ Controlled Vocabulary]]>
+ + + + + + + + + + + + + + + + +
links study to its raw data @@ -1234,7 +1254,6 @@ Controlled Vocabulary]]> - @@ -1250,11 +1269,6 @@ Controlled Vocabulary]]> - - - - - @@ -1262,6 +1276,13 @@ Controlled Vocabulary]]> + + + + + + + analysis tables @@ -1314,6 +1335,7 @@ Controlled Vocabulary]]> + diff --git a/qiita_db/support_files/qiita-db.html b/qiita_db/support_files/qiita-db.html index 30f1ca77c..c3f4fa0a3 100644 --- a/qiita_db/support_files/qiita-db.html +++ b/qiita_db/support_files/qiita-db.html @@ -5,49 +5,131 @@ Database Documentation - + - - - + + + - + - + - + @@ -57,9 +139,17 @@ - + - + + + + + + + + + - + - + @@ -142,58 +232,58 @@ d='M 0,0 3,3 M 0,3 3,0 z'/> - + - + - + Project qiita Layout qiita - Tip: Move the mouse over columns to read the comments + Hint: Read the column comments as mouse-over tooltips. Generated using DbSchema - + Group_analyses - + Group_users - + Group_study - + - + Group_vocabularies - + Group_ontology - + Group_logging - + Group_filepaths @@ -462,11 +552,11 @@ study references study_person ( principal_investigator_id -> study_person_id ) principal_investigator_id + study references study_person ( principal_investigator_id -> study_person_id )' style='fill:#a1a0a0;'>principal_investigator_id Foreign Key fk_study_timeseries_type study references timeseries_type ( timeseries_type_id ) -timeseries_type_id Foreign Key fk_study study references portal_type ( portal_type_id ) @@ -552,12 +642,7 @@ study_raw_data references raw_data ( raw_data_id ) raw_data_id - Foreign Key fk_processed_params_uclust - processed_params_uclust references reference ( reference_id ) - -reference_id + study_raw_data references raw_data ( raw_data_id )' style='fill:#a1a0a0;'>raw_data_id Foreign Key fk_raw_data_filetype raw_data references filetype ( filetype_id ) @@ -592,66 +677,81 @@ processed_filepath references filepath ( filepath_id ) filepath_id + processed_filepath references filepath ( filepath_id )' style='fill:#a1a0a0;'>filepath_id + Foreign Key fk_processed_data + processed_data references study_processed_data ( processed_data_id ) + +processed_data_id + Foreign Key fk_study_processed_data + study_processed_data references study ( study_id ) + +study_id + Foreign Key fk_processed_params_uclust + processed_params_uclust references reference ( reference_id ) + +reference_id 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 ) + 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='#logging.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='#logging.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='#logging.information'><text x='1383' y='1297'>information</text><title>information varchar Other applicable information (depending on error) @@ -659,109 +759,110 @@ 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.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.<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 +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 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.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.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='#analysis.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='#analysis.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='#analysis.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 @@ -769,220 +870,221 @@ 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.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.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='#job.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='#job.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='#job.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='#job.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_job.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_job.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.<br>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.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.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='#mixs_field_description.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.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.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 ) @@ -992,279 +1094,270 @@ 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.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='#qiita_user.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='#qiita_user.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='#qiita_user.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='#qiita_user.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='#qiita_user.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.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.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.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 ) - - - - -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 ) -Referred by preprocessed_processed_data ( processed_data_id ) -Referred by processed_filepath ( processed_data_id ) - processed_params_tableprocessed_params_table varchar not null -Name of table holding processing params - processed_params_idprocessed_params_id bigint not null -Link to a table with the parameters used to generate processed data - processed_dateprocessed_date timestamp not null + 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 ) 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.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.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 ) Referred by study_preprocessed_data ( study_id ) 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 +Referred by study_users ( study_id ) +Referred by study_processed_data ( study_id ) +Referred by study_processed_data ( study_id ) + 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)<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 +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 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='#required_sample_info.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='#required_sample_info.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='#required_sample_info.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='#required_sample_info.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.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)<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 +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 Represents whatever other columns go with this study @@ -1272,291 +1365,320 @@ 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)<br>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) +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 ) - - - - -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 -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 - - - - -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 - - - - -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 - - - - -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 - - - - -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 + 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 ) 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.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 ) + 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.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_data.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 ) + 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 ) + + + + +processed_dataTable qiita.processed_data + Primary Key ( processed_data_id ) +processed_data_idprocessed_data_id bigserial not null +References study_processed_data ( processed_data_id ) +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 +Name of table holding processing params + processed_params_idprocessed_params_id bigint not null +Link to a table with the parameters used to generate processed data + processed_dateprocessed_date timestamp not null + + + + +study_processed_dataTable qiita.study_processed_data + Primary Key ( study_id, processed_data_id ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, processed_data_id ) Unique Index ( processed_data_id ) +processed_data_idprocessed_data_id bigint not null +Referred by processed_data ( processed_data_id ) +Referred by processed_data ( processed_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 +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 + + + + +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 + + + + +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 + + + + +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 + + + + +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

-
+
- + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1565,7 +1687,7 @@ - + @@ -1580,37 +1702,37 @@
term_synonym
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1619,7 +1741,7 @@ - + @@ -1629,22 +1751,22 @@
controlled_vocab_values
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -1653,22 +1775,22 @@
controlled_vocabularies
Table 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


- +
- + - - - + + + - - - + + + - + @@ -1677,37 +1799,37 @@
severity
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1716,7 +1838,7 @@ - + @@ -1726,38 +1848,38 @@
logging
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1766,34 +1888,34 @@
study_person
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -1802,7 +1924,7 @@ - + @@ -1812,22 +1934,22 @@
investigation
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -1840,7 +1962,7 @@ - + @@ -1855,27 +1977,27 @@
investigation_study
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -1884,23 +2006,23 @@
study_status
Table 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


- +
- + - - - + + + - - - + + + - + @@ -1909,7 +2031,7 @@ - + @@ -1919,23 +2041,23 @@
study_experimental_factor
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -1944,7 +2066,7 @@ - + @@ -1954,22 +2076,22 @@
study_pmid
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -1978,43 +2100,43 @@
analysis_status
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2027,7 +2149,7 @@ - + @@ -2042,23 +2164,23 @@
analysis
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -2071,7 +2193,7 @@ - + @@ -2086,23 +2208,23 @@
analysis_filepath
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -2115,7 +2237,7 @@ - + @@ -2130,42 +2252,42 @@
job_results_filepath
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2186,7 +2308,7 @@ - + @@ -2211,23 +2333,23 @@
job
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -2240,7 +2362,7 @@ - + @@ -2255,24 +2377,24 @@
analysis_job
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -2285,7 +2407,7 @@ - + @@ -2300,22 +2422,22 @@
analysis_chain
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -2324,28 +2446,28 @@
job_status
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -2354,27 +2476,27 @@
command
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -2387,7 +2509,7 @@ - + @@ -2407,23 +2529,23 @@
analysis_sample
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -2436,7 +2558,7 @@ - + @@ -2451,42 +2573,42 @@
column_controlled_vocabularies
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2495,33 +2617,33 @@
mixs_field_description
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2530,7 +2652,7 @@ - + @@ -2540,37 +2662,37 @@
column_ontology
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2591,7 +2713,7 @@ - + @@ -2616,47 +2738,47 @@
term_relationship
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2681,7 +2803,7 @@ - + @@ -2711,57 +2833,57 @@
term_path
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2770,57 +2892,57 @@
ontology
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2829,7 +2951,7 @@ - + @@ -2839,37 +2961,37 @@
term
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2878,7 +3000,7 @@ - + @@ -2888,42 +3010,42 @@
annotation
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -2932,7 +3054,7 @@ - + @@ -2942,22 +3064,22 @@
dbxref
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -2966,23 +3088,23 @@
relationship_type
Table 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


- +
- + - - - + + + - - - + + + - + @@ -2995,7 +3117,7 @@ - + @@ -3010,28 +3132,28 @@
analysis_users
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -3040,63 +3162,63 @@
user_level
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3105,7 +3227,7 @@ - + @@ -3115,22 +3237,22 @@
qiita_user
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -3139,22 +3261,22 @@
filepath_type
Table 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


- +
- + - - - + + + - - - + + + - + @@ -3163,22 +3285,22 @@
checksum_algorithm
Table 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


- +
- + - - - + + + - - - + + + - + @@ -3187,37 +3309,37 @@
data_type
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3226,7 +3348,7 @@ - + @@ -3241,56 +3363,22 @@
filepath
Table 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)


- +
- + - - - - - - - - - - - - - - - - - - - - - - + + - -
processed_data
Table study_preprocessed_data
processed_data_id bigserial NOT NULL
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_date timestamp NOT NULL
Indexes
pk_processed_data primary key ON processed_data_idstudy_id bigint NOT NULL
- -

- - - - - - - - - - - - - + + + - + @@ -3303,7 +3391,7 @@ - + @@ -3318,123 +3406,123 @@
study_preprocessed_data
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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3467,7 +3555,7 @@ - + @@ -3507,23 +3595,23 @@
study
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -3536,7 +3624,7 @@ - + @@ -3551,63 +3639,63 @@
study_users
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3624,7 +3712,7 @@ - + @@ -3639,9 +3727,9 @@
required_sample_info
Table 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)


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -3672,28 +3760,28 @@
sample_x
Table sample_x
data for samples in study x (sample template) x is the study_id from study table @@ -3649,21 +3737,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


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -3702,7 +3790,7 @@ - + @@ -3712,22 +3800,22 @@
study_sample_columns
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -3736,24 +3824,24 @@
required_sample_info_status
Table 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


- +
- + - - - + + + - - - + + + - + @@ -3762,52 +3850,52 @@
prep_y
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - + @@ -3828,7 +3916,7 @@ - + @@ -3853,23 +3941,23 @@
common_prep_info
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -3878,28 +3966,28 @@
emp_status
Table 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


- +
- + - - - + + + - - - + + + - - - + + + - + @@ -3908,7 +3996,7 @@ - + @@ -3918,23 +4006,23 @@
raw_data_prep_columns
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -3943,22 +4031,22 @@
filetype
Table 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


- +
- + - - - + + + - - - + + + - + @@ -3971,7 +4059,7 @@ - + @@ -3986,22 +4074,22 @@
raw_filepath
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -4014,7 +4102,7 @@ - + @@ -4029,23 +4117,23 @@
preprocessed_processed_data
Table 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)


- +
- + - - - + + + - - - + + + - + @@ -4054,7 +4142,7 @@ - + @@ -4069,427 +4157,505 @@
study_raw_data
Table 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)


- +
- - + - - - + + + - - - + + + - - - - + + + + + +
processed_params_uclust
Parameters used for processing data using method uclust
Table timeseries_type
processed_params_id bigserial NOT NULL timeseries_type_id bigserial NOT NULL
reference_id bigint NOT NULL What version of reference or type of reference used timeseries_type varchar NOT NULL
similarity float8 NOT NULL DEFO 0.97
Indexes
pk_timeseries_type primary key ON timeseries_type_id
+ +

+ + + + + + - - - + + + - - - - - - - + + - - + + + - - - - + + +
Table portal_type
What portals are available to show a study in
enable_rev_strand_match bool NOT NULL DEFO TRUE portal_type_id bigserial NOT NULL
suppress_new_clusters bool NOT NULL DEFO TRUE
Indexes
pk_processed_params_uclust primary key ON processed_params_idportal varchar NOT NULL
idx_processed_params_uclust ON reference_id
description varchar NOT NULL
Foreign Keys
fk_processed_params_uclust ( reference_id ) ref reference (reference_id)
Indexes
pk_portal_type primary key ON portal_type_id


- +
- + - - - - - - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - - - - + +
reference
Table raw_data
reference_id bigserial NOT NULL
reference_name varchar NOT NULL raw_data_id bigserial NOT NULL
reference_version varchar filetype_id bigint NOT NULL
sequence_filepath varchar NOT NULL
Indexes
pk_raw_data unique ON raw_data_id
taxonomy_filepath varchar
idx_raw_data ON filetype_id
Foreign Keys
tree_filepath varchar
Indexes
pk_reference primary key ON reference_idfk_raw_data_filetype ( filetype_id ) ref filetype (filetype_id)


- +
- - + - - - + + + - - - + + + - - - - + + + + - - - - + + + + + + + + - - - + + + - - - + + +
preprocessed_sequence_illumina_params
Parameters used for processing illumina sequence data.
Table raw_preprocessed_data
preprocessed_params_id bigserial NOT NULL raw_data_id bigint NOT NULL
trim_length integer NOT NULL preprocessed_data_id bigint NOT NULL
max_bad_run_length integer NOT NULL DEFO 3
Indexes
idx_raw_preprocessed_data primary key ON raw_data_id, preprocessed_data_id
min_per_read_length_fraction real NOT NULL DEFO 0.75
idx_raw_preprocessed_data_0 ON raw_data_id
idx_raw_preprocessed_data_1 ON preprocessed_data_id
Foreign Keys
sequence_max_n integer NOT NULL DEFO 0 fk_raw_preprocessed_data ( raw_data_id ) ref raw_data (raw_data_id)
Indexes
pk_preprocessed_sequence_illumina_params primary key ON preprocessed_params_id
fk_raw_preprocessed_data_0 ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id)


- +
- - + - - - + + + - - - + + + - - - + + + + + + + + + + + + + + + + + + + + + +
preprocessed_spectra_params
Parameters used for processing spectra data.
Table preprocessed_filepath
preprocessed_params_id bigserial NOT NULL preprocessed_data_id bigint NOT NULL
col varchar filepath_id bigint NOT NULL
Indexes
pk_preprocessed_spectra_params primary key ON preprocessed_params_id
Indexes
idx_preprocessed_filepath primary key ON preprocessed_data_id, filepath_id
idx_preprocessed_filepath_0 ON preprocessed_data_id
idx_preprocessed_filepath_1 ON filepath_id
Foreign Keys
fk_preprocessed_filepath ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id)
fk_preprocessed_filepath_0 ( filepath_id ) ref filepath (filepath_id)


- +
- - + - - - + + + - - - + + + - - - + + + + + + + + + + + + +
preprocessed_sequence_454_params
Parameters used for processing sequence data.
Table preprocessed_data
preprocessed_params_id bigserial NOT NULL preprocessed_data_id bigserial NOT NULL
trim_length integer NOT NULL preprocessed_params_table varchar NOT NULL Name of table holding the params
Indexes
pk_preprocessed_sequence_454_params primary key ON preprocessed_params_id
preprocessed_params_id bigint NOT NULL
submitted_to_insdc bool NOT NULL
Indexes
pk_preprocessed_data primary key ON preprocessed_data_id


- +
- + - - - + + + - - - + + + - - - + + + + + + + + + + + + + +
timeseries_type
Table processed_filepath
timeseries_type_id bigserial NOT NULL processed_data_id bigint NOT NULL
timeseries_type varchar NOT NULL filepath_id bigint NOT NULL
Indexes
pk_timeseries_type primary key ON timeseries_type_id
Indexes
idx_processed_filepath primary key ON processed_data_id, filepath_id
Foreign Keys
fk_processed_data_filepath ( processed_data_id ) ref processed_data (processed_data_id)
fk_processed_data_filepath_0 ( filepath_id ) ref filepath (filepath_id)


- +
- - + - - - + + + - - - + + + - - - + + + - - - + + + + + + + + + + + + + +
portal_type
What portals are available to show a study in
Table processed_data
portal_type_id bigserial NOT NULL processed_data_id bigserial NOT NULL
portal varchar NOT NULL processed_params_table varchar NOT NULL Name of table holding processing params
description varchar NOT NULL processed_params_id bigint NOT NULL Link to a table with the parameters used to generate processed data
Indexes
pk_portal_type primary key ON portal_type_id
processed_date timestamp NOT NULL
Indexes
pk_processed_data primary key ON processed_data_id
Foreign Keys
fk_processed_data ( processed_data_id ) ref study_processed_data (processed_data_id)


- +
- + - - - + + + - - - + + + - - - + + + - - + + - + + + + + - - + +
raw_data
Table study_processed_data
raw_data_id bigserial NOT NULL study_id bigint NOT NULL
filetype_id bigint NOT NULL processed_data_id bigint NOT NULL
Indexes
pk_raw_data unique ON raw_data_id
Indexes
idx_study_processed_data primary key ON study_id, processed_data_id
idx_raw_data ON filetype_id
idx_study_processed_data_0 ON study_id
Foreign Keys
pk_study_processed_data unique ON processed_data_id
Foreign Keys
fk_raw_data_filetype ( filetype_id ) ref filetype (filetype_id) fk_study_processed_data ( study_id ) ref study (study_id)


- +
- + + - - - + + + - - - + + + - - - + + + - - + + + - - + + + - - - - + + + + + + + + - - + +
raw_preprocessed_data
Table processed_params_uclust
Parameters used for processing data using method uclust
raw_data_id bigint NOT NULL processed_params_id bigserial NOT NULL
preprocessed_data_id bigint NOT NULL reference_id bigint NOT NULL What version of reference or type of reference used
Indexes
idx_raw_preprocessed_data primary key ON raw_data_id, preprocessed_data_id
similarity float8 NOT NULL DEFO 0.97
idx_raw_preprocessed_data_0 ON raw_data_id
enable_rev_strand_match bool NOT NULL DEFO TRUE
idx_raw_preprocessed_data_1 ON preprocessed_data_id
suppress_new_clusters bool NOT NULL DEFO TRUE
Foreign Keys
fk_raw_preprocessed_data ( raw_data_id ) ref raw_data (raw_data_id)
Indexes
pk_processed_params_uclust primary key ON processed_params_id
idx_processed_params_uclust ON reference_id
Foreign Keys
fk_raw_preprocessed_data_0 ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id) fk_processed_params_uclust ( reference_id ) ref reference (reference_id)


- +
- + - - - + + + - - - - - - - + + - - + + + - - + + + - - - + + - - + + + + + + +
preprocessed_filepath
Table reference
preprocessed_data_id bigint NOT NULL reference_id bigserial NOT NULL
filepath_id bigint NOT NULL
Indexes
idx_preprocessed_filepath primary key ON preprocessed_data_id, filepath_idreference_name varchar NOT NULL
idx_preprocessed_filepath_0 ON preprocessed_data_id
reference_version varchar
idx_preprocessed_filepath_1 ON filepath_id
sequence_filepath varchar NOT NULL
Foreign Keys
fk_preprocessed_filepath ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id) taxonomy_filepath varchar
fk_preprocessed_filepath_0 ( filepath_id ) ref filepath (filepath_id) tree_filepath varchar
Indexes
pk_reference primary key ON reference_id


- +
- + + - - - + + + - - - + + + + + + + + + +
preprocessed_data
Table preprocessed_spectra_params
Parameters used for processing spectra data.
preprocessed_data_id bigserial NOT NULL preprocessed_params_id bigserial NOT NULL
preprocessed_params_table varchar NOT NULL Name of table holding the params col varchar
Indexes
pk_preprocessed_spectra_params primary key ON preprocessed_params_id
+ +

+ + + + + + - - - + + + - - - + + + - - - + + +
Table preprocessed_sequence_454_params
Parameters used for processing sequence data.
preprocessed_params_id bigint NOT NULL preprocessed_params_id bigserial NOT NULL
submitted_to_insdc bool NOT NULL trim_length integer NOT NULL
Indexes
pk_preprocessed_data primary key ON preprocessed_data_id
Indexes
pk_preprocessed_sequence_454_params primary key ON preprocessed_params_id


- +
- + + - - - + + + - - - + + + - - - + + + - - - + + - - + + + + + + + diff --git a/qiita_db/support_files/qiita-db.sql b/qiita_db/support_files/qiita-db.sql index 843aeefc2..ed5f60cc4 100644 --- a/qiita_db/support_files/qiita-db.sql +++ b/qiita_db/support_files/qiita-db.sql @@ -136,18 +136,6 @@ CREATE TABLE qiita.preprocessed_spectra_params ( COMMENT ON TABLE qiita.preprocessed_spectra_params IS 'Parameters used for processing spectra data.'; -CREATE TABLE qiita.processed_data ( - processed_data_id bigserial NOT NULL, - processed_params_table varchar NOT NULL, - processed_params_id bigint NOT NULL, - processed_date timestamp NOT NULL, - CONSTRAINT pk_processed_data PRIMARY KEY ( processed_data_id ) - ); - -COMMENT ON COLUMN qiita.processed_data.processed_params_table IS 'Name of table holding processing params'; - -COMMENT ON COLUMN qiita.processed_data.processed_params_id IS 'Link to a table with the parameters used to generate processed data'; - CREATE TABLE qiita.raw_data ( raw_data_id bigserial NOT NULL, filetype_id bigint NOT NULL, @@ -441,26 +429,6 @@ CREATE INDEX idx_preprocessed_filepath_0 ON qiita.preprocessed_filepath ( prepro CREATE INDEX idx_preprocessed_filepath_1 ON qiita.preprocessed_filepath ( filepath_id ); -CREATE TABLE qiita.preprocessed_processed_data ( - preprocessed_data_id bigint NOT NULL, - processed_data_id bigint NOT NULL, - CONSTRAINT idx_preprocessed_processed_data PRIMARY KEY ( preprocessed_data_id, processed_data_id ), - CONSTRAINT fk_preprocessed_processed_data FOREIGN KEY ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) , - CONSTRAINT fk_preprocessed_processed_data_0 FOREIGN KEY ( processed_data_id ) REFERENCES qiita.processed_data( processed_data_id ) - ); - -CREATE INDEX idx_preprocessed_processed_data_0 ON qiita.preprocessed_processed_data ( preprocessed_data_id ); - -CREATE INDEX idx_preprocessed_processed_data_1 ON qiita.preprocessed_processed_data ( processed_data_id ); - -CREATE TABLE qiita.processed_filepath ( - processed_data_id bigint NOT NULL, - filepath_id bigint NOT NULL, - 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 TABLE qiita.processed_params_uclust ( processed_params_id bigserial NOT NULL, reference_id bigint NOT NULL, @@ -604,6 +572,16 @@ CREATE INDEX idx_study_preprocessed_data_0 ON qiita.study_preprocessed_data ( st CREATE INDEX idx_study_preprocessed_data_1 ON qiita.study_preprocessed_data ( preprocessed_data_id ); +CREATE TABLE qiita.study_processed_data ( + study_id bigint NOT NULL, + processed_data_id bigint NOT NULL, + CONSTRAINT idx_study_processed_data PRIMARY KEY ( study_id, processed_data_id ), + CONSTRAINT pk_study_processed_data UNIQUE ( processed_data_id ) , + CONSTRAINT fk_study_processed_data FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) + ); + +CREATE INDEX idx_study_processed_data_0 ON qiita.study_processed_data ( study_id ); + CREATE TABLE qiita.study_raw_data ( study_id bigint NOT NULL, raw_data_id bigint NOT NULL, @@ -769,6 +747,27 @@ CREATE INDEX idx_job_results_filepath_1 ON qiita.job_results_filepath ( filepath COMMENT ON TABLE qiita.job_results_filepath IS 'Holds connection between jobs and the result filepaths'; +CREATE TABLE qiita.processed_data ( + processed_data_id bigserial NOT NULL, + processed_params_table varchar NOT NULL, + processed_params_id bigint NOT NULL, + processed_date timestamp NOT NULL, + CONSTRAINT pk_processed_data PRIMARY KEY ( processed_data_id ), + CONSTRAINT fk_processed_data FOREIGN KEY ( processed_data_id ) REFERENCES qiita.study_processed_data( processed_data_id ) + ); + +COMMENT ON COLUMN qiita.processed_data.processed_params_table IS 'Name of table holding processing params'; + +COMMENT ON COLUMN qiita.processed_data.processed_params_id IS 'Link to a table with the parameters used to generate processed data'; + +CREATE TABLE qiita.processed_filepath ( + processed_data_id bigint NOT NULL, + filepath_id bigint NOT NULL, + 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 TABLE qiita.required_sample_info ( study_id bigint NOT NULL, sample_id varchar NOT NULL, @@ -857,3 +856,15 @@ CREATE INDEX idx_required_prep_info_2 ON qiita.common_prep_info ( sample_id ); CREATE INDEX idx_required_prep_info_3 ON qiita.common_prep_info ( data_type_id ); +CREATE TABLE qiita.preprocessed_processed_data ( + preprocessed_data_id bigint NOT NULL, + processed_data_id bigint NOT NULL, + CONSTRAINT idx_preprocessed_processed_data PRIMARY KEY ( preprocessed_data_id, processed_data_id ), + CONSTRAINT fk_preprocessed_processed_data FOREIGN KEY ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) , + CONSTRAINT fk_preprocessed_processed_data_0 FOREIGN KEY ( processed_data_id ) REFERENCES qiita.processed_data( processed_data_id ) + ); + +CREATE INDEX idx_preprocessed_processed_data_0 ON qiita.preprocessed_processed_data ( preprocessed_data_id ); + +CREATE INDEX idx_preprocessed_processed_data_1 ON qiita.preprocessed_processed_data ( processed_data_id ); + From ab8b653098106865fe4146332772196161c781fe Mon Sep 17 00:00:00 2001 From: Jose Navas Date: Fri, 20 Jun 2014 15:41:01 -0600 Subject: [PATCH 2/5] Fixing test --- qiita_db/data.py | 28 +++++++++++++++++++++++++++- qiita_db/test/test_data.py | 8 ++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/qiita_db/data.py b/qiita_db/data.py index 63ae6e868..3bece529f 100644 --- a/qiita_db/data.py +++ b/qiita_db/data.py @@ -396,11 +396,12 @@ class ProcessedData(BaseData): _table = "processed_data" _data_filepath_table = "processed_filepath" _data_filepath_column = "processed_data_id" + _study_processed_table = "study_processed_data" _preprocessed_processed_table = "preprocessed_processed_data" @classmethod def create(cls, processed_params_table, processed_params_id, filepaths, - preprocessed_data=None, processed_date=None): + preprocessed_data=None, study=None, processed_date=None): r""" Parameters ---------- @@ -414,6 +415,9 @@ def create(cls, processed_params_table, processed_params_id, filepaths, identifier preprocessed_data : PreprocessedData, optional The PreprocessedData object used as base to this processed data + study : Study, optional + If preprocessed_data is not provided, the study the processed data + belongs to processed_date : datetime, optional Date in which the data have been processed. Default: now @@ -421,7 +425,19 @@ def create(cls, processed_params_table, processed_params_id, filepaths, ------ IncompetentQiitaDeveloperError If the table `processed_params_table` does not exists + ValueError + If `preprocessed_data` and `study` are provided at the same time + If `preprocessed_data` and `study` are not provided """ + if preprocessed_data is not None: + if study is not None: + raise ValueError("You should provide either preprocessed_data " + "or study, but not both") + else: + if study is None: + raise ValueError("You should provide either a " + "preprocessed_data or a study") + conn_handler = SQLConnectionHandler() # We first check that the processed_params_table exists if not exists_dynamic_table(processed_params_table, @@ -453,6 +469,16 @@ def create(cls, processed_params_table, processed_params_id, filepaths, "processed_data_id) VALUES " "(%s, %s)".format(cls._preprocessed_processed_table), (preprocessed_data.id, pd_id)) + study_id = preprocessed_data.study + else: + study_id = study.id + + # Connect the processed data with the study + conn_handler.execute( + "INSERT INTO qiita.{0} (study_id, processed_data_id) VALUES " + "(%s, %s)".format(cls._study_processed_table), + (study_id, pd_id)) + pd._add_filepaths(filepaths, conn_handler) return cls(pd_id) diff --git a/qiita_db/test/test_data.py b/qiita_db/test/test_data.py index 32342990b..5428c2981 100644 --- a/qiita_db/test/test_data.py +++ b/qiita_db/test/test_data.py @@ -292,6 +292,14 @@ def test_create(self): # processed_data_id, filepath_id self.assertTrue(obs, [[2, 10]]) + # Check that the processed data have been correctly linked with the + # study + obs = self.conn_handler.execute_fetchall( + "SELECT * FROM qiita.study_processed_data WHERE " + "processed_data_id=2") + # study_id, processed_data + self.assertEqual(obs, [[1, 2]]) + def test_create_no_date(self): """Correctly adds a processed data with no date on it""" # All the other settings have been already tested on test_create From 5b43b7028d96137179ecdc17b7faf35f6aa2947b Mon Sep 17 00:00:00 2001 From: Jose Navas Date: Fri, 20 Jun 2014 15:44:29 -0600 Subject: [PATCH 3/5] Fixing SQL FK --- qiita_db/support_files/qiita-db.dbs | 10 +- qiita_db/support_files/qiita-db.html | 238 +++++++++++++-------------- qiita_db/support_files/qiita-db.sql | 68 ++++---- 3 files changed, 157 insertions(+), 159 deletions(-) diff --git a/qiita_db/support_files/qiita-db.dbs b/qiita_db/support_files/qiita-db.dbs index bf0582b1f..d08643aa0 100644 --- a/qiita_db/support_files/qiita-db.dbs +++ b/qiita_db/support_files/qiita-db.dbs @@ -631,9 +631,6 @@ Linked by y being raw_data_id from raw data table. - - -
processed_filepath
Table preprocessed_sequence_illumina_params
Parameters used for processing illumina sequence data.
processed_data_id bigint NOT NULL preprocessed_params_id bigserial NOT NULL
filepath_id bigint NOT NULL trim_length integer NOT NULL
Indexes
idx_processed_filepath primary key ON processed_data_id, filepath_id
max_bad_run_length integer NOT NULL DEFO 3
Foreign Keys
fk_processed_data_filepath ( processed_data_id ) ref processed_data (processed_data_id) min_per_read_length_fraction real NOT NULL DEFO 0.75
fk_processed_data_filepath_0 ( filepath_id ) ref filepath (filepath_id) sequence_max_n integer NOT NULL DEFO 0
Indexes
pk_preprocessed_sequence_illumina_params primary key ON preprocessed_params_id
@@ -1014,6 +1011,9 @@ Controlled Vocabulary]]> + + +
links study to its raw data @@ -1276,13 +1276,13 @@ Controlled Vocabulary]]> - - + + analysis tables diff --git a/qiita_db/support_files/qiita-db.html b/qiita_db/support_files/qiita-db.html index c3f4fa0a3..740eb126c 100644 --- a/qiita_db/support_files/qiita-db.html +++ b/qiita_db/support_files/qiita-db.html @@ -632,7 +632,7 @@ preprocessed_processed_data references processed_data ( processed_data_id ) processed_data_id + preprocessed_processed_data references processed_data ( processed_data_id )' style='fill:#a1a0a0;'>processed_data_id Foreign Key fk_study_raw_data_study study_raw_data references study ( study_id ) @@ -677,22 +677,22 @@ processed_filepath references filepath ( filepath_id ) filepath_id - Foreign Key fk_processed_data - processed_data references study_processed_data ( processed_data_id ) + processed_filepath references filepath ( filepath_id )' style='fill:#a1a0a0;'>filepath_id + Foreign Key fk_processed_params_uclust + processed_params_uclust references reference ( reference_id ) -processed_data_id +reference_id Foreign Key fk_study_processed_data study_processed_data references study ( study_id ) study_id - Foreign Key fk_processed_params_uclust - processed_params_uclust references reference ( reference_id ) + study_processed_data references study ( study_id )' style='fill:#a1a0a0;'>study_id + Foreign Key fk_study_processed_data_0 + study_processed_data references processed_data ( processed_data_id ) -reference_id +processed_data_id term_synonymTable qiita.term_synonym @@ -1263,11 +1263,10 @@ Referred by study_experimental_factor ( study_id ) Referred by study_pmid ( study_id ) Referred by study_preprocessed_data ( study_id ) +Referred by study_processed_data ( study_id ) Referred by study_raw_data ( study_id ) Referred by study_sample_columns ( study_id ) -Referred by study_users ( study_id ) -Referred by study_processed_data ( study_id ) -Referred by study_processed_data ( study_id ) +Referred by study_users ( study_id ) Index ( email ) emailemail varchar not null Email of study owner @@ -1564,34 +1563,6 @@ filepath_idfilepath_id bigint not null References filepath ( filepath_id ) - - - -processed_dataTable qiita.processed_data - Primary Key ( processed_data_id ) -processed_data_idprocessed_data_id bigserial not null -References study_processed_data ( processed_data_id ) -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 -Name of table holding processing params - processed_params_idprocessed_params_id bigint not null -Link to a table with the parameters used to generate processed data - processed_dateprocessed_date timestamp not null - - - - -study_processed_dataTable qiita.study_processed_data - Primary Key ( study_id, processed_data_id ) Index ( study_id ) -study_idstudy_id bigint not null -References study ( study_id ) - Primary Key ( study_id, processed_data_id ) Unique Index ( processed_data_id ) -processed_data_idprocessed_data_id bigint not null -Referred by processed_data ( processed_data_id ) -Referred by processed_data ( processed_data_id ) - @@ -1650,6 +1621,34 @@ 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 + + + +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 ) +Referred by preprocessed_processed_data ( processed_data_id ) +Referred by processed_filepath ( processed_data_id ) +Referred by study_processed_data ( processed_data_id ) +Referred by study_processed_data ( processed_data_id ) + processed_params_tableprocessed_params_table varchar not null +Name of table holding processing params + processed_params_idprocessed_params_id bigint not null +Link to a table with the parameters used to generate processed data + processed_dateprocessed_date timestamp not null + + + + +study_processed_dataTable qiita.study_processed_data + Primary Key ( study_id, processed_data_id ) Index ( study_id ) +study_idstudy_id bigint not null +References study ( study_id ) + Primary Key ( study_id, processed_data_id ) Unique Index ( processed_data_id ) +processed_data_idprocessed_data_id bigint not null +References processed_data ( processed_data_id ) +

@@ -4399,84 +4398,6 @@
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table processed_data
processed_data_id bigserial NOT NULL
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_date timestamp NOT NULL
Indexes
pk_processed_data primary key ON processed_data_id
Foreign Keys
fk_processed_data ( processed_data_id ) ref study_processed_data (processed_data_id)
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Table study_processed_data
study_id bigint NOT NULL
processed_data_id bigint NOT NULL
Indexes
idx_study_processed_data primary key ON study_id, processed_data_id
idx_study_processed_data_0 ON study_id
pk_study_processed_data unique ON processed_data_id
Foreign Keys
fk_study_processed_data ( study_id ) ref study (study_id)
-

@@ -4661,4 +4582,81 @@
+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table processed_data
processed_data_id bigserial NOT NULL
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_date timestamp NOT NULL
Indexes
pk_processed_data primary key ON processed_data_id
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table study_processed_data
study_id bigint NOT NULL
processed_data_id bigint NOT NULL
Indexes
idx_study_processed_data primary key ON study_id, processed_data_id
idx_study_processed_data_0 ON study_id
pk_study_processed_data unique ON processed_data_id
Foreign Keys
fk_study_processed_data ( study_id ) ref study (study_id)
fk_study_processed_data_0 ( processed_data_id ) ref processed_data (processed_data_id)
+ \ No newline at end of file diff --git a/qiita_db/support_files/qiita-db.sql b/qiita_db/support_files/qiita-db.sql index ed5f60cc4..2e6d00f6d 100644 --- a/qiita_db/support_files/qiita-db.sql +++ b/qiita_db/support_files/qiita-db.sql @@ -136,6 +136,18 @@ CREATE TABLE qiita.preprocessed_spectra_params ( COMMENT ON TABLE qiita.preprocessed_spectra_params IS 'Parameters used for processing spectra data.'; +CREATE TABLE qiita.processed_data ( + processed_data_id bigserial NOT NULL, + processed_params_table varchar NOT NULL, + processed_params_id bigint NOT NULL, + processed_date timestamp NOT NULL, + CONSTRAINT pk_processed_data PRIMARY KEY ( processed_data_id ) + ); + +COMMENT ON COLUMN qiita.processed_data.processed_params_table IS 'Name of table holding processing params'; + +COMMENT ON COLUMN qiita.processed_data.processed_params_id IS 'Link to a table with the parameters used to generate processed data'; + CREATE TABLE qiita.raw_data ( raw_data_id bigserial NOT NULL, filetype_id bigint NOT NULL, @@ -429,6 +441,26 @@ CREATE INDEX idx_preprocessed_filepath_0 ON qiita.preprocessed_filepath ( prepro CREATE INDEX idx_preprocessed_filepath_1 ON qiita.preprocessed_filepath ( filepath_id ); +CREATE TABLE qiita.preprocessed_processed_data ( + preprocessed_data_id bigint NOT NULL, + processed_data_id bigint NOT NULL, + CONSTRAINT idx_preprocessed_processed_data PRIMARY KEY ( preprocessed_data_id, processed_data_id ), + CONSTRAINT fk_preprocessed_processed_data FOREIGN KEY ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) , + CONSTRAINT fk_preprocessed_processed_data_0 FOREIGN KEY ( processed_data_id ) REFERENCES qiita.processed_data( processed_data_id ) + ); + +CREATE INDEX idx_preprocessed_processed_data_0 ON qiita.preprocessed_processed_data ( preprocessed_data_id ); + +CREATE INDEX idx_preprocessed_processed_data_1 ON qiita.preprocessed_processed_data ( processed_data_id ); + +CREATE TABLE qiita.processed_filepath ( + processed_data_id bigint NOT NULL, + filepath_id bigint NOT NULL, + 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 TABLE qiita.processed_params_uclust ( processed_params_id bigserial NOT NULL, reference_id bigint NOT NULL, @@ -577,7 +609,8 @@ CREATE TABLE qiita.study_processed_data ( processed_data_id bigint NOT NULL, CONSTRAINT idx_study_processed_data PRIMARY KEY ( study_id, processed_data_id ), CONSTRAINT pk_study_processed_data UNIQUE ( processed_data_id ) , - CONSTRAINT fk_study_processed_data FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) + CONSTRAINT fk_study_processed_data FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) , + CONSTRAINT fk_study_processed_data_0 FOREIGN KEY ( processed_data_id ) REFERENCES qiita.processed_data( processed_data_id ) ); CREATE INDEX idx_study_processed_data_0 ON qiita.study_processed_data ( study_id ); @@ -747,27 +780,6 @@ CREATE INDEX idx_job_results_filepath_1 ON qiita.job_results_filepath ( filepath COMMENT ON TABLE qiita.job_results_filepath IS 'Holds connection between jobs and the result filepaths'; -CREATE TABLE qiita.processed_data ( - processed_data_id bigserial NOT NULL, - processed_params_table varchar NOT NULL, - processed_params_id bigint NOT NULL, - processed_date timestamp NOT NULL, - CONSTRAINT pk_processed_data PRIMARY KEY ( processed_data_id ), - CONSTRAINT fk_processed_data FOREIGN KEY ( processed_data_id ) REFERENCES qiita.study_processed_data( processed_data_id ) - ); - -COMMENT ON COLUMN qiita.processed_data.processed_params_table IS 'Name of table holding processing params'; - -COMMENT ON COLUMN qiita.processed_data.processed_params_id IS 'Link to a table with the parameters used to generate processed data'; - -CREATE TABLE qiita.processed_filepath ( - processed_data_id bigint NOT NULL, - filepath_id bigint NOT NULL, - 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 TABLE qiita.required_sample_info ( study_id bigint NOT NULL, sample_id varchar NOT NULL, @@ -856,15 +868,3 @@ CREATE INDEX idx_required_prep_info_2 ON qiita.common_prep_info ( sample_id ); CREATE INDEX idx_required_prep_info_3 ON qiita.common_prep_info ( data_type_id ); -CREATE TABLE qiita.preprocessed_processed_data ( - preprocessed_data_id bigint NOT NULL, - processed_data_id bigint NOT NULL, - CONSTRAINT idx_preprocessed_processed_data PRIMARY KEY ( preprocessed_data_id, processed_data_id ), - CONSTRAINT fk_preprocessed_processed_data FOREIGN KEY ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) , - CONSTRAINT fk_preprocessed_processed_data_0 FOREIGN KEY ( processed_data_id ) REFERENCES qiita.processed_data( processed_data_id ) - ); - -CREATE INDEX idx_preprocessed_processed_data_0 ON qiita.preprocessed_processed_data ( preprocessed_data_id ); - -CREATE INDEX idx_preprocessed_processed_data_1 ON qiita.preprocessed_processed_data ( processed_data_id ); - From cf0e7ded6b66fa3cf836210ce793947ef3dccf43 Mon Sep 17 00:00:00 2001 From: Jose Navas Date: Fri, 20 Jun 2014 15:50:24 -0600 Subject: [PATCH 4/5] Adding test for creation with study --- qiita_db/test/test_data.py | 52 +++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/qiita_db/test/test_data.py b/qiita_db/test/test_data.py index 5428c2981..ad827ba8f 100644 --- a/qiita_db/test/test_data.py +++ b/qiita_db/test/test_data.py @@ -290,7 +290,7 @@ def test_create(self): obs = self.conn_handler.execute_fetchall( "SELECT * FROM qiita.processed_filepath WHERE processed_data_id=2") # processed_data_id, filepath_id - self.assertTrue(obs, [[2, 10]]) + self.assertEqual(obs, [[2, 10]]) # Check that the processed data have been correctly linked with the # study @@ -300,6 +300,14 @@ def test_create(self): # study_id, processed_data self.assertEqual(obs, [[1, 2]]) + # Check that the processed data have been correctly linked with the + # preprocessed data + obs = self.conn_handler.execute_fetchall( + "SELECT * FROM qiita.preprocessed_processed_data WHERE " + "processed_data_id=2") + # preprocessed_data_id, processed_Data_id + self.assertEqual(obs, [[1, 2]]) + def test_create_no_date(self): """Correctly adds a processed data with no date on it""" # All the other settings have been already tested on test_create @@ -319,6 +327,48 @@ def test_create_no_date(self): self.assertTrue(before <= obs <= after) + def test_create_w_study(self): + """Correctly adds a processed data passing a study""" + obs = ProcessedData.create(self.params_table, self.params_id, + self.filepaths, study=Study(1), + processed_date=self.date) + + # Check that the processed data have been correctly added to the DB + obs = self.conn_handler.execute_fetchall( + "SELECT * FROM qiita.processed_data WHERE processed_data_id=2") + # processed_data_id, preprocessed_data_id, processed_params_table, + # processed_params_id, processed_date + exp = [[2, "processed_params_uclust", 1, self.date]] + self.assertEqual(obs, exp) + + # Check that the files have been copied to right location + exp_biom_fp = join(self.db_test_pd_dir, + "2_%s" % basename(self.biom_fp)) + self.assertTrue(exists(exp_biom_fp)) + self._clean_up_files.append(exp_biom_fp) + + # Check that the filepaths have been correctly added to the DB + obs = self.conn_handler.execute_fetchall( + "SELECT * FROM qiita.filepath WHERE filepath_id=10") + # Filepath_id, path, filepath_type_id + exp = [[10, exp_biom_fp, 6, '852952723', 1]] + self.assertEqual(obs, exp) + + # Check that the processed data have been correctly linked + # with the fileapths + obs = self.conn_handler.execute_fetchall( + "SELECT * FROM qiita.processed_filepath WHERE processed_data_id=2") + # processed_data_id, filepath_id + self.assertTrue(obs, [[2, 10]]) + + # Check that the processed data have been correctly linked with the + # study + obs = self.conn_handler.execute_fetchall( + "SELECT * FROM qiita.study_processed_data WHERE " + "processed_data_id=2") + # study_id, processed_data + self.assertEqual(obs, [[1, 2]]) + def test_create_params_table_error(self): """Raises an error if the processed_params_table does not exist""" with self.assertRaises(IncompetentQiitaDeveloperError): From a6a3dd2635826ef0e88d72f617494e269f7c3cfb Mon Sep 17 00:00:00 2001 From: Jose Navas Date: Fri, 20 Jun 2014 16:04:42 -0600 Subject: [PATCH 5/5] reflect changes on the command --- qiita_db/commands.py | 9 +++++++-- qiita_db/data.py | 10 +++++----- qiita_db/test/test_data.py | 12 ++++++++++++ scripts/qiita_db | 7 +++++-- 4 files changed, 29 insertions(+), 9 deletions(-) diff --git a/qiita_db/commands.py b/qiita_db/commands.py index 7de070751..2918f5b9f 100644 --- a/qiita_db/commands.py +++ b/qiita_db/commands.py @@ -165,7 +165,7 @@ def load_raw_data_cmd(filepaths, filepath_types, filetype, study_ids): def load_processed_data_cmd(fps, fp_types, processed_params_table_name, processed_params_id, preprocessed_data_id=None, - processed_date=None): + study_id=None, processed_date=None): """Add a new processed data entry Parameters @@ -202,9 +202,14 @@ def load_processed_data_cmd(fps, fp_types, processed_params_table_name, else: preprocessed_data = None + if study_id is not None: + study = Study(study_id) + else: + study = 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) + preprocessed_data, study, processed_date) diff --git a/qiita_db/data.py b/qiita_db/data.py index 3bece529f..c9566b9be 100644 --- a/qiita_db/data.py +++ b/qiita_db/data.py @@ -425,18 +425,18 @@ def create(cls, processed_params_table, processed_params_id, filepaths, ------ IncompetentQiitaDeveloperError If the table `processed_params_table` does not exists - ValueError If `preprocessed_data` and `study` are provided at the same time If `preprocessed_data` and `study` are not provided """ if preprocessed_data is not None: if study is not None: - raise ValueError("You should provide either preprocessed_data " - "or study, but not both") + raise IncompetentQiitaDeveloperError( + "You should provide either preprocessed_data or study, " + "but not both") else: if study is None: - raise ValueError("You should provide either a " - "preprocessed_data or a study") + raise IncompetentQiitaDeveloperError( + "You should provide either a preprocessed_data or a study") conn_handler = SQLConnectionHandler() # We first check that the processed_params_table exists diff --git a/qiita_db/test/test_data.py b/qiita_db/test/test_data.py index ad827ba8f..5c3c064c2 100644 --- a/qiita_db/test/test_data.py +++ b/qiita_db/test/test_data.py @@ -383,6 +383,18 @@ def test_create_params_table_error(self): self.filepaths, preprocessed_data=self.preprocessed_data) + def test_create_no_preprocessed_no_study_error(self): + with self.assertRaises(IncompetentQiitaDeveloperError): + ProcessedData.create(self.params_table, self.params_id, + self.filepaths) + + def test_create_preprocessed_and_study_error(self): + with self.assertRaises(IncompetentQiitaDeveloperError): + ProcessedData.create(self.params_table, self.params_id, + self.filepaths, + preprocessed_data=self.preprocessed_data, + study=Study(1)) + def test_get_filepath(self): """Correctly returns the filepaths to the processed files""" # check the test data diff --git a/scripts/qiita_db b/scripts/qiita_db index 1fc70e658..26236d965 100755 --- a/scripts/qiita_db +++ b/scripts/qiita_db @@ -59,16 +59,19 @@ 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('--study_id', type=int, default=None, help='The ' + 'ID of the row in the study table to which this processed data ' + 'belongs') @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_params_id, preprocessed_data_id, study_id, processed_date): load_processed_data_cmd(fp, fp_type, processed_params_table, processed_params_id, preprocessed_data_id, - processed_date) + study_id, processed_date) @qiita_db.command()