From 224322786f28724bdc9b12aba5e9877fa8a77dd4 Mon Sep 17 00:00:00 2001 From: Joshua Shorenstein Date: Thu, 29 May 2014 17:28:45 -0600 Subject: [PATCH] cascade data and study on deletion --- qiita_db/support_files/qiita-db.dbs | 78 +- qiita_db/support_files/qiita-db.html | 2084 +++++++++++++------------- qiita_db/support_files/qiita-db.sql | 42 +- 3 files changed, 1114 insertions(+), 1090 deletions(-) diff --git a/qiita_db/support_files/qiita-db.dbs b/qiita_db/support_files/qiita-db.dbs index 2f08f96da..cd4a96587 100644 --- a/qiita_db/support_files/qiita-db.dbs +++ b/qiita_db/support_files/qiita-db.dbs @@ -197,13 +197,13 @@ - + - + @@ -277,7 +277,7 @@ - + @@ -331,7 +331,7 @@ An investigation comprises one or more individual studies. - + @@ -470,7 +470,7 @@ Linked by y being raw_data_id from raw data table. - + @@ -487,10 +487,10 @@ Linked by y being raw_data_id from raw data table. - + - + @@ -540,7 +540,7 @@ Linked by y being raw_data_id from raw data table. - + @@ -553,10 +553,10 @@ Linked by y being raw_data_id from raw data table. - + - + @@ -628,7 +628,7 @@ Linked by y being raw_data_id from raw data table. - + @@ -645,7 +645,7 @@ Linked by y being raw_data_id from raw data table. - + @@ -662,10 +662,10 @@ Linked by y being raw_data_id from raw data table. - + - + @@ -720,7 +720,7 @@ Linked by y being raw_data_id from raw data table. - + @@ -842,7 +842,7 @@ Controlled Vocabulary]]> - + @@ -868,7 +868,7 @@ Controlled Vocabulary]]> - + @@ -883,10 +883,10 @@ Controlled Vocabulary]]> - + - + @@ -903,7 +903,7 @@ Controlled Vocabulary]]> - + @@ -929,7 +929,7 @@ Controlled Vocabulary]]> - + @@ -1076,7 +1076,6 @@ Controlled Vocabulary]]> - @@ -1090,7 +1089,6 @@ Controlled Vocabulary]]> - @@ -1100,38 +1098,40 @@ Controlled Vocabulary]]> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + analysis tables diff --git a/qiita_db/support_files/qiita-db.html b/qiita_db/support_files/qiita-db.html index e550c8f2b..f792e5970 100644 --- a/qiita_db/support_files/qiita-db.html +++ b/qiita_db/support_files/qiita-db.html @@ -212,12 +212,7 @@ analysis_sample references analysis ( analysis_id ) analysis_id - Foreign Key fk_study_experimental_factor - study_experimental_factor references study ( study_id ) - -study_id + analysis_sample references analysis ( analysis_id )' style='fill:#a1a0a0;'>analysis_id Foreign Key fk_analysis_job_analysis analysis_job references analysis ( analysis_id ) @@ -272,17 +267,7 @@ column_controlled_vocabularies references controlled_vocabularies ( controlled_vocab_id ) controlled_vocab_id - Foreign Key fk_investigation_study - investigation_study references investigation ( investigation_id ) - -investigation_id - Foreign Key fk_investigation_study_study - investigation_study references study ( study_id ) - -study_id + column_controlled_vocabularies references controlled_vocabularies ( controlled_vocab_id )' style='fill:#a1a0a0;'>controlled_vocab_id Foreign Key fk_term_path_ontology term_path references ontology ( ontology_id ) @@ -407,62 +392,87 @@ study references portal_type ( portal_type_id ) portal_type_id + study references portal_type ( portal_type_id )' style='fill:#a1a0a0;'>portal_type_id + Foreign Key fk_processed_params_uclust + processed_params_uclust references reference ( reference_id ) + +reference_id + Foreign Key fk_user_user_level + qiita_user references user_level ( user_level_id ) + +user_level_id + Foreign Key fk_study_experimental_factor + study_experimental_factor references study ( study_id ) + +study_id + Foreign Key fk_study_pmid_study + study_pmid references study ( study_id ) + +study_id Foreign Key fk_study_mapping_columns_study study_sample_columns references study ( study_id ) study_id - Foreign Key fk_prep_columns_raw_data - raw_data_prep_columns references raw_data ( raw_data_id ) + study_sample_columns references study ( study_id )' style='fill:#a1a0a0;'>study_id + Foreign Key fk_investigation_study + investigation_study references investigation ( investigation_id ) -raw_data_id - Foreign Key fk_required_prep_info_raw_data - common_prep_info references raw_data ( raw_data_id ) +investigation_id + Foreign Key fk_investigation_study_study + investigation_study references study ( study_id ) -raw_data_id - Foreign Key fk_required_prep_info_emp_status - common_prep_info references emp_status ( emp_status_id ) +study_id + Foreign Key fk_processed_data_filepath + processed_filepath references processed_data ( processed_data_id ) -emp_status_id - Foreign Key fk_required_prep_info - common_prep_info references required_sample_info ( sample_id ) +processed_data_id + Foreign Key fk_processed_data_filepath_0 + processed_filepath references filepath ( filepath_id ) -sample_id - Foreign Key fk_required_prep_info_0 - common_prep_info references data_type ( data_type_id ) +filepath_id + Foreign Key fk_processed_data + processed_data references preprocessed_data ( preprocessed_data_id ) -data_type_id +preprocessed_data_id + Foreign Key fk_filepath + filepath references filepath_type ( filepath_type_id ) + +filepath_type_id + Foreign Key fk_preprocessed_filepath + preprocessed_filepath references preprocessed_data ( preprocessed_data_id ) + +preprocessed_data_id + Foreign Key fk_preprocessed_filepath_0 + preprocessed_filepath references filepath ( filepath_id ) + +filepath_id Foreign Key fk_preprocessed_data_raw_data preprocessed_data references raw_data ( raw_data_id ) raw_data_id - Foreign Key fk_study_users_study - study_users references study ( study_id ) - -study_id - Foreign Key fk_study_users_user - study_users references qiita_user ( email ) - -email - Foreign Key fk_study_raw_data_study - study_raw_data references study ( study_id ) + preprocessed_data references raw_data ( raw_data_id )' style='fill:#a1a0a0;'>raw_data_id + Foreign Key fk_prep_columns_raw_data + raw_data_prep_columns references raw_data ( raw_data_id ) -study_id - Foreign Key fk_study_raw_data_raw_data - study_raw_data references raw_data ( raw_data_id ) +raw_data_id + Foreign Key fk_raw_data_filetype + raw_data references filetype ( filetype_id ) -raw_data_id +filetype_id Foreign Key fk_raw_filepath raw_filepath references filepath ( filepath_id ) @@ -472,62 +482,52 @@ raw_filepath references raw_data ( raw_data_id ) raw_data_id - Foreign Key fk_preprocessed_filepath - preprocessed_filepath references preprocessed_data ( preprocessed_data_id ) + raw_filepath references raw_data ( raw_data_id )' style='fill:#a1a0a0;'>raw_data_id + Foreign Key fk_study_raw_data_study + study_raw_data references study ( study_id ) -preprocessed_data_id - Foreign Key fk_preprocessed_filepath_0 - preprocessed_filepath references filepath ( filepath_id ) +study_id + Foreign Key fk_study_raw_data_raw_data + study_raw_data references raw_data ( raw_data_id ) -filepath_id - Foreign Key fk_filepath - filepath references filepath_type ( filepath_type_id ) +raw_data_id + Foreign Key fk_study_users_study + study_users references study ( study_id ) -filepath_type_id - Foreign Key fk_study_pmid_study - study_pmid references study ( study_id ) +study_id + Foreign Key fk_study_users_user + study_users references qiita_user ( email ) -study_id - Foreign Key fk_raw_data_filetype - raw_data references filetype ( filetype_id ) +email + Foreign Key fk_required_prep_info_raw_data + common_prep_info references raw_data ( raw_data_id ) -filetype_id - Foreign Key fk_processed_params_uclust - processed_params_uclust references reference ( reference_id ) +raw_data_id + Foreign Key fk_required_prep_info_emp_status + common_prep_info references emp_status ( emp_status_id ) -reference_id - Foreign Key fk_processed_data_filepath - processed_filepath references processed_data ( processed_data_id ) +emp_status_id + Foreign Key fk_required_prep_info + common_prep_info references required_sample_info ( sample_id ) -processed_data_id - Foreign Key fk_processed_data_filepath_0 - processed_filepath references filepath ( filepath_id ) +sample_id + Foreign Key fk_required_prep_info_0 + common_prep_info references data_type ( data_type_id ) -filepath_id +data_type_id Foreign Key fk_required_sample_info_study required_sample_info references study ( study_id ) study_id - Foreign Key fk_processed_data - processed_data references preprocessed_data ( preprocessed_data_id ) - -preprocessed_data_id - Foreign Key fk_user_user_level - qiita_user references user_level ( user_level_id ) - -user_level_id + required_sample_info references study ( study_id )' style='fill:#a1a0a0;'>study_id job_statusTable qiita.job_status @@ -557,17 +557,6 @@ References processed_data ( processed_data_id ) sample_idsample_id bigint 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 - @@ -747,17 +736,6 @@ Referred by controlled_vocab_values ( controlled_vocab_id ) vocab_namevocab_name varchar not null - - - -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 ) - @@ -915,7 +893,15 @@ Referred by study_pmid ( 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_users ( study_id ) +Referred by study_experimental_factor ( study_id ) +Referred by study_pmid ( study_id ) +Referred by study_sample_columns ( study_id ) +Referred by required_sample_info ( study_id ) +Referred by investigation_study ( study_id ) +Referred by study_raw_data ( study_id ) +Referred by study_users ( study_id ) +Referred by required_sample_info ( study_id ) Index ( email ) emailemail varchar not null Email of study owner @@ -954,19 +940,6 @@ study_abstractstudy_abstract text not null vamps_idvamps_id varchar - - - -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 - @@ -997,19 +970,6 @@ 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 - @@ -1023,27 +983,6 @@ commandcommand varchar not null What command to call to run this function - - - -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 ) - @@ -1051,24 +990,10 @@ Type of file (FASTA, FASTQ, SPECTRA, etc) Primary Key ( filetype_id ) filetype_idfiletype_id bigserial not null -Referred by raw_data ( filetype_id ) +Referred by raw_data ( filetype_id ) +Referred by raw_data ( filetype_id ) typetype varchar not null - - - -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 ) -Referred by processed_data ( preprocessed_data_id ) - Index ( raw_data_id ) -raw_data_idraw_data_id integer -References raw_data ( raw_data_id ) - preprocessed_params_tablepreprocessed_params_table varchar not null -Name of table holding the params - preprocessed_params_idpreprocessed_params_id bigint not null - @@ -1076,7 +1001,8 @@ 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 ) +Referred by investigation_study ( investigation_id ) +Referred by investigation_study ( investigation_id ) namename varchar not null descriptiondescription varchar not null Describes the overarching goal of the investigation @@ -1084,86 +1010,16 @@ contact_person_idcontact_person_id bigint References study_person ( contact_person_id -> study_person_id ) - - - -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 ) - - - - -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 ) - - - - -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 ) - - - - -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 ) - filepath_typeTable qiita.filepath_type Primary Key ( filepath_type_id ) filepath_type_idfilepath_type_id bigserial not null -Referred by filepath ( filepath_type_id ) +Referred by filepath ( filepath_type_id ) +Referred by filepath ( filepath_type_id ) filepath_typefilepath_type varchar - - - -filepathTable qiita.filepath - Primary Key ( filepath_id ) -filepath_idfilepath_id bigserial not null -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 ) - - - - -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 - @@ -1206,51 +1062,6 @@ datadata bigint STUFFFFF - - - -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 ) -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 - - - - -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 - - - - -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 ) -Referred by preprocessed_data ( raw_data_id ) -Referred by raw_data_prep_columns ( raw_data_id ) -Referred by raw_filepath ( raw_data_id ) -Referred by study_raw_data ( raw_data_id ) - Index ( filetype_id ) -filetype_idfiletype_id bigint not null -References filetype ( filetype_id ) - submitted_to_insdcsubmitted_to_insdc bool not null default FALSE - @@ -1266,17 +1077,6 @@ enable_rev_strand_matchenable_rev_strand_match bool not null default TRUE suppress_new_clusterssuppress_new_clusters bool not null default TRUE - - - -processed_filepathTable qiita.processed_filepath - Unique Index ( processed_data_id ) -processed_data_idprocessed_data_id bigint not null -References processed_data ( processed_data_id ) - Index ( filepath_id ) -filepath_idfilepath_id bigint not null -References filepath ( filepath_id ) - @@ -1308,48 +1108,6 @@ Referred by required_sample_info ( required_sample_info_status_id ) statusstatus varchar - - - -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 common_prep_info ( sample_id ) - physical_locationphysical_location varchar not null -Where the sample itself is stored - has_physical_specimenhas_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 -Controlled vocabulary of sample types - 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_datecollection_date date not null - host_subject_idhost_subject_id varchar not null - descriptiondescription varchar not null - - - - -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 processed_filepath ( processed_data_id ) - preprocessed_data_idpreprocessed_data_id bigint not null -References preprocessed_data ( preprocessed_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 - @@ -1377,6 +1135,272 @@ pass_reset_timestamppass_reset_timestamp timestamp Time the reset code was generated + + + +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 + + + + +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 + + + + +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 + + + + +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 ) +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 + + + + +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 ) + + + + +processed_filepathTable qiita.processed_filepath + Unique Index ( processed_data_id ) +processed_data_idprocessed_data_id bigint not null +References processed_data ( processed_data_id ) + Index ( filepath_id ) +filepath_idfilepath_id bigint not null +References filepath ( filepath_id ) + + + + +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 processed_filepath ( processed_data_id ) +Referred by processed_filepath ( processed_data_id ) + preprocessed_data_idpreprocessed_data_id bigint not null +References preprocessed_data ( preprocessed_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 + + + + +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 + + + + +filepathTable qiita.filepath + Primary Key ( filepath_id ) +filepath_idfilepath_id bigserial not null +Referred by preprocessed_filepath ( filepath_id ) +Referred by processed_filepath ( filepath_id ) +Referred by raw_filepath ( filepath_id ) +Referred by processed_filepath ( filepath_id ) +Referred by preprocessed_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 ) + + + + +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 ) + + + + +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 ) +Referred by processed_data ( preprocessed_data_id ) +Referred by processed_data ( preprocessed_data_id ) +Referred by preprocessed_filepath ( preprocessed_data_id ) + Index ( raw_data_id ) +raw_data_idraw_data_id integer +References raw_data ( raw_data_id ) + preprocessed_params_tablepreprocessed_params_table varchar not null +Name of table holding the params + preprocessed_params_idpreprocessed_params_id bigint 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 + + + + +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 ) +Referred by preprocessed_data ( raw_data_id ) +Referred by raw_data_prep_columns ( raw_data_id ) +Referred by raw_filepath ( raw_data_id ) +Referred by study_raw_data ( raw_data_id ) +Referred by preprocessed_data ( raw_data_id ) +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 study_raw_data ( raw_data_id ) +Referred by common_prep_info ( raw_data_id ) + Index ( filetype_id ) +filetype_idfiletype_id bigint not null +References filetype ( filetype_id ) + submitted_to_insdcsubmitted_to_insdc bool not null default FALSE + + + + +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 ) + + + + +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 ) + + + + +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 ) + + + + +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 ) + + + + +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 common_prep_info ( sample_id ) +Referred by common_prep_info ( sample_id ) + physical_locationphysical_location varchar not null +Where the sample itself is stored + has_physical_specimenhas_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 +Controlled vocabulary of sample types + 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_datecollection_date date not null + host_subject_idhost_subject_id varchar not null + descriptiondescription varchar not null +

@@ -1471,41 +1495,6 @@ -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
study_experimental_factor
EFO ontological link of experimental factors to studies
study_id bigint NOT NULL
efo_id bigint NOT NULL
Indexes
idx_study_experimental_factor primary key ON study_id, efo_id
idx_study_experimental_factor_0 ON study_id
Foreign Keys
fk_study_experimental_factor ( study_id ) ref study (study_id)
-

@@ -2053,33 +2042,9 @@ - - - - - - -
( column_name ) ref mixs_field_description (column_name)
fk_column_controlled_vocab2 ( controlled_vocab_id ) ref controlled_vocabularies (controlled_vocab_id)
- -

- - - - - - - - - - - - - - - - - - + + + @@ -2088,41 +2053,22 @@

controlled_vocabularies
controlled_vocab_id bigserial NOT NULL
vocab_name varchar NOT NULL
Indexes
pk_controlled_vocabularies primary key ON controlled_vocab_id
fk_column_controlled_vocab2 ( controlled_vocab_id ) ref controlled_vocabularies (controlled_vocab_id)
- + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - + + @@ -2793,38 +2739,172 @@

investigation_study
controlled_vocabularies
investigation_id bigint NOT NULL controlled_vocab_id bigserial NOT NULL
study_id bigint NOT NULL vocab_name varchar NOT NULL
Indexes
idx_investigation_study primary key ON investigation_id, study_id
idx_investigation_study_investigation ON investigation_id
idx_investigation_study_study ON study_id
Foreign Keys
fk_investigation_study ( investigation_id ) ref investigation (investigation_id)
fk_investigation_study_study ( study_id ) ref study (study_id)
pk_controlled_vocabularies primary key ON controlled_vocab_id
- - + - - + + - - + + + + + + + + +
study_sample_columns
Holds information on which metadata columns are available for the study sample template
timeseries_type
study_id bigint NOT NULL timeseries_type_id bigserial NOT NULL
column_name varchar( 100 ) NOT NULL timeseries_type varchar NOT NULL
Indexes
pk_timeseries_type primary key ON timeseries_type_id
+ +

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

+ + + + + + + + + + + + + - - + + - - + +
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 varchar NOT NULL
Indexes
idx_study_mapping_columns primary key ON study_id, column_name, column_type
pk_emp_status primary key ON emp_status_id
idx_study_mapping_columns_study_id ON study_id
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
command
Available commands for jobs
command_id bigserial NOT NULL Unique identifier for function
name varchar NOT NULL
command varchar NOT NULL What command to call to run this function
Indexes
pk_command primary key ON command_id
+ +

+ + + + + + + + + + + + + + + + + + + + + + +
filetype
Type of file (FASTA, FASTQ, SPECTRA, etc)
filetype_id bigserial NOT NULL
type varchar NOT NULL
Indexes
pk_filetype primary key ON filetype_id
+ +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + @@ -2833,22 +2913,87 @@

investigation
Overarching investigation information. +An investigation comprises one or more individual studies.
investigation_id bigserial NOT NULL
name varchar NOT NULL
description varchar NOT NULL Describes the overarching goal of the investigation
contact_person_id bigint
Indexes
pk_investigation primary key ON investigation_id
idx_investigation ON contact_person_id
Foreign Keys
fk_study_mapping_columns_study ( study_id ) ref study (study_id) fk_investigation_study_person ( contact_person_id ) ref study_person (study_person_id)
- + + + + + + + + + + + + + + + + + + + +
timeseries_type
filepath_type
filepath_type_id bigserial NOT NULL
filepath_type varchar
Indexes
pk_filepath_type primary key ON filepath_type_id
+ +

+ + + + + + + + + + + + + + + + + + + + + + +
preprocessed_spectra_params
Parameters used for processing spectra data.
preprocessed_params_id bigserial NOT NULL
col varchar
Indexes
pk_preprocessed_spectra_params primary key ON preprocessed_params_id
+ +

+ + + + - - + + + + + + + + + + + + - - + + + + + + + - - + + @@ -2857,22 +3002,31 @@

preprocessed_sequence_illumina_params
Parameters used for processing illumina sequence data.
timeseries_type_id bigserial NOT NULL preprocessed_params_id bigserial NOT NULL
trim_length integer NOT NULL
max_bad_run_length integer NOT NULL DEFO 3
timeseries_type varchar NOT NULL min_per_read_length_fraction real NOT NULL DEFO 0.75
sequence_max_n integer NOT NULL DEFO 0
Indexes
pk_timeseries_type primary key ON timeseries_type_id
pk_preprocessed_sequence_illumina_params primary key ON preprocessed_params_id
- + + - - + + - + - + + + + + + - - + + @@ -2881,23 +3035,24 @@

data_type
sample_x
data for samples in study x (sample template) +x is the study_id from study table + +MAKE SURE sample_id IS FK TO sample_id IN required_sample_info TABLE
data_type_id bigserial NOT NULL sample_id varchar NOT NULL
data_typedescription varchar NOT NULL Data type (16S, metabolome, etc) the job will use
other_mapping_columns varchar Represents whatever other columns go with this study
Indexes
pk_data_type primary key ON data_type_id
pk_study_x_y primary key ON sample_id
- - + + - - + + - - - + + + - - + + @@ -2906,38 +3061,48 @@

emp_status
All possible statuses for projects relating to EMP. Whether they are part of, processed in accordance to, or not part of EMP.
prep_y
Information on how raw data y was prepared (prep template) +Linked by y being raw_data_id from raw data table.
emp_status_id bigserial NOT NULL sample_id varchar NOT NULL
emp_status varchar NOT NULL data bigint STUFFFFF
Indexes
pk_emp_status primary key ON emp_status_id
pk_prep_y primary key ON sample_id
- - + + - + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + @@ -2946,28 +3111,28 @@

raw_data_prep_columns
Holds the columns available for a given raw data prep
processed_params_uclust
Parameters used for processing data using method uclust
raw_data_idprocessed_params_id bigserial NOT NULL
reference_id bigint NOT NULL What version of reference or type of reference used
similarity float8 NOT NULL DEFO 0.97
column_name varchar NOT NULL enable_rev_strand_match bool NOT NULL DEFO TRUE
column_type varchar NOT NULL suppress_new_clusters bool NOT NULL DEFO TRUE
Indexes
idx_raw_data_prep_columns primary key ON raw_data_id, column_name, column_type
pk_processed_params_uclust primary key ON processed_params_id
idx_prep_columns ON raw_data_id
idx_processed_params_uclust ON reference_id
Foreign Keys
fk_prep_columns_raw_data ( raw_data_id ) ref raw_data (raw_data_id) fk_processed_params_uclust ( reference_id ) ref reference (reference_id)
- - + + - - - + + + - + - - - + + + - - + + @@ -2976,89 +3141,27 @@

command
Available commands for jobs
user_level
Holds available user levels
command_id bigserial NOT NULL Unique identifier for function user_level_id serial NOT NULL
name varchar NOT NULL One of the user levels (admin, user, guest, etc)
command varchar NOT NULL What command to call to run this function description text NOT NULL
Indexes
pk_command primary key ON command_id
pk_user_level primary key ON user_level_id
- + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -3067,23 +3170,22 @@

common_prep_info
study_status
raw_data_idstudy_status_id bigserial NOT NULL
sample_idstatus varchar NOT NULL
center_name varchar
center_project_name varchar
ebi_submission_accession varchar
ebi_study_accession varchar
emp_status_id bigint NOT NULL
data_type_id bigint NOT NULL description varchar NOT NULL
Indexes
idx_required_prep_info ON raw_data_id
idx_required_prep_info_0 ON emp_status_id
idx_required_prep_info_1 primary key ON raw_data_id, sample_id
idx_required_prep_info_2 ON sample_id
idx_required_prep_info_3 ON data_type_id
Foreign Keys
fk_required_prep_info_raw_data ( raw_data_id ) ref raw_data (raw_data_id)
fk_required_prep_info_emp_status ( emp_status_id ) ref emp_status (emp_status_id)
fk_required_prep_info ( sample_id ) ref required_sample_info (sample_id)
fk_required_prep_info_0 ( data_type_id ) ref data_type (data_type_id)
pk_study_status primary key ON study_status_id
- - + - + - - + + - - + + @@ -3092,88 +3194,73 @@

filetype
Type of file (FASTA, FASTQ, SPECTRA, etc)
required_sample_info_status
filetype_idrequired_sample_info_status_id bigserial NOT NULL
type varchar NOT NULL status varchar
Indexes
pk_filetype primary key ON filetype_id
pk_sample_status primary key ON required_sample_info_status_id
- + + - - + + - - - + + + - + - + - - + + - - - - - - - - - - - - - - - -
preprocessed_data
qiita_user
Holds all user information
preprocessed_data_id bigserial NOT NULL email varchar NOT NULL
raw_data_id integer user_level_id integer NOT NULL DEFO 5 user level
preprocessed_params_tablepassword varchar NOT NULL Name of table holding the params
preprocessed_params_id bigint NOT NULL name varchar
Indexes
pk_preprocessed_data primary key ON preprocessed_data_id
idx_preprocessed_data ON raw_data_id
Foreign Keys
fk_preprocessed_data_raw_data ( raw_data_id ) ref raw_data (raw_data_id)
- -

- - - - - - + + + + - - + + - - + + - - - + + + - - - + + + + + + + + - - + + - - + + - - + + @@ -3182,8 +3269,8 @@

investigation
Overarching investigation information. -An investigation comprises one or more individual studies.
affiliation varchar
investigation_id bigserial NOT NULL address varchar
name varchar NOT NULL phone varchar
description varchar NOT NULL Describes the overarching goal of the investigation user_verify_code varchar Code for initial user email verification
contact_person_id bigint pass_reset_code varchar Randomly generated code for password reset
pass_reset_timestamp timestamp Time the reset code was generated
Indexes
pk_investigation primary key ON investigation_id
pk_user primary key ON email
idx_investigation ON contact_person_id
idx_user ON user_level_id
Foreign Keys
fk_investigation_study_person ( contact_person_id ) ref study_person (study_person_id) fk_user_user_level ( user_level_id ) ref user_level (user_level_id)
- - + + @@ -3192,42 +3279,33 @@ - - + + - - + + - + - - - - - + - - - - -
study_users
Links shared studies to users they are shared with
study_experimental_factor
EFO ontological link of experimental factors to studies
email varchar NOT NULL efo_id bigint NOT NULL
Indexes
idx_study_users primary key ON study_id, email
idx_study_experimental_factor primary key ON study_id, efo_id
idx_study_users_0
idx_study_experimental_factor_0 ON study_id
idx_study_users_1 ON email
Foreign Keys
fk_study_users_studyfk_study_experimental_factor ( study_id ) ref study (study_id)
fk_study_users_user ( email ) ref qiita_user (email)


- - + + @@ -3236,71 +3314,63 @@ - - + + - - + + - - + + - + - - - - -
study_raw_data
links study to its raw data
study_pmid
Links a study to all PMIDs for papers created from study
raw_data_id bigint NOT NULL pmid varchar NOT NULL
Indexes
idx_study_raw_data ON study_id
idx_study_pmid primary key ON study_id, pmid
idx_study_raw_data_0 primary key ON study_id, raw_data_id
idx_study_pmid_0 ON study_id
Foreign Keys
fk_study_raw_data_studyfk_study_pmid_study ( study_id ) ref study (study_id)
fk_study_raw_data_raw_data ( raw_data_id ) ref raw_data (raw_data_id)


- + + - + - - + + - - - - + + + + - - + + + - - + + - - - - - - - + + @@ -3309,65 +3379,38 @@

raw_filepath
study_sample_columns
Holds information on which metadata columns are available for the study sample template
raw_data_idstudy_id bigint NOT NULL
filepath_id bigint NOT NULL column_name varchar( 100 ) NOT NULL
Indexes
idx_raw_filepath primary key ON raw_data_id, filepath_id
column_type varchar NOT NULL
idx_raw_filepath_0 ON filepath_id
Indexes
idx_study_mapping_columns primary key ON study_id, column_name, column_type
idx_raw_filepath_1 ON raw_data_id
idx_study_mapping_columns_study_id ON study_id
Foreign Keys
fk_raw_filepath ( filepath_id ) ref filepath (filepath_id)
fk_raw_filepath_0 ( raw_data_id ) ref raw_data (raw_data_id) fk_study_mapping_columns_study ( study_id ) ref study (study_id)
- + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - + + + - -
preprocessed_filepath
study_person
Contact information for the various people involved in a study
preprocessed_data_id bigint NOT NULL study_person_id bigserial NOT NULL
filepath_id bigint NOT NULL name varchar NOT NULL
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) email varchar NOT NULL
- -

- - - - - - - + + - + - - + + @@ -3376,37 +3419,41 @@

filepath_type
filepath_type_id bigserial NOT NULL address varchar( 100 )
filepath_typephone varchar
Indexes
pk_filepath_type primary key ON filepath_type_id
pk_study_person primary key ON study_person_id
- + - - - - - - - + + - + - - + + - - + + + + + + - - + + + + + + + @@ -3415,33 +3462,37 @@

filepath
investigation_study
filepath_id bigserial NOT NULL
filepath varchar NOT NULL investigation_id bigint NOT NULL
filepath_type_idstudy_id bigint NOT NULL
Indexes
pk_filepath primary key ON filepath_id
idx_investigation_study primary key ON investigation_id, study_id
idx_filepath ON filepath_type_id
idx_investigation_study_investigation ON investigation_id
idx_investigation_study_study ON study_id
Foreign Keys
fk_filepath ( filepath_type_id ) ref filepath_type (filepath_type_id) fk_investigation_study ( investigation_id ) ref investigation (investigation_id)
fk_investigation_study_study ( study_id ) ref study (study_id)
- - + - + - - + + - - + + - - + + - - + + + + + + + @@ -3450,23 +3501,43 @@

study_pmid
Links a study to all PMIDs for papers created from study
processed_filepath
study_idprocessed_data_id bigint NOT NULL
pmid varchar NOT NULL filepath_id bigint NOT NULL
Indexes
idx_study_pmid primary key ON study_id, pmid
pk_processed_data_filepath unique ON processed_data_id
idx_study_pmid_0 ON study_id
idx_processed_data_filepath ON filepath_id
Foreign Keys
fk_study_pmid_study ( study_id ) ref study (study_id) fk_processed_data_filepath ( processed_data_id ) ref processed_data (processed_data_id)
fk_processed_data_filepath_0 ( filepath_id ) ref filepath (filepath_id)
- - + - + - - + + + + + + + + + + + + + + + + + - - + + + + + + + + @@ -3475,38 +3546,42 @@

preprocessed_spectra_params
Parameters used for processing spectra data.
processed_data
preprocessed_params_idprocessed_data_id bigserial NOT NULL
col varchar preprocessed_data_id bigint 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_preprocessed_spectra_params primary key ON preprocessed_params_id
pk_processed_data primary key ON processed_data_id
Foreign Keys
fk_processed_data ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id)
- - + - + - - + + - - + + - - + + - - + + + + + + + - - + + @@ -3515,31 +3590,37 @@

preprocessed_sequence_illumina_params
Parameters used for processing illumina sequence data.
reference
preprocessed_params_idreference_id bigserial NOT NULL
trim_length integer NOT NULL reference_name varchar NOT NULL
max_bad_run_length integer NOT NULL DEFO 3 reference_version varchar
min_per_read_length_fraction real NOT NULL DEFO 0.75 sequence_filepath varchar NOT NULL
sequence_max_n integer NOT NULL DEFO 0 taxonomy_filepath varchar
tree_filepath varchar
Indexes
pk_preprocessed_sequence_illumina_params primary key ON preprocessed_params_id
pk_reference primary key ON reference_id
- - + - - + + - + - - - + + + - - + + + + + + + + + + + + @@ -3548,24 +3629,41 @@

sample_x
data for samples in study x (sample template) -x is the study_id from study table - -MAKE SURE sample_id IS FK TO sample_id IN required_sample_info TABLE
filepath
sample_id varchar NOT NULL filepath_id bigserial NOT NULL
descriptionfilepath varchar NOT NULL
other_mapping_columns varchar Represents whatever other columns go with this study filepath_type_id bigint NOT NULL
Indexes
pk_study_x_y primary key ON sample_id
pk_filepath primary key ON filepath_id
idx_filepath ON filepath_type_id
Foreign Keys
fk_filepath ( filepath_type_id ) ref filepath_type (filepath_type_id)
- - + - - + + - - - + + + - - + + + + + + + + + + + + + + + + + + + + + @@ -3574,38 +3672,42 @@

prep_y
Information on how raw data y was prepared (prep template) -Linked by y being raw_data_id from raw data table.
preprocessed_filepath
sample_id varchar NOT NULL preprocessed_data_id bigint NOT NULL
data bigint STUFFFFF filepath_id bigint NOT NULL
Indexes
pk_prep_y primary key ON sample_id
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)
- - + - + - - + + - + - - - - - - + - - + + - - + + + + + + + + + + + + @@ -3614,42 +3716,38 @@

study_person
Contact information for the various people involved in a study
preprocessed_data
study_person_idpreprocessed_data_id bigserial NOT NULL
name varchar NOT NULL raw_data_id integer
emailpreprocessed_params_table varchar NOT NULL
address varchar( 100 ) Name of table holding the params
phone varchar preprocessed_params_id bigint NOT NULL
Indexes
pk_study_person primary key ON study_person_id
pk_preprocessed_data primary key ON preprocessed_data_id
idx_preprocessed_data ON raw_data_id
Foreign Keys
fk_preprocessed_data_raw_data ( raw_data_id ) ref raw_data (raw_data_id)
- + + - - + + - + - - - - - - + - - - - + + + + - - - - + + + - - - + + + + @@ -3697,48 +3795,81 @@

reference
raw_data_prep_columns
Holds the columns available for a given raw data prep
reference_id bigserial NOT NULL raw_data_id bigint NOT NULL
reference_namecolumn_name varchar NOT NULL
reference_version varchar
sequence_filepathcolumn_type varchar NOT NULL
taxonomy_filepath varchar
Indexes
idx_raw_data_prep_columns primary key ON raw_data_id, column_name, column_type
tree_filepath varchar
idx_prep_columns ON raw_data_id
Indexes
pk_reference primary key ON reference_id
Foreign Keys
fk_prep_columns_raw_data ( raw_data_id ) ref raw_data (raw_data_id)
- - + - - + + - + - + + + + + + + + + + + + + + + - - - + + + - - + + + + + +
processed_params_uclust
Parameters used for processing data using method uclust
raw_filepath
processed_params_id bigserial NOT NULL raw_data_id bigint NOT NULL
reference_idfilepath_id bigint NOT NULL What version of reference or type of reference used
Indexes
idx_raw_filepath primary key ON raw_data_id, filepath_id
idx_raw_filepath_0 ON filepath_id
idx_raw_filepath_1 ON raw_data_id
Foreign Keys
similarity float8 NOT NULL DEFO 0.97 fk_raw_filepath ( filepath_id ) ref filepath (filepath_id)
enable_rev_strand_match bool NOT NULL DEFO TRUE fk_raw_filepath_0 ( raw_data_id ) ref raw_data (raw_data_id)
+ +

+ + + + + + + + + - - + + - - + + - - + + + + + + + + - - - + + @@ -3747,37 +3878,42 @@

study_raw_data
links study to its raw data
study_id bigint NOT NULL
suppress_new_clusters bool NOT NULL DEFO TRUE raw_data_id bigint NOT NULL
Indexes
pk_processed_params_uclust primary key ON processed_params_id
idx_study_raw_data ON study_id
idx_processed_params_uclust ON reference_id
idx_study_raw_data_0 primary key ON study_id, raw_data_id
Foreign Keys
fk_study_raw_data_study ( study_id ) ref study (study_id)
Foreign Keys
fk_processed_params_uclust ( reference_id ) ref reference (reference_id) fk_study_raw_data_raw_data ( raw_data_id ) ref raw_data (raw_data_id)
- + + - + - - + + - - + + - - + + + + + + - - + + - - + + @@ -3786,81 +3922,89 @@

processed_filepath
study_users
Links shared studies to users they are shared with
processed_data_idstudy_id bigint NOT NULL
filepath_id bigint NOT NULL email varchar NOT NULL
Indexes
pk_processed_data_filepath unique ON processed_data_id
idx_study_users primary key ON study_id, email
idx_processed_data_filepath ON filepath_id
idx_study_users_0 ON study_id
idx_study_users_1 ON email
Foreign Keys
fk_processed_data_filepath ( processed_data_id ) ref processed_data (processed_data_id) fk_study_users_study ( study_id ) ref study (study_id)
fk_processed_data_filepath_0 ( filepath_id ) ref filepath (filepath_id) fk_study_users_user ( email ) ref qiita_user (email)
- - + - - + + - + - + - - + + - - - - + + + + - -
user_level
Holds available user levels
common_prep_info
user_level_id serial NOT NULL raw_data_id bigserial NOT NULL
namesample_id varchar NOT NULL One of the user levels (admin, user, guest, etc)
description text NOT NULL center_name varchar
Indexes
pk_user_level primary key ON user_level_id
center_project_name varchar
- -

- - - - - - - + + - - + + - - + + + + + + + - - + + - -
study_status
study_status_id bigserial NOT NULL ebi_submission_accession varchar
status varchar NOT NULL ebi_study_accession varchar
description varchar NOT NULL emp_status_id bigint NOT NULL
data_type_id bigint NOT NULL
Indexes
pk_study_status primary key ON study_status_id
idx_required_prep_info ON raw_data_id
- -

- - - - - + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + + + + + + @@ -3954,124 +4098,4 @@
required_sample_info_status
idx_required_prep_info_0 ON emp_status_id
idx_required_prep_info_1 primary key ON raw_data_id, sample_id
idx_required_prep_info_2 ON sample_id
idx_required_prep_info_3 ON data_type_id
Foreign Keys
required_sample_info_status_id bigserial NOT NULL fk_required_prep_info_raw_data ( raw_data_id ) ref raw_data (raw_data_id)
status varchar fk_required_prep_info_emp_status ( emp_status_id ) ref emp_status (emp_status_id)
Indexes
pk_sample_status primary key ON required_sample_info_status_id
fk_required_prep_info ( sample_id ) ref required_sample_info (sample_id)
fk_required_prep_info_0 ( data_type_id ) ref data_type (data_type_id)
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
processed_data
processed_data_id bigserial NOT NULL
preprocessed_data_id bigint 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 ( preprocessed_data_id ) ref preprocessed_data (preprocessed_data_id)
- -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
qiita_user
Holds all user information
email varchar NOT NULL
user_level_id integer NOT NULL DEFO 5 user level
password varchar NOT NULL
name varchar
affiliation varchar
address varchar
phone varchar
user_verify_code varchar Code for initial user email verification
pass_reset_code varchar Randomly generated code for password reset
pass_reset_timestamp timestamp Time the reset code was generated
Indexes
pk_user primary key ON email
idx_user ON user_level_id
Foreign Keys
fk_user_user_level ( user_level_id ) ref user_level (user_level_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 9192fc3e1..406f4e457 100644 --- a/qiita_db/support_files/qiita-db.sql +++ b/qiita_db/support_files/qiita-db.sql @@ -125,7 +125,7 @@ CREATE TABLE qiita.raw_data ( filetype_id bigint NOT NULL, submitted_to_insdc bool DEFAULT FALSE NOT NULL, CONSTRAINT pk_raw_data UNIQUE ( raw_data_id ) , - CONSTRAINT fk_raw_data_filetype FOREIGN KEY ( filetype_id ) REFERENCES qiita.filetype( filetype_id ) + CONSTRAINT fk_raw_data_filetype FOREIGN KEY ( filetype_id ) REFERENCES qiita.filetype( filetype_id ) ON DELETE CASCADE ); CREATE INDEX idx_raw_data ON qiita.raw_data ( filetype_id ); @@ -135,7 +135,7 @@ CREATE TABLE qiita.raw_data_prep_columns ( column_name varchar NOT NULL, column_type varchar NOT NULL, CONSTRAINT idx_raw_data_prep_columns PRIMARY KEY ( raw_data_id, column_name, column_type ), - CONSTRAINT fk_prep_columns_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) + CONSTRAINT fk_prep_columns_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) ON DELETE CASCADE ); CREATE INDEX idx_prep_columns ON qiita.raw_data_prep_columns ( raw_data_id ); @@ -348,7 +348,7 @@ CREATE TABLE qiita.filepath ( filepath varchar NOT NULL, filepath_type_id bigint NOT NULL, CONSTRAINT pk_filepath PRIMARY KEY ( filepath_id ), - CONSTRAINT fk_filepath FOREIGN KEY ( filepath_type_id ) REFERENCES qiita.filepath_type( filepath_type_id ) + CONSTRAINT fk_filepath FOREIGN KEY ( filepath_type_id ) REFERENCES qiita.filepath_type( filepath_type_id ) ON DELETE CASCADE ); CREATE INDEX idx_filepath ON qiita.filepath ( filepath_type_id ); @@ -393,7 +393,7 @@ CREATE TABLE qiita.preprocessed_data ( preprocessed_params_table varchar NOT NULL, preprocessed_params_id bigint NOT NULL, CONSTRAINT pk_preprocessed_data PRIMARY KEY ( preprocessed_data_id ), - CONSTRAINT fk_preprocessed_data_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) + CONSTRAINT fk_preprocessed_data_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) ON DELETE CASCADE ); CREATE INDEX idx_preprocessed_data ON qiita.preprocessed_data ( raw_data_id ); @@ -404,8 +404,8 @@ CREATE TABLE qiita.preprocessed_filepath ( preprocessed_data_id bigint NOT NULL, filepath_id bigint NOT NULL, CONSTRAINT idx_preprocessed_filepath PRIMARY KEY ( preprocessed_data_id, filepath_id ), - CONSTRAINT fk_preprocessed_filepath FOREIGN KEY ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) , - CONSTRAINT fk_preprocessed_filepath_0 FOREIGN KEY ( filepath_id ) REFERENCES qiita.filepath( filepath_id ) + CONSTRAINT fk_preprocessed_filepath FOREIGN KEY ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) ON DELETE CASCADE , + CONSTRAINT fk_preprocessed_filepath_0 FOREIGN KEY ( filepath_id ) REFERENCES qiita.filepath( filepath_id ) ON DELETE CASCADE ); CREATE INDEX idx_preprocessed_filepath_0 ON qiita.preprocessed_filepath ( preprocessed_data_id ); @@ -419,7 +419,7 @@ CREATE TABLE qiita.processed_data ( 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 ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) + CONSTRAINT fk_processed_data FOREIGN KEY ( preprocessed_data_id ) REFERENCES qiita.preprocessed_data( preprocessed_data_id ) ON DELETE CASCADE ); COMMENT ON COLUMN qiita.processed_data.processed_params_table IS 'Name of table holding processing params'; @@ -430,8 +430,8 @@ CREATE TABLE qiita.processed_filepath ( processed_data_id bigint NOT NULL, filepath_id bigint NOT NULL, CONSTRAINT pk_processed_data_filepath UNIQUE ( processed_data_id ) , - CONSTRAINT 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 ) + CONSTRAINT fk_processed_data_filepath FOREIGN KEY ( processed_data_id ) REFERENCES qiita.processed_data( processed_data_id ) ON DELETE CASCADE , + CONSTRAINT fk_processed_data_filepath_0 FOREIGN KEY ( filepath_id ) REFERENCES qiita.filepath( filepath_id ) ON DELETE CASCADE ); CREATE INDEX idx_processed_data_filepath ON qiita.processed_filepath ( filepath_id ); @@ -483,8 +483,8 @@ CREATE TABLE qiita.raw_filepath ( raw_data_id bigint NOT NULL, filepath_id bigint NOT NULL, CONSTRAINT idx_raw_filepath PRIMARY KEY ( raw_data_id, filepath_id ), - CONSTRAINT fk_raw_filepath FOREIGN KEY ( filepath_id ) REFERENCES qiita.filepath( filepath_id ) , - CONSTRAINT fk_raw_filepath_0 FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) + CONSTRAINT fk_raw_filepath FOREIGN KEY ( filepath_id ) REFERENCES qiita.filepath( filepath_id ) ON DELETE CASCADE , + CONSTRAINT fk_raw_filepath_0 FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) ON DELETE CASCADE ); CREATE INDEX idx_raw_filepath_0 ON qiita.raw_filepath ( filepath_id ); @@ -549,7 +549,7 @@ CREATE TABLE qiita.study_experimental_factor ( study_id bigint NOT NULL, efo_id bigint NOT NULL, CONSTRAINT idx_study_experimental_factor PRIMARY KEY ( study_id, efo_id ), - CONSTRAINT fk_study_experimental_factor FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) + CONSTRAINT fk_study_experimental_factor FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) ON DELETE CASCADE ); CREATE INDEX idx_study_experimental_factor_0 ON qiita.study_experimental_factor ( study_id ); @@ -560,7 +560,7 @@ CREATE TABLE qiita.study_pmid ( study_id bigint NOT NULL, pmid varchar NOT NULL, CONSTRAINT idx_study_pmid PRIMARY KEY ( study_id, pmid ), - CONSTRAINT fk_study_pmid_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) + CONSTRAINT fk_study_pmid_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) ON DELETE CASCADE ); CREATE INDEX idx_study_pmid_0 ON qiita.study_pmid ( study_id ); @@ -571,8 +571,8 @@ CREATE TABLE qiita.study_raw_data ( study_id bigint NOT NULL, raw_data_id bigint NOT NULL, CONSTRAINT idx_study_raw_data_0 PRIMARY KEY ( study_id, raw_data_id ), - CONSTRAINT fk_study_raw_data_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) , - CONSTRAINT fk_study_raw_data_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) + CONSTRAINT fk_study_raw_data_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) ON DELETE CASCADE , + CONSTRAINT fk_study_raw_data_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) ON DELETE CASCADE ); CREATE INDEX idx_study_raw_data ON qiita.study_raw_data ( study_id ); @@ -584,7 +584,7 @@ CREATE TABLE qiita.study_sample_columns ( column_name varchar(100) NOT NULL, column_type varchar NOT NULL, CONSTRAINT idx_study_mapping_columns PRIMARY KEY ( study_id, column_name, column_type ), - CONSTRAINT fk_study_mapping_columns_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) + CONSTRAINT fk_study_mapping_columns_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) ON DELETE CASCADE ); CREATE INDEX idx_study_mapping_columns_study_id ON qiita.study_sample_columns ( study_id ); @@ -595,7 +595,7 @@ CREATE TABLE qiita.study_users ( study_id bigint NOT NULL, email varchar NOT NULL, CONSTRAINT idx_study_users PRIMARY KEY ( study_id, email ), - CONSTRAINT fk_study_users_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) , + CONSTRAINT fk_study_users_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) ON DELETE CASCADE , CONSTRAINT fk_study_users_user FOREIGN KEY ( email ) REFERENCES qiita.qiita_user( email ) ); @@ -663,7 +663,7 @@ CREATE TABLE qiita.investigation_study ( study_id bigint NOT NULL, CONSTRAINT idx_investigation_study PRIMARY KEY ( investigation_id, study_id ), CONSTRAINT fk_investigation_study FOREIGN KEY ( investigation_id ) REFERENCES qiita.investigation( investigation_id ) , - CONSTRAINT fk_investigation_study_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) + CONSTRAINT fk_investigation_study_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) ON DELETE CASCADE ); CREATE INDEX idx_investigation_study_investigation ON qiita.investigation_study ( investigation_id ); @@ -718,7 +718,7 @@ CREATE TABLE qiita.required_sample_info ( description varchar NOT NULL, CONSTRAINT idx_common_sample_information PRIMARY KEY ( study_id, sample_id ), CONSTRAINT pk_required_sample_info UNIQUE ( sample_id ) , - CONSTRAINT fk_required_sample_info_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) , + CONSTRAINT fk_required_sample_info_study FOREIGN KEY ( study_id ) REFERENCES qiita.study( study_id ) ON DELETE CASCADE , CONSTRAINT fk_required_sample_info FOREIGN KEY ( required_sample_info_status_id ) REFERENCES qiita.required_sample_info_status( required_sample_info_status_id ) ); @@ -764,9 +764,9 @@ CREATE TABLE qiita.common_prep_info ( emp_status_id bigint NOT NULL, data_type_id bigint NOT NULL, CONSTRAINT idx_required_prep_info_1 PRIMARY KEY ( raw_data_id, sample_id ), - CONSTRAINT fk_required_prep_info_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) , + CONSTRAINT fk_required_prep_info_raw_data FOREIGN KEY ( raw_data_id ) REFERENCES qiita.raw_data( raw_data_id ) ON DELETE CASCADE , CONSTRAINT fk_required_prep_info_emp_status FOREIGN KEY ( emp_status_id ) REFERENCES qiita.emp_status( emp_status_id ) , - CONSTRAINT fk_required_prep_info FOREIGN KEY ( sample_id ) REFERENCES qiita.required_sample_info( sample_id ) , + CONSTRAINT fk_required_prep_info FOREIGN KEY ( sample_id ) REFERENCES qiita.required_sample_info( sample_id ) ON DELETE CASCADE , CONSTRAINT fk_required_prep_info_0 FOREIGN KEY ( data_type_id ) REFERENCES qiita.data_type( data_type_id ) );