1 package CXGN
::Genotype
::CreatePlateOrder
;
4 CXGN::Genotype::CreatePlateOrder - an object to submit genotyping plates to facilities
8 PLEASE BE AWARE THAT THE DEFAULT OPTIONS FOR genotypeprop_hash_select, protocolprop_top_key_select, protocolprop_marker_hash_select ARE PRONE TO EXCEEDING THE MEMORY LIMITS OF VM. CHECK THE MOOSE ATTRIBUTES BELOW TO SEE THE DEFAULTS, AND ADJUST YOUR MOOSE INSTANTIATION ACCORDINGLY
10 my $create_order = CXGN::Genotype::CreatePlateOrder->new({
12 people_schema=>$people_schema,
13 client_id=>$client_id,
15 extract_dna=>$extract_dna,
16 service_id_list=>$service_id_list,
17 plate_id => $plate_id,
19 my $errors = $submit_samples->validate();
20 $submit_samples->send();
24 If you just want to send genotyping plates with different volume per well
31 Mirella Flores <mrf252@cornell.edu>
32 Lukas Mueller <lam87@cornell.edu>
41 use SGN
::Model
::Cvterm
;
42 use CXGN
::Stock
::TissueSample
::Search
;
46 isa
=> 'Bio::Chado::Schema',
59 has
'requeriments' => (
60 isa
=> 'HashRef|Undef',
65 has
'service_id_list' => (
66 isa
=> 'ArrayRef[Str]|Undef',
77 has
'facility_id' => (
83 has
'organism_name' => (
95 Function for validating data before sending to facilities
97 my $submit_samples = CXGN::Genotype::CreatePlateOrder->new({
101 my $get_errors = $submit_samples->validate();
107 # my $schema = $self->bcs_schema;
108 # my $dbh = $schema->storage->dbh;
113 Function for submit genotyping plates to facilities
115 my $create_order = CXGN::Genotype::CreatePlateOrder->new({
119 my $errors = $submit_samples->submit();
127 my $schema= $self->bcs_schema;
129 my $plate_id = $self->plate_id;
130 my $facility_id = $self->facility_id;
131 my $client_id = $self->client_id;
132 my $get_requeriments = $self->requeriments;
133 my $service_id_list = $self->service_id_list;
134 my $requeriments = $get_requeriments ?
$get_requeriments : {};
135 my $organism_name = $self->organism_name;
137 my $genotyping_trial;
139 $genotyping_trial = CXGN
::Trial
->new( { bcs_schema
=> $schema, trial_id
=> $plate_id });
142 my $sample_type = $genotyping_trial->get_genotyping_plate_sample_type;
144 my $plate_format = 'PLATE_96' if ($genotyping_trial->get_genotyping_plate_format eq 96);
146 my $samples = _formated_samples
($schema,$plate_id,$organism_name);
150 clientPlateBarcode
=> $genotyping_trial->get_name(),
151 clientPlateId
=> $plate_id,
152 sampleSubmissionFormat
=> $plate_format,
157 clientId
=>qq|$client_id|,
158 numberOfSamples
=>scalar @
$samples,
160 requiredServiceInfo
=> $requeriments,
161 sampleType
=>$sample_type,
162 serviceIds
=>$service_id_list,
168 sub _formated_samples
{
170 my $plate_id = shift;
171 my $organism_name = shift;
173 if (!$plate_id || !$organism_name){
177 my $concent_unit = 'ng';
178 my $volume_unit = 'ul';
180 my $sample_search = CXGN
::Stock
::TissueSample
::Search
->new({
182 plate_db_id_list
=> [$plate_id],
186 my ($results, $total_count) = $sample_search->search();
189 foreach my $result (@
$results){
190 if ($result->{germplasmName
} ne 'BLANK'){
192 clientSampleBarCode
=> $result->{sampleName
},
193 clientSampleId
=> qq|$result->{sampleDbId
}|,
194 column
=> $result->{col_number
} + 0,
195 row
=> $result->{row_number
},
196 comments
=> $result->{notes
},
198 units
=> $concent_unit,
199 value
=> ($result->{concentration
} eq 'NA' || $result->{concentration
} eq '') ?
0 : $result->{concentration
} + 0,
201 tissueType
=> $result->{tissue_type
},
203 units
=> $volume_unit,
204 value
=> ($result->{volume
} eq 'NA' || $result->{volume
} eq '') ?
0 : $result->{volume
} + 0,
206 well
=> $result->{well
} ?
$result->{well
} : $result->{row_number
} . $result->{col_number
},
207 organismName
=> $organism_name,
208 speciesName
=> $result->{species
} ?
$result->{species
} : "",
209 taxonomyOntologyReference
=> {},
210 tissueTypeOntologyReference
=> {},