Skip to content

Commit

Permalink
Merge branch 'solgenomics/sgn:master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
timparsons committed Oct 10, 2023
2 parents 1bba6e7 + 60d83e2 commit 738ec13
Show file tree
Hide file tree
Showing 42 changed files with 1,634 additions and 1,039 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
if: false #disabled for now, as testing script is broken
runs-on: ubuntu-latest
container:
image: breedbase/breedbase:v0.82
image: breedbase/breedbase:latest
env:
HOME: /root
MODE: 'TESTING'
Expand Down
2 changes: 1 addition & 1 deletion db/00174/AddListCreateDate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sub patch {
$self->dbh->do(<<EOSQL);
--do your SQL here
alter table sgn_people.list add column create_date timestamp NULL DEFAULT now();
ALTER TABLE sgn_people.list ADD COLUMN IF NOT EXISTS create_date timestamp NULL DEFAULT now();
EOSQL

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


=head1 NAME
AddPhenotypeStderr.pm
=head1 SYNOPSIS
mx-run AddPhenotypeStderr.pm [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 phenotype standard error.
This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable>
=head1 AUTHOR
Naama Menda<nm249@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 AddPhenotypeStderr;

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


has '+description' => ( default => <<'' );
This patch adds phenotype_property cvterm for storing phenotype standard error.
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 = {
'phenotype_property' => [
'phenotype_stderr',
]
};

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


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


####
1; #
####
20 changes: 13 additions & 7 deletions docs/03_managing_breeding_data/03_12.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,30 @@
title: "3.12 Using the Label Designer"
layout: doc_page
---

<!-- TOC-START -->
* TOC
{:toc}
<!-- TOC-END -->

Breedbase provides an interactive design tool for creating custom labels. To access the Label Desginer, click on “Label Designer” in the “Manage” menu. The following sections explain your many options as you advance through each step of the design workflow.

1: Select a Datasource
### 3.12.1 Select a Datasource

The first step is to select a data source. Select a field, genotyping, or crossing trial to populate your labels with the trial design information. Or select a list to populate your label with the list contents.
For data sources with multiple levels of information you will also be asked to pick a level (plot, plant, etc.) before proceeding.
The first step is to select a data source. Since the label designer can generate labels for different data types, you can optionally filter the source selection by the data type you're interested in. Then, select a field, genotyping, or crossing trial to populate your labels with the trial design information. Or select a list to populate your label with the list contents.
For data sources with multiple levels of information you will also be asked to pick a level (plot, plant, etc.) before proceeding. To generate plot-level labels for more than one trial at once, select a list of trials as the source and plot as the level.

![]({{"assets/gifs/gif1.gif" | relative_url }})

2: Set Page and Label Size
### 3.12.2 Set Page and Label Size

Now choose whether to create a new design or load a saved design. If you choose new, you will be prompted to select a page size and label size.
If you do not see your page or label size as an option, then select Custom and enter your desired dimensions in pixels, or 1/72nds of an inch.
If you choose saved, you will be prompted to select a saved design then will be taken directly to the design step with the saved design elements preloaded.

![]({{"assets/gifs/gif2.gif" | relative_url }})

3: Design Your Label
### 3.12.3 Design Your Label

Below is a draw area where you can begin adding elements to your label. First select a type, then field, size, and font, then click 'Add'
You can add text to an exisiting field or create a completely custom field by clicking 'Create Custom Field'
Expand All @@ -31,10 +37,10 @@ When you are satisfied with your design, click next!

![]({{"assets/gifs/gif3.gif" | relative_url }})

4: Set Page and Label Size
### 3.12.4 Set Page and Label Size and Sorting Options

Last step! Here you can tweak your formatting and page layout, save your design, or download your labels.
The additional settings dialog will allow you to fine tune the print margins and margins between labels. The units are pixels or 1/72nds of an inch. It's not recommended to change these until you've already done a test print.
The additional settings dialog will allow you to fine tune the print margins and margins between labels. The units are pixels or 1/72nds of an inch. It's not recommended to change these until you've already done a test print. Here you can also set sorting options to adjust the order of the individual labels. You can sort by 1-3 different properties (the available properties will depend on the data type of the labels). For example, if you're printing plot-level labels for multiple trials, you can sort first by trial name and then by plot number.
You can also set the # of copies per label, filter by rep, or download just the first page for test purposes.
To save you're design just type a unique name and hit save. This will save your design to your list manager where you can set it to public to share it with others.
Finally if you are ready just hit download to generate and download your labels!
Expand Down
28 changes: 25 additions & 3 deletions js/source/legacy/CXGN/BreedersToolbox/AddTrial.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jQuery(document).ready(function ($) {
var breeding_program = $("#select_breeding_program").val();
var location = $("#add_project_location").val().toString().trim(); // remove whitespace
var trial_year = $("#add_project_year").val();
var planting_date = $("#add_project_planting_date").val();
var description = $("#add_project_description").val();
var design_type = $("#select_design_method").val();
var stock_type = $("#select_stock_type").val();
Expand All @@ -74,6 +75,9 @@ jQuery(document).ready(function ($) {
else if (trial_year === '') {
alert("Please select a trial year");
}
else if (planting_date === '') {
alert("Please select a trial planting date");
}
else if (plot_width < 0 ){
alert("Please check the plot width");
}
Expand Down Expand Up @@ -487,6 +491,11 @@ jQuery(document).ready(function ($) {
function generate_experimental_design() {
var name = $('#new_trial_name').val();
var year = $('#add_project_year').val();
var planting_date = $('#add_project_planting_date').val();
// date formatting here from js to breedbase format
if (planting_date) {
planting_date = new Date(planting_date).toLocaleDateString("en-CA");
}
var desc = $('#add_project_description').val();
var locations = jQuery('#add_project_location').val();
var trial_location = JSON.stringify(locations);
Expand All @@ -496,7 +505,7 @@ jQuery(document).ready(function ($) {
var row_number_per_block=$('#row_number_per_block').val();
var col_number_per_block=$('#col_number_per_block').val();
var col_number=$('#col_number').val();
var plot_numbering_scheme = jQuery('input[name="plot_numbering_scheme"]:checked').val();
var plot_numbering_scheme = jQuery('input[name="plot_numbering_scheme"]:checked').val();

var stock_list_id;
var control_stock_list_id;
Expand Down Expand Up @@ -649,6 +658,7 @@ jQuery(document).ready(function ($) {
'project_name': name,
'project_description': desc,
'year': year,
'planting date' : planting_date,
'trial_location': trial_location,
'trial_stock_type': trial_stock_type,
'stock_list': stock_list,
Expand Down Expand Up @@ -915,6 +925,7 @@ jQuery(document).ready(function ($) {
jQuery("#container_field_map_view").css("display", "none");
var name = $('#new_trial_name').val();
var year = $('#add_project_year').val();
var planting_date = $('#add_project_planting_date').val();
var desc = $('textarea#add_project_description').val();
if (name == '') {
alert('Trial name required');
Expand All @@ -924,7 +935,10 @@ jQuery(document).ready(function ($) {
alert('Year and description are required.');
return;
}

if(planting_date === '' || desc === '') {
alert('Planting date and description are required.');
return;
}
if (stock_list_verified == 1 && seedlot_list_verified == 1){
generate_experimental_design();
} else if (cross_list_verified == 1 && stock_list_verified == 0 && family_name_list_verified == 0){
Expand Down Expand Up @@ -2014,6 +2028,11 @@ jQuery(document).ready(function ($) {
var list = new CXGN.List();
var name = jQuery('#new_trial_name').val();
var year = jQuery('#add_project_year').val();
var planting_date = jQuery('#add_project_planting_date').val();
// date formatting here from js to breedbase format
if (planting_date) {
planting_date = new Date(planting_date).toLocaleDateString("en-CA");
}
var desc = jQuery('#add_project_description').val();
var locations = jQuery('#add_project_location').val();
var trial_location = JSON.stringify(locations);
Expand Down Expand Up @@ -2081,7 +2100,7 @@ jQuery(document).ready(function ($) {
use_same_layout = "";
}

var plot_numbering_scheme = jQuery('input[name="plot_numbering_scheme"]:checked').val();
var plot_numbering_scheme = jQuery('input[name="plot_numbering_scheme"]:checked').val();

jQuery.ajax({
type: 'POST',
Expand All @@ -2096,6 +2115,7 @@ jQuery(document).ready(function ($) {
'project_description': desc,
//'trial_name': trial_name,
'year': year,
'planting_date' : planting_date,
'trial_type': trial_type,
'trial_location': trial_location,
'trial_stock_type': trial_stock_type,
Expand Down Expand Up @@ -2300,6 +2320,7 @@ jQuery(document).ready(function ($) {

jQuery('#new_trial_add_treatments_submit').click(function(){
var new_treatment_year = jQuery('#new_treatment_year').val();
var new_treament_planting_date = jQuery('#new_treatment_planting_date').val();
var new_treatment_description = jQuery('#new_treatment_description').val();
var new_treatment_date = jQuery('#new_treatment_date').val();
var new_treatment_type = jQuery('#new_treatment_type').val();
Expand Down Expand Up @@ -2333,6 +2354,7 @@ jQuery(document).ready(function ($) {
trial[trial_treatment]["new_treatment_type"] = new_treatment_type;
trial[trial_treatment]["new_treatment_date"] = new_treatment_date;
trial[trial_treatment]["new_treatment_year"] = new_treatment_year;
trial[trial_treatment]["new_treatment_planting_date"] = new_treatment_planting_date;
trial[trial_treatment]["new_treatment_description"] = new_treatment_description;

trial_treatments[trial_index] = trial;
Expand Down
Loading

0 comments on commit 738ec13

Please sign in to comment.