Skip to content

Commit

Permalink
Merge pull request #5191 from solgenomics/topic/quality_control
Browse files Browse the repository at this point in the history
Phenotype Quality Control
  • Loading branch information
lukasmueller authored Jan 25, 2025
2 parents 8518f7a + 4a3fbb2 commit f59ba6e
Show file tree
Hide file tree
Showing 18 changed files with 2,743 additions and 381 deletions.
77 changes: 77 additions & 0 deletions db/00187/AddBreederRole.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env perl


=head1 NAME
AddBreederRole
=head1 SYNOPSIS
mx-run AddBreederRole [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 vendor role on sgn_people.sp_roles
This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
=head1 AUTHOR
Chris Simoes < [email protected] >
=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 AddBreederRole;

use Moose;

extends 'CXGN::Metadata::Dbpatch';


has '+description' => ( default => <<'' );
This patch adds vendor role on sgn_people.sp_roles
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";



$self->dbh->do(<<EOSQL);
--do your SQL here
--
INSERT INTO sgn_people.sp_roles(name) VALUES ('breeder');
EOSQL


print "You're done!\n";

}


####
1; #
####
86 changes: 86 additions & 0 deletions db/00187/AddValidatePhenotypeCvterm.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env perl


=head1 NAME
AddValidatePhenotypeCvterm
=head1 SYNOPSIS
mx-run AddValidadePhenotypeCvterm [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 phenotype_property cvterm for storing a suppressed plot phenotype.
This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
=head1 AUTHOR
Chris Simoes <[email protected]>
=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 AddValidatePhenotypeCvterm;

use Moose;
use Bio::Chado::Schema;
use Try::Tiny;
extends 'CXGN::Metadata::Dbpatch';


has '+description' => ( default => <<'' );
This patch adds phenotype_property cvterm for storing a suppressed plot phenotype.
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' => [
'validated_phenotype',
]
};

foreach my $t (keys %$terms){
foreach (@{$terms->{$t}}){
$schema->resultset("Cv::Cvterm")->create_with({
name => $_,
cv => $t
});
}
}


print "You're done!\n";
}


####
1; #
####
4 changes: 3 additions & 1 deletion js/source/entries/mixedmodels.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,12 @@ export function init(main_div) {
$('#mixed_model_analysis_prepare_button').click(function () {

dataset_id = get_dataset_id();
var dataset_trait_outliers = $('#dataset_trait_outliers').is(':checked') ? 1 : 0;

if (dataset_id != false) {
$.ajax({
url: '/ajax/mixedmodels/prepare',
data: { 'dataset_id': get_dataset_id() },
data: { 'dataset_id': get_dataset_id(),'dataset_trait_outliers': dataset_trait_outliers, },
success: function (r) {
if (r.error) {
alert(r.error);
Expand Down
Loading

0 comments on commit f59ba6e

Please sign in to comment.