6 AddSequenceMetadataTypes.pm
10 mx-run AddSequenceMetadataTypes [options] -H hostname -D dbname -u username [-F]
12 this is a subclass of L<CXGN::Metadata::Dbpatch>
13 see the perldoc of parent class for more details.
17 This patch adds the CV and CVTerms for the Sequence Metadata Types (used by the featureprop_json table)
18 This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
22 =head1 COPYRIGHT & LICENSE
24 Copyright 2010 Boyce Thompson Institute for Plant Research
26 This program is free software; you can redistribute it and/or modify
27 it under the same terms as Perl itself.
32 package AddSequenceMetadataTypes
;
35 use Bio
::Chado
::Schema
;
37 extends
'CXGN::Metadata::Dbpatch';
40 has
'+description' => ( default => <<'' );
41 This patch adds the CV
and CVTerms
for the Sequence Metadata Types
(used by the featureprop_json table
)
53 print STDOUT
"Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " .";
55 print STDOUT
"\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n";
57 print STDOUT
"\nExecuting the SQL commands.\n";
58 my $schema = Bio
::Chado
::Schema
->connect( sub { $self->dbh->clone } );
59 my $cvterm_rs = $schema->resultset("Cv::Cvterm");
60 my $cv_rs = $schema->resultset("Cv::Cv");
62 print STDERR
"CREATING CV...\n";
63 my $cv = $cv_rs->find_or_create({ name
=> 'sequence_metadata_types' });
65 print STDERR
"ADDING CVTERMS...\n";
66 $cvterm_rs->create_with({
67 name
=> 'Gene Annotation',
68 cv
=> 'sequence_metadata_types'
70 $cvterm_rs->create_with({
71 name
=> 'GWAS Results',
72 cv
=> 'sequence_metadata_types'
74 $cvterm_rs->create_with({
76 cv
=> 'sequence_metadata_types'
79 print STDERR
"UPDATING DEFINITIONS...\n";
80 $self->dbh->do(<<EOSQL);
81 UPDATE public.cvterm SET definition = 'Provides sequence features (gene, mRNA, UTR, exon, CDS) and annotations based on alignments of biological evidence.'
82 WHERE name = 'Gene Annotation' AND cv_id = (SELECT cv_id FROM cv WHERE name = 'sequence_metadata_types');
84 UPDATE public.cvterm SET definition = 'Report of quantitative trait loci (QTLs) indentified by running rrBLUP analysis on phenotype trials and genotype trials within the T3 database.'
85 WHERE name = 'GWAS Results' AND cv_id = (SELECT cv_id FROM cv WHERE name = 'sequence_metadata_types');
87 UPDATE public.cvterm SET definition = 'Report of chromatine accessibility score. The report can be used to prioritize genomic variants and explain phenotypes. (https://genomebiology.biomedcentral.com/track/pdf/10.1186/s13059-020-02093-1)'
88 WHERE name = 'MNase' AND cv_id = (SELECT cv_id FROM cv WHERE name = 'sequence_metadata_types');
91 print "You're done!\n";