-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5199 from solgenomics/topic/tracking_transformation
Tracking transformation workflow
- Loading branch information
Showing
65 changed files
with
4,610 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#!/usr/bin/env perl | ||
|
||
=head1 NAME | ||
AddTransformationAndTrackingCvterms.pm | ||
=head1 SYNOPSIS | ||
mx-run ThisPackageName [options] -H hostname -D dbname -u username [-F] | ||
this is a subclass of L<CXGN::Metadata::Dbpatch> | ||
see the perldoc of parent class for more details. | ||
=head1 DESCRIPTION | ||
This patch adds autogenerated_name_metadata, autogenerated_name_format, default_plant_material project_property cvterms, progress_of project_relationship cvterm, tracking_transformation_json, completed_metadata stock_property cvterms. | ||
This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable> | ||
=head1 AUTHOR | ||
Titima Tantikanjana<tt15@cornell.edu> | ||
=head1 COPYRIGHT & LICENSE | ||
Copyright 2010 Boyce Thompson Institute for Plant Research | ||
This program is free software; you can redistribute it and/or modify | ||
it under the same terms as Perl itself. | ||
=cut | ||
|
||
|
||
package AddTransformationAndTrackingCvterms; | ||
|
||
use Moose; | ||
use Bio::Chado::Schema; | ||
use Try::Tiny; | ||
extends 'CXGN::Metadata::Dbpatch'; | ||
|
||
|
||
has '+description' => ( default => <<'' ); | ||
Description of this patch goes here | ||
has '+prereq' => ( | ||
default => sub { | ||
[], | ||
}, | ||
|
||
); | ||
|
||
sub patch { | ||
my $self=shift; | ||
|
||
print STDOUT "Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " ."; | ||
|
||
print STDOUT "\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n"; | ||
|
||
print STDOUT "\nExecuting the SQL commands.\n"; | ||
my $schema = Bio::Chado::Schema->connect( sub { $self->dbh->clone } ); | ||
|
||
|
||
print STDERR "INSERTING CV TERMS...\n"; | ||
|
||
my $terms = { | ||
'project_property' => [ | ||
'autogenerated_name_metadata', | ||
'autogenerated_name_format', | ||
'default_plant_material', | ||
], | ||
'project_relationship' => [ | ||
'progress_of', | ||
], | ||
'stock_property' => [ | ||
'tracking_transformation_json', | ||
'completed_metadata', | ||
] | ||
}; | ||
|
||
foreach my $t (keys %$terms){ | ||
foreach (@{$terms->{$t}}){ | ||
$schema->resultset("Cv::Cvterm")->create_with({ | ||
name => $_, | ||
cv => $t | ||
}); | ||
} | ||
} | ||
|
||
print "You're done!\n"; | ||
|
||
} | ||
|
||
|
||
#### | ||
1; # | ||
#### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.