Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revisit database schema on the analysis part so that it is compatible with multiple workflows #130

Open
dshao opened this issue Mar 19, 2020 · 2 comments

Comments

@dshao
Copy link
Contributor

dshao commented Mar 19, 2020

No description provided.

@dshao
Copy link
Contributor Author

dshao commented Apr 16, 2020

sample ---< sequencing_experiment ---< analysis_workflow_run ----------------< analysis    
                    |adapter_dimer_count               |history_id
                    |fastq_file                                  |workflow_category: e.g. "alignment"...
                    |fastqc_report                           |results: JSON

  • rename table sequence_alignment to analysis_workflow_run
  • add field workflow_category to table analysis_workflow_run
  • in table analysis_workflow_run, change all the alignment statistics to a JSON dictionary

@dshao
Copy link
Contributor Author

dshao commented Apr 29, 2020

Deployment plan

  1. first DB migration

switch to git branch "multi-workflow-scratch"

# start transaction;
# delete from DATABASECHANGELOG;
# commit;

$ grails dbm-changelog-sync

# start transaction;
# delete from DATABASECHANGELOG where id like "1588082889454%";
# delete from DATABASECHANGELOG where id like "1588127332358%";
# commit

$ grails dbm-update

  1. update objects in AnalysisWorkflowRun
start transaction;

update analysis_workflow_run set workflow_category = "Sequence Alignment";

update analysis_workflow_run set results = concat('{"bamFile":"', bam_file, 
                                                  '","peHistogram":"', pe_histogram,
                                                  '","mappedReads":', mapped_reads,
                                                  ',"uniquelyMappedReads":', uniquely_mapped_reads,
                                                  ',"dedupUniquelyMappedReads":', dedup_uniquely_mapped_reads,
                                                  ',"avgInsertSize":', avg_insert_size,
                                                  ',"stdDevInsertSize":', std_dev_insert_size,
                                                  ',"genomeCoverage":', genome_coverage, '}');

commit;
  1. second DB migration
    switch to git branch "multi-workflow"

$ grails dbm-update

  1. import updated database to production

$ sudo mysql pegr < filepath

The following maybe needed before import

# drop database pegr;
# create database pegr character set utf8 collate utf8_general_ci;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant