Skip to content

Commit 0a8d46b

Browse files
committed
Merge branch '1084-populate-db' into 1084-prep-template
2 parents 6b3e23d + 07811fc commit 0a8d46b

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

qiita_db/support_files/populate_test_db.sql

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -311,13 +311,12 @@ INSERT INTO qiita.raw_data (filetype_id) VALUES (3);
311311
-- Insert the raw data filepaths for study 1
312312
INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algorithm_id, data_directory_id) VALUES
313313
('1_s_G1_L001_sequences.fastq.gz', 1, '852952723', 1, 5),
314-
('1_s_G1_L001_sequences_barcodes.fastq.gz', 3, '852952723', 1, 5),
315-
('2_sequences.fastq.gz', 1, '852952723', 1, 5),
316-
('2_sequences_barcodes.fastq.gz', 3, '852952723', 1, 5);
314+
('1_s_G1_L001_sequences_barcodes.fastq.gz', 3, '852952723', 1, 5);
315+
-- ('2_sequences.fastq.gz', 1, '852952723', 1, 5),
316+
-- ('2_sequences_barcodes.fastq.gz', 3, '852952723', 1, 5);
317317

318318
-- Insert (link) the raw data with the raw filepaths
319-
-- INSERT INTO qiita.raw_filepath (raw_data_id, filepath_id) VALUES (1, 1), (1, 2);
320-
INSERT INTO qiita.raw_filepath (raw_data_id, filepath_id) VALUES (1, 1);
319+
INSERT INTO qiita.raw_filepath (raw_data_id, filepath_id) VALUES (1, 1), (1, 2);
321320

322321
-- Insert (link) the study with the raw data
323322
UPDATE qiita.prep_template SET raw_data_id = 1 WHERE prep_template_id = 1;
@@ -341,7 +340,7 @@ INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algor
341340
('1_seqs.demux', 6, 852952723, 1, 3);
342341

343342
-- Insert (link) the preprocessed data with the preprocessed filepaths
344-
INSERT INTO qiita.preprocessed_filepath (preprocessed_data_id, filepath_id) VALUES (1, 5), (1, 6), (1, 7);
343+
INSERT INTO qiita.preprocessed_filepath (preprocessed_data_id, filepath_id) VALUES (1, 3), (1, 4), (1, 5);
345344

346345
-- Insert processed information for study 0 and processed data 1
347346
INSERT INTO qiita.processed_data (processed_params_table, processed_params_id, processed_date, data_type_id, processed_data_status_id) VALUES ('processed_params_uclust', 1, 'Mon Oct 1 09:30:27 2012', 2, 3);
@@ -359,7 +358,7 @@ INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algor
359358
('GreenGenes_13_8_97_otus.tree', 12, '852952723', 1, 6);
360359

361360
-- Populate the reference table
362-
INSERT INTO qiita.reference (reference_name, reference_version, sequence_filepath, taxonomy_filepath, tree_filepath) VALUES ('Greengenes', '13_8', 8, 9, 10);
361+
INSERT INTO qiita.reference (reference_name, reference_version, sequence_filepath, taxonomy_filepath, tree_filepath) VALUES ('Greengenes', '13_8', 6, 7, 8);
363362

364363
-- Insert the processed params uclust used for preprocessed data 1
365364
INSERT INTO qiita.processed_params_uclust (similarity, enable_rev_strand_match, suppress_new_clusters, reference_id) VALUES (0.97, TRUE, TRUE, 1);
@@ -369,7 +368,7 @@ INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algor
369368
('1_study_1001_closed_reference_otu_table.biom', 7, '852952723', 1, 4);
370369

371370
-- Insert (link) the processed data with the processed filepath
372-
INSERT INTO qiita.processed_filepath (processed_data_id, filepath_id) VALUES (1, 11);
371+
INSERT INTO qiita.processed_filepath (processed_data_id, filepath_id) VALUES (1, 9);
373372

374373
-- Insert filepath for job results files
375374
INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algorithm_id, data_directory_id) VALUES
@@ -379,6 +378,9 @@ INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algor
379378
-- Insert jobs
380379
INSERT INTO qiita.job (data_type_id, job_status_id, command_id, options) VALUES (2, 1, 1, '{"--otu_table_fp":1}'), (2, 3, 2, '{"--mapping_fp":1,"--otu_table_fp":1}'), (2, 1, 2, '{"--mapping_fp":1,"--otu_table_fp":1}');
381380

381+
-- Add job results
382+
INSERT INTO qiita.job_results_filepath (job_id, filepath_id) VALUES (1, 10), (2, 11);
383+
382384
-- Insert Analysis
383385
INSERT INTO qiita.analysis (email, name, description, analysis_status_id, pmid) VALUES ('test@foo.bar', 'SomeAnalysis', 'A test analysis', 1, '121112'), ('test@foo.bar', 'SomeSecondAnalysis', 'Another test analysis', 1, '22221112');
384386

@@ -393,17 +395,14 @@ INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algor
393395
('1_analysis_18S.biom', 7, '852952723', 1, 1), ('1_analysis_mapping.txt', 9, '852952723', 1, 1);
394396

395397
-- Attach filepath to analysis
396-
INSERT INTO qiita.analysis_filepath (analysis_id, filepath_id, data_type_id) VALUES (1, 14, 2), (1, 15, NULL);
398+
INSERT INTO qiita.analysis_filepath (analysis_id, filepath_id, data_type_id) VALUES (1, 12, 2), (1, 13, NULL);
397399

398400
-- Attach samples to analysis
399401
INSERT INTO qiita.analysis_sample (analysis_id, processed_data_id, sample_id) VALUES (1,1,'1.SKB8.640193'), (1,1,'1.SKD8.640184'), (1,1,'1.SKB7.640196'), (1,1,'1.SKM9.640192'), (1,1,'1.SKM4.640180'), (2,1,'1.SKB8.640193'), (2,1,'1.SKD8.640184'), (2,1,'1.SKB7.640196'), (2,1,'1.SKM3.640197');
400402

401403
--Share analysis with shared user
402404
INSERT INTO qiita.analysis_users (analysis_id, email) VALUES (1, 'shared@foo.bar');
403405

404-
-- Add job results
405-
INSERT INTO qiita.job_results_filepath (job_id, filepath_id) VALUES (1, 12), (2, 13);
406-
407406
-- Add an ontology
408407
INSERT INTO qiita.ontology (ontology_id, ontology, fully_loaded, fullname, query_url, source_url, definition, load_date) VALUES (999999999, E'ENA', E'1', E'European Nucleotide Archive Submission Ontology', NULL, E'http://www.ebi.ac.uk/embl/Documentation/ENA-Reads.html', E'The ENA CV is to be used to annotate XML submissions to the ENA.', '2009-02-23 00:00:00');
409408

@@ -425,11 +424,11 @@ INSERT INTO qiita.term (term_id, ontology_id, term, identifier, definition, name
425424

426425
-- Create the new sample_template_filepath
427426
INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algorithm_id, data_directory_id) VALUES ('1_19700101-000000.txt', 14, '852952723', 1, 9);
428-
INSERT INTO qiita.sample_template_filepath VALUES (1, 16);
427+
INSERT INTO qiita.sample_template_filepath VALUES (1, 14);
429428

430-
INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algorithm_id, data_directory_id) VALUES
431-
('1_preprocess_test1.sff', 17, '852952723', 1, 5),
432-
('1_preprocess_test2.sff', 17, '852952723', 1, 5);
429+
-- INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algorithm_id, data_directory_id) VALUES
430+
-- ('1_preprocess_test1.sff', 17, '852952723', 1, 5),
431+
-- ('1_preprocess_test2.sff', 17, '852952723', 1, 5);
433432

434433
-- Insert the raw data information for study 1
435434
-- INSERT INTO qiita.raw_data (filetype_id) VALUES (1), (1);
@@ -462,4 +461,4 @@ INSERT INTO qiita.analysis_sample (analysis_id, processed_data_id, sample_id) VA
462461
-- Create the new prep_template_filepath
463462
INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algorithm_id, data_directory_id) VALUES ('1_prep_1_19700101-000000.txt', 15, '3703494589', 1, 9);
464463
INSERT INTO qiita.filepath (filepath, filepath_type_id, checksum, checksum_algorithm_id, data_directory_id) VALUES ('1_prep_1_qiime_19700101-000000.txt', 16, '3703494589', 1, 9);
465-
INSERT INTO qiita.prep_template_filepath VALUES (1, 19), (1, 20);
464+
INSERT INTO qiita.prep_template_filepath VALUES (1, 15), (1, 16);

0 commit comments

Comments
 (0)