Source code: org/biomage/ArrayDesign/ArrayDesign_package.java
1 /***************************************************************************
2 * *
3 * C O P Y R I G H T N O T I C E *
4 * Copyright (c) 2001 by: *
5 * * The MicroArray Gene Expression Database group (MGED) *
6 * * Rosetta Inpharmatics *
7 * *
8 * All Rights Reserved. *
9 * *
10 * Permission is hereby granted, free of charge, to any person *
11 * obtaining a copy of this software and associated documentation files *
12 * (the "Software"), to deal in the Software without restriction, *
13 * including without limitation the rights to use, copy, modify, merge, *
14 * publish, distribute, sublicense, and/or sell copies of the Software, *
15 * and to permit persons to whom the Software is furnished to do so, *
16 * subject to the following conditions: *
17 * *
18 * The above copyright notice and this permission notice shall be *
19 * included in all copies or substantial portions of the Software. *
20 * *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
24 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS *
25 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN *
26 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN *
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *
28 * SOFTWARE. *
29 ***************************************************************************
30 * *
31 * Created by the create_mage_java_classes java program based on the *
32 * information in the xmi file created from the MAGE-OM UML model, *
33 * copyright European Bioinformatics Institute (EBI) for MGED and Rosetta *
34 * Informatics. *
35 * *
36 * The ideas and work are built on the previous work in perl of Jason *
37 * Stewart, Open Informatics, and Robert M. Hubley, Institute for Systems *
38 * Biology *
39 * *
40 * @author Michael Miller, Rosetta Inpharmatics *
41 * @version Revision: 1.0 *
42 * @date Thu, Feb 21, 2002 10:46:57 AM *
43 * *
44 ***************************************************************************
45 */
46
47 /**
48 * org.biomage.ArrayDesign
49 *
50 */
51 package org.biomage.ArrayDesign;
52
53 /**
54 * Import list for ArrayDesign_package
55 *
56 */
57 import java.io.Serializable;
58 import java.util.*;
59 import org.xml.sax.Attributes;
60 import java.io.Writer;
61 import java.io.IOException;
62
63 /**
64 * Describes a microarray design that can be printed and then, in the
65 * case of gene expression, hybridized. An array design consists of
66 * several features (also called spots) in which reporter sequences are
67 * placed. Many features may have the same reporter replicated and a
68 * reporter may be specified in one or more array designs.
69 *
70 * The nature of the reporter's biosequence placed on a spot will depend on
71 * the technology. Two well-known technologies differ
72 * significantly-spotter arrays draw material from a well and place a spot
73 * on the array whereas in situ oligo arrays are created through the
74 * synthesis of many, short (~20-100mer) nucleotide sequences onto the
75 * features.
76 *
77 * Reporters can be grouped together into CompositeSequences, typically
78 * representing a gene or one or more splice variants in gene expression
79 * experiments.
80 *
81 * There are then two distinct ways that DesignElements are grouped. The
82 * one described in the ArrayDesign package by FeatureGroup, ReporterGroup
83 * and CompositeGroup is by technology type, that is, one might want to
84 * segregate the controls to a Group and all the non-controls to another.
85 * Or if PCR Product and Oligos are both used on an array they would likely
86 * be in different groups. The grouping described in the DesignElement
87 * package by the mappings relates the Features to the Reporter, the
88 * Reporters to CompositeSequence, and at higher levels, CompositeSequences
89 * to CompositeSequence.
90 *
91 */
92 public
93 class ArrayDesign_package
94 implements Serializable
95 {
96 /**
97 * Inner list class for holding multiple entries for attribute
98 * arrayDesign_list. Simply creates a named vector.
99 *
100 */
101 public
102 class
103 ArrayDesign_list extends Vector
104 {
105 }
106
107 /**
108 * Describes the design of an gene expression layout. In some cases
109 * this might be virtual and, for instance, represent the output from
110 * analysis software at the composite level without reporters or
111 * features.
112 *
113 */
114 public ArrayDesign_list arrayDesign_list = new ArrayDesign_list();
115
116 /**
117 * Inner list class for holding multiple entries for attribute
118 * physicalArrayDesign_list. Simply creates a named vector.
119 *
120 */
121 public
122 class
123 PhysicalArrayDesign_list extends Vector
124 {
125 }
126
127 /**
128 * A design that is expected to be used to manufacture physical
129 * arrays.
130 *
131 */
132 public PhysicalArrayDesign_list physicalArrayDesign_list = new PhysicalArrayDesign_list();
133
134 /**
135 * Inner list class for holding multiple entries for attribute
136 * reporterGroup_list. Simply creates a named vector.
137 *
138 */
139 public
140 class
141 ReporterGroup_list extends Vector
142 {
143 }
144
145 /**
146 * Allows specification of the type of Reporter Design Element.
147 *
148 */
149 public ReporterGroup_list reporterGroup_list = new ReporterGroup_list();
150
151 /**
152 * Inner list class for holding multiple entries for attribute
153 * designElementGroup_list. Simply creates a named vector.
154 *
155 */
156 public
157 class
158 DesignElementGroup_list extends Vector
159 {
160 }
161
162 /**
163 * The DesignElementGroup holds information on either features,
164 * reporters, or compositeSequences, particularly that information that
165 * is common between all of the DesignElements contained.
166 *
167 */
168 public DesignElementGroup_list designElementGroup_list = new DesignElementGroup_list();
169
170 /**
171 * Inner list class for holding multiple entries for attribute
172 * compositeGroup_list. Simply creates a named vector.
173 *
174 */
175 public
176 class
177 CompositeGroup_list extends Vector
178 {
179 }
180
181 /**
182 * Allows specification of the type of Composite Design Element.
183 *
184 */
185 public CompositeGroup_list compositeGroup_list = new CompositeGroup_list();
186
187 /**
188 * Default constructor.
189 *
190 */
191 public
192 ArrayDesign_package()
193 {
194 }
195
196 /**
197 * Attribute constructor.
198 *
199 * Looks up the attributes in the parameter and casts them from strings
200 * appropriately
201 * @param atts: the attribute list.
202 *
203 */
204 // TODO Work in progress (attribute constructor).
205 public
206 ArrayDesign_package(Attributes atts)
207 {
208 }
209
210 /**
211 * writeMAGEML
212 * <p>
213 * This method is responsible for assembling the attribute and
214 * association data into XML. It creates the object tag and then calls
215 * the writeAttributes and writeAssociation methods.
216 * <p>
217 *
218 */
219 public
220 void
221 writeMAGEML(Writer out)
222 throws IOException
223 {
224 out.write("<ArrayDesign_package");
225 writeAttributes(out);
226 out.write(">");
227 writeAssociations(out);
228 out.write("</ArrayDesign_package>");
229 }
230
231 /**
232 * writeAttributes
233 * <p>
234 * This method is responsible for assembling the attribute data into
235 * XML. It calls the super method to write out all attributes of this
236 * class and it's ancestors.
237 * <p>
238 *
239 */
240 public
241 void
242 writeAttributes(Writer out)
243 throws IOException
244 {
245 }
246
247 /**
248 * writeAssociations
249 * <p>
250 * This method is responsible for assembling the association data
251 * into XML. It calls the super method to write out all associations of
252 * this class's ancestors.
253 * <p>
254 *
255 */
256 public
257 void
258 writeAssociations(Writer out)
259 throws IOException
260 {
261 if ( compositeGroup_list.size() > 0 ){
262 out.write("<CompositeGroup_assnlist>");
263 for ( int i = 0; i < compositeGroup_list.size(); i++) {
264 ((CompositeGroup)compositeGroup_list.elementAt(i)).writeMAGEML(out);
265 }
266 out.write("</CompositeGroup_assnlist>");
267 }
268 if ( designElementGroup_list.size() > 0 ){
269 out.write("<DesignElementGroup_assnlist>");
270 for ( int i = 0; i < designElementGroup_list.size(); i++) {
271 ((DesignElementGroup)designElementGroup_list.elementAt(i)).writeMAGEML(out);
272 }
273 out.write("</DesignElementGroup_assnlist>");
274 }
275 if ( reporterGroup_list.size() > 0 ){
276 out.write("<ReporterGroup_assnlist>");
277 for ( int i = 0; i < reporterGroup_list.size(); i++) {
278 ((ReporterGroup)reporterGroup_list.elementAt(i)).writeMAGEML(out);
279 }
280 out.write("</ReporterGroup_assnlist>");
281 }
282 if ( physicalArrayDesign_list.size() > 0 ){
283 out.write("<PhysicalArrayDesign_assnlist>");
284 for ( int i = 0; i < physicalArrayDesign_list.size(); i++) {
285 ((PhysicalArrayDesign)physicalArrayDesign_list.elementAt(i)).writeMAGEML(out);
286 }
287 out.write("</PhysicalArrayDesign_assnlist>");
288 }
289 if ( arrayDesign_list.size() > 0 ){
290 out.write("<ArrayDesign_assnlist>");
291 for ( int i = 0; i < arrayDesign_list.size(); i++) {
292 ((ArrayDesign)arrayDesign_list.elementAt(i)).writeMAGEML(out);
293 }
294 out.write("</ArrayDesign_assnlist>");
295 }
296 }
297
298 /**
299 * Set method for arrayDesign_list
300 * <p>
301 * @param value to set
302 * <p>
303 *
304 */
305 public
306 void
307 setArrayDesign_list(
308 ArrayDesign_list arrayDesign_list
309 )
310 {
311 ((List)this.arrayDesign_list).addAll((List)arrayDesign_list);
312 }
313
314 /**
315 * Get method for arrayDesign_list
316 * <p>
317 * @return value of the attribute
318 * <p>
319 *
320 */
321 public
322 ArrayDesign_list
323 getArrayDesign_list()
324 {
325 return arrayDesign_list;
326 }
327
328 /**
329 * Method to add ArrayDesign to ArrayDesign_list
330 *
331 */
332 public
333 void
334 addToArrayDesign_list(
335 ArrayDesign arrayDesign
336 )
337 {
338 this.arrayDesign_list.add(arrayDesign);
339 }
340
341 /**
342 * Method to add ArrayDesign at position to ArrayDesign_list
343 *
344 */
345 public
346 void
347 addToArrayDesign_list(
348 int position,
349 ArrayDesign arrayDesign
350 )
351 {
352 this.arrayDesign_list.add(position, arrayDesign);
353 }
354
355 /**
356 * Method to get ArrayDesign from ArrayDesign_list
357 *
358 */
359 public
360 ArrayDesign
361 getFromArrayDesign_list(
362 int position
363 )
364 {
365 return (ArrayDesign) this.arrayDesign_list.get(position);
366 }
367
368 /**
369 * Method to remove by position from ArrayDesign_list
370 *
371 */
372 public
373 void
374 removeElementAtFromArrayDesign_list(
375 int position
376 )
377 {
378 this.arrayDesign_list.removeElementAt(position);
379 }
380
381 /**
382 * Method to remove first ArrayDesign from ArrayDesign_list
383 *
384 */
385 public
386 void
387 removeFromArrayDesign_list(
388 ArrayDesign arrayDesign
389 )
390 {
391 this.arrayDesign_list.remove(arrayDesign);
392 }
393
394 /**
395 * Set method for physicalArrayDesign_list
396 * <p>
397 * @param value to set
398 * <p>
399 *
400 */
401 public
402 void
403 setPhysicalArrayDesign_list(
404 PhysicalArrayDesign_list physicalArrayDesign_list
405 )
406 {
407 ((List)this.physicalArrayDesign_list).addAll((List)physicalArrayDesign_list);
408 }
409
410 /**
411 * Get method for physicalArrayDesign_list
412 * <p>
413 * @return value of the attribute
414 * <p>
415 *
416 */
417 public
418 PhysicalArrayDesign_list
419 getPhysicalArrayDesign_list()
420 {
421 return physicalArrayDesign_list;
422 }
423
424 /**
425 * Method to add PhysicalArrayDesign to PhysicalArrayDesign_list
426 *
427 */
428 public
429 void
430 addToPhysicalArrayDesign_list(
431 PhysicalArrayDesign physicalArrayDesign
432 )
433 {
434 this.physicalArrayDesign_list.add(physicalArrayDesign);
435 }
436
437 /**
438 * Method to add PhysicalArrayDesign at position to
439 * PhysicalArrayDesign_list
440 *
441 */
442 public
443 void
444 addToPhysicalArrayDesign_list(
445 int position,
446 PhysicalArrayDesign physicalArrayDesign
447 )
448 {
449 this.physicalArrayDesign_list.add(position, physicalArrayDesign);
450 }
451
452 /**
453 * Method to get PhysicalArrayDesign from PhysicalArrayDesign_list
454 *
455 */
456 public
457 PhysicalArrayDesign
458 getFromPhysicalArrayDesign_list(
459 int position
460 )
461 {
462 return (PhysicalArrayDesign) this.physicalArrayDesign_list.get(position);
463 }
464
465 /**
466 * Method to remove by position from PhysicalArrayDesign_list
467 *
468 */
469 public
470 void
471 removeElementAtFromPhysicalArrayDesign_list(
472 int position
473 )
474 {
475 this.physicalArrayDesign_list.removeElementAt(position);
476 }
477
478 /**
479 * Method to remove first PhysicalArrayDesign from
480 * PhysicalArrayDesign_list
481 *
482 */
483 public
484 void
485 removeFromPhysicalArrayDesign_list(
486 PhysicalArrayDesign physicalArrayDesign
487 )
488 {
489 this.physicalArrayDesign_list.remove(physicalArrayDesign);
490 }
491
492 /**
493 * Set method for reporterGroup_list
494 * <p>
495 * @param value to set
496 * <p>
497 *
498 */
499 public
500 void
501 setReporterGroup_list(
502 ReporterGroup_list reporterGroup_list
503 )
504 {
505 ((List)this.reporterGroup_list).addAll((List)reporterGroup_list);
506 }
507
508 /**
509 * Get method for reporterGroup_list
510 * <p>
511 * @return value of the attribute
512 * <p>
513 *
514 */
515 public
516 ReporterGroup_list
517 getReporterGroup_list()
518 {
519 return reporterGroup_list;
520 }
521
522 /**
523 * Method to add ReporterGroup to ReporterGroup_list
524 *
525 */
526 public
527 void
528 addToReporterGroup_list(
529 ReporterGroup reporterGroup
530 )
531 {
532 this.reporterGroup_list.add(reporterGroup);
533 }
534
535 /**
536 * Method to add ReporterGroup at position to ReporterGroup_list
537 *
538 */
539 public
540 void
541 addToReporterGroup_list(
542 int position,
543 ReporterGroup reporterGroup
544 )
545 {
546 this.reporterGroup_list.add(position, reporterGroup);
547 }
548
549 /**
550 * Method to get ReporterGroup from ReporterGroup_list
551 *
552 */
553 public
554 ReporterGroup
555 getFromReporterGroup_list(
556 int position
557 )
558 {
559 return (ReporterGroup) this.reporterGroup_list.get(position);
560 }
561
562 /**
563 * Method to remove by position from ReporterGroup_list
564 *
565 */
566 public
567 void
568 removeElementAtFromReporterGroup_list(
569 int position
570 )
571 {
572 this.reporterGroup_list.removeElementAt(position);
573 }
574
575 /**
576 * Method to remove first ReporterGroup from ReporterGroup_list
577 *
578 */
579 public
580 void
581 removeFromReporterGroup_list(
582 ReporterGroup reporterGroup
583 )
584 {
585 this.reporterGroup_list.remove(reporterGroup);
586 }
587
588 /**
589 * Set method for designElementGroup_list
590 * <p>
591 * @param value to set
592 * <p>
593 *
594 */
595 public
596 void
597 setDesignElementGroup_list(
598 DesignElementGroup_list designElementGroup_list
599 )
600 {
601 ((List)this.designElementGroup_list).addAll((List)designElementGroup_list);
602 }
603
604 /**
605 * Get method for designElementGroup_list
606 * <p>
607 * @return value of the attribute
608 * <p>
609 *
610 */
611 public
612 DesignElementGroup_list
613 getDesignElementGroup_list()
614 {
615 return designElementGroup_list;
616 }
617
618 /**
619 * Method to add DesignElementGroup to DesignElementGroup_list
620 *
621 */
622 public
623 void
624 addToDesignElementGroup_list(
625 DesignElementGroup designElementGroup
626 )
627 {
628 this.designElementGroup_list.add(designElementGroup);
629 }
630
631 /**
632 * Method to add DesignElementGroup at position to
633 * DesignElementGroup_list
634 *
635 */
636 public
637 void
638 addToDesignElementGroup_list(
639 int position,
640 DesignElementGroup designElementGroup
641 )
642 {
643 this.designElementGroup_list.add(position, designElementGroup);
644 }
645
646 /**
647 * Method to get DesignElementGroup from DesignElementGroup_list
648 *
649 */
650 public
651 DesignElementGroup
652 getFromDesignElementGroup_list(
653 int position
654 )
655 {
656 return (DesignElementGroup) this.designElementGroup_list.get(position);
657 }
658
659 /**
660 * Method to remove by position from DesignElementGroup_list
661 *
662 */
663 public
664 void
665 removeElementAtFromDesignElementGroup_list(
666 int position
667 )
668 {
669 this.designElementGroup_list.removeElementAt(position);
670 }
671
672 /**
673 * Method to remove first DesignElementGroup from
674 * DesignElementGroup_list
675 *
676 */
677 public
678 void
679 removeFromDesignElementGroup_list(
680 DesignElementGroup designElementGroup
681 )
682 {
683 this.designElementGroup_list.remove(designElementGroup);
684 }
685
686 /**
687 * Set method for compositeGroup_list
688 * <p>
689 * @param value to set
690 * <p>
691 *
692 */
693 public
694 void
695 setCompositeGroup_list(
696 CompositeGroup_list compositeGroup_list
697 )
698 {
699 ((List)this.compositeGroup_list).addAll((List)compositeGroup_list);
700 }
701
702 /**
703 * Get method for compositeGroup_list
704 * <p>
705 * @return value of the attribute
706 * <p>
707 *
708 */
709 public
710 CompositeGroup_list
711 getCompositeGroup_list()
712 {
713 return compositeGroup_list;
714 }
715
716 /**
717 * Method to add CompositeGroup to CompositeGroup_list
718 *
719 */
720 public
721 void
722 addToCompositeGroup_list(
723 CompositeGroup compositeGroup
724 )
725 {
726 this.compositeGroup_list.add(compositeGroup);
727 }
728
729 /**
730 * Method to add CompositeGroup at position to CompositeGroup_list
731 *
732 */
733 public
734 void
735 addToCompositeGroup_list(
736 int position,
737 CompositeGroup compositeGroup
738 )
739 {
740 this.compositeGroup_list.add(position, compositeGroup);
741 }
742
743 /**
744 * Method to get CompositeGroup from CompositeGroup_list
745 *
746 */
747 public
748 CompositeGroup
749 getFromCompositeGroup_list(
750 int position
751 )
752 {
753 return (CompositeGroup) this.compositeGroup_list.get(position);
754 }
755
756 /**
757 * Method to remove by position from CompositeGroup_list
758 *
759 */
760 public
761 void
762 removeElementAtFromCompositeGroup_list(
763 int position
764 )
765 {
766 this.compositeGroup_list.removeElementAt(position);
767 }
768
769 /**
770 * Method to remove first CompositeGroup from CompositeGroup_list
771 *
772 */
773 public
774 void
775 removeFromCompositeGroup_list(
776 CompositeGroup compositeGroup
777 )
778 {
779 this.compositeGroup_list.remove(compositeGroup);
780 }
781
782 }