Source code: org/biomage/DesignElement/DesignElement_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.DesignElement
49 *
50 */
51 package org.biomage.DesignElement;
52
53 /**
54 * Import list for DesignElement_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 * The classes of this package are the contained classes of the
65 * ArrayDesign and describe through the DesignElements what is intended to
66 * be at each location of the Array. The Feature describes an intended
67 * location on the Array, the Reporter the Oligo, Clone, PCR Product that
68 * is on a Feature and the CompositeSequence which combines Reporters or
69 * CompositeSequences into what the child DesignElements are meant to
70 * represent biologically, e.g. a Gene, Exon, SpliceVariant, etc.
71 *
72 */
73 public
74 class DesignElement_package
75 implements Serializable
76 {
77 /**
78 * Inner list class for holding multiple entries for attribute
79 * designElement_list. Simply creates a named vector.
80 *
81 */
82 public
83 class
84 DesignElement_list extends Vector
85 {
86 }
87
88 /**
89 * An element of an array. This is generally of type feature but
90 * can be specified as reporters or compositeSequence for arrays that
91 * are abstracted from a physical array.
92 *
93 */
94 public DesignElement_list designElement_list = new DesignElement_list();
95
96 /**
97 * Inner list class for holding multiple entries for attribute
98 * reporter_list. Simply creates a named vector.
99 *
100 */
101 public
102 class
103 Reporter_list extends Vector
104 {
105 }
106
107 /**
108 * A Design Element that represents some biological material (clone,
109 * oligo, etc.) on an array which will report on some biosequence or
110 * biosequences. The derived data from the measured data of its
111 * Features represents the presence or absence of the biosequence or
112 * biosequences it is reporting on in the BioAssay.
113 *
114 * Reporters are Identifiable and several Features on the same array
115 * can be mapped to the same reporter as can Features from a different
116 * ArrayDesign. The granularity of the Reporters independence is
117 * dependent on the technology and the intent of the ArrayDesign.
118 * Oligos using mature technologies can in general be assumed to be
119 * safely replicated on many features where as with PCR Products there
120 * might be the desire for quality assurence to make reporters one to
121 * one with features and use the mappings to CompositeSequences for
122 * replication purposes.
123 *
124 */
125 public Reporter_list reporter_list = new Reporter_list();
126
127 /**
128 * Inner list class for holding multiple entries for attribute
129 * compositeSequence_list. Simply creates a named vector.
130 *
131 */
132 public
133 class
134 CompositeSequence_list extends Vector
135 {
136 }
137
138 /**
139 * A collection of Reporter or CompositeSequence Design Elements,
140 * annotated through the association to BioSequence.
141 *
142 */
143 public CompositeSequence_list compositeSequence_list = new CompositeSequence_list();
144
145 /**
146 * Inner list class for holding multiple entries for attribute
147 * compositeCompositeMap_list. Simply creates a named vector.
148 *
149 */
150 public
151 class
152 CompositeCompositeMap_list extends Vector
153 {
154 }
155
156 /**
157 * A CompositeCompositeMap is the description of how source
158 * CompositeSequences are transformed into a target CompositeSequence.
159 * For instance, several CompositeSequences could represent different
160 * sequence regions for a Gene and could be mapped to different
161 * CompositeSequences, each representing a different splice variant for
162 * that Gene.
163 *
164 */
165 public CompositeCompositeMap_list compositeCompositeMap_list = new CompositeCompositeMap_list();
166
167 /**
168 * Inner list class for holding multiple entries for attribute
169 * featureReporterMap_list. Simply creates a named vector.
170 *
171 */
172 public
173 class
174 FeatureReporterMap_list extends Vector
175 {
176 }
177
178 /**
179 * A FeatureReporterMap is the description of how source features
180 * are transformed into a target reporter. These would map replicate
181 * features for a reporter to the reporter.
182 *
183 */
184 public FeatureReporterMap_list featureReporterMap_list = new FeatureReporterMap_list();
185
186 /**
187 * Inner list class for holding multiple entries for attribute
188 * reporterCompositeMap_list. Simply creates a named vector.
189 *
190 */
191 public
192 class
193 ReporterCompositeMap_list extends Vector
194 {
195 }
196
197 /**
198 * A ReporterCompositeMap is the description of how source Reporters
199 * are transformed into a target CompositeSequences. For instance,
200 * several reporters that tile across a section of a chromosome could
201 * be mapped to a CompositeSequence.
202 *
203 */
204 public ReporterCompositeMap_list reporterCompositeMap_list = new ReporterCompositeMap_list();
205
206 /**
207 * Default constructor.
208 *
209 */
210 public
211 DesignElement_package()
212 {
213 }
214
215 /**
216 * Attribute constructor.
217 *
218 * Looks up the attributes in the parameter and casts them from strings
219 * appropriately
220 * @param atts: the attribute list.
221 *
222 */
223 // TODO Work in progress (attribute constructor).
224 public
225 DesignElement_package(Attributes atts)
226 {
227 }
228
229 /**
230 * writeMAGEML
231 * <p>
232 * This method is responsible for assembling the attribute and
233 * association data into XML. It creates the object tag and then calls
234 * the writeAttributes and writeAssociation methods.
235 * <p>
236 *
237 */
238 public
239 void
240 writeMAGEML(Writer out)
241 throws IOException
242 {
243 out.write("<DesignElement_package");
244 writeAttributes(out);
245 out.write(">");
246 writeAssociations(out);
247 out.write("</DesignElement_package>");
248 }
249
250 /**
251 * writeAttributes
252 * <p>
253 * This method is responsible for assembling the attribute data into
254 * XML. It calls the super method to write out all attributes of this
255 * class and it's ancestors.
256 * <p>
257 *
258 */
259 public
260 void
261 writeAttributes(Writer out)
262 throws IOException
263 {
264 }
265
266 /**
267 * writeAssociations
268 * <p>
269 * This method is responsible for assembling the association data
270 * into XML. It calls the super method to write out all associations of
271 * this class's ancestors.
272 * <p>
273 *
274 */
275 public
276 void
277 writeAssociations(Writer out)
278 throws IOException
279 {
280 if ( reporterCompositeMap_list.size() > 0 ){
281 out.write("<ReporterCompositeMap_assnlist>");
282 for ( int i = 0; i < reporterCompositeMap_list.size(); i++) {
283 ((ReporterCompositeMap)reporterCompositeMap_list.elementAt(i)).writeMAGEML(out);
284 }
285 out.write("</ReporterCompositeMap_assnlist>");
286 }
287 if ( featureReporterMap_list.size() > 0 ){
288 out.write("<FeatureReporterMap_assnlist>");
289 for ( int i = 0; i < featureReporterMap_list.size(); i++) {
290 ((FeatureReporterMap)featureReporterMap_list.elementAt(i)).writeMAGEML(out);
291 }
292 out.write("</FeatureReporterMap_assnlist>");
293 }
294 if ( compositeCompositeMap_list.size() > 0 ){
295 out.write("<CompositeCompositeMap_assnlist>");
296 for ( int i = 0; i < compositeCompositeMap_list.size(); i++) {
297 ((CompositeCompositeMap)compositeCompositeMap_list.elementAt(i)).writeMAGEML(out);
298 }
299 out.write("</CompositeCompositeMap_assnlist>");
300 }
301 if ( compositeSequence_list.size() > 0 ){
302 out.write("<CompositeSequence_assnlist>");
303 for ( int i = 0; i < compositeSequence_list.size(); i++) {
304 ((CompositeSequence)compositeSequence_list.elementAt(i)).writeMAGEML(out);
305 }
306 out.write("</CompositeSequence_assnlist>");
307 }
308 if ( reporter_list.size() > 0 ){
309 out.write("<Reporter_assnlist>");
310 for ( int i = 0; i < reporter_list.size(); i++) {
311 ((Reporter)reporter_list.elementAt(i)).writeMAGEML(out);
312 }
313 out.write("</Reporter_assnlist>");
314 }
315 if ( designElement_list.size() > 0 ){
316 out.write("<DesignElement_assnlist>");
317 for ( int i = 0; i < designElement_list.size(); i++) {
318 ((DesignElement)designElement_list.elementAt(i)).writeMAGEML(out);
319 }
320 out.write("</DesignElement_assnlist>");
321 }
322 }
323
324 /**
325 * Set method for designElement_list
326 * <p>
327 * @param value to set
328 * <p>
329 *
330 */
331 public
332 void
333 setDesignElement_list(
334 DesignElement_list designElement_list
335 )
336 {
337 ((List)this.designElement_list).addAll((List)designElement_list);
338 }
339
340 /**
341 * Get method for designElement_list
342 * <p>
343 * @return value of the attribute
344 * <p>
345 *
346 */
347 public
348 DesignElement_list
349 getDesignElement_list()
350 {
351 return designElement_list;
352 }
353
354 /**
355 * Method to add DesignElement to DesignElement_list
356 *
357 */
358 public
359 void
360 addToDesignElement_list(
361 DesignElement designElement
362 )
363 {
364 this.designElement_list.add(designElement);
365 }
366
367 /**
368 * Method to add DesignElement at position to DesignElement_list
369 *
370 */
371 public
372 void
373 addToDesignElement_list(
374 int position,
375 DesignElement designElement
376 )
377 {
378 this.designElement_list.add(position, designElement);
379 }
380
381 /**
382 * Method to get DesignElement from DesignElement_list
383 *
384 */
385 public
386 DesignElement
387 getFromDesignElement_list(
388 int position
389 )
390 {
391 return (DesignElement) this.designElement_list.get(position);
392 }
393
394 /**
395 * Method to remove by position from DesignElement_list
396 *
397 */
398 public
399 void
400 removeElementAtFromDesignElement_list(
401 int position
402 )
403 {
404 this.designElement_list.removeElementAt(position);
405 }
406
407 /**
408 * Method to remove first DesignElement from DesignElement_list
409 *
410 */
411 public
412 void
413 removeFromDesignElement_list(
414 DesignElement designElement
415 )
416 {
417 this.designElement_list.remove(designElement);
418 }
419
420 /**
421 * Set method for reporter_list
422 * <p>
423 * @param value to set
424 * <p>
425 *
426 */
427 public
428 void
429 setReporter_list(
430 Reporter_list reporter_list
431 )
432 {
433 ((List)this.reporter_list).addAll((List)reporter_list);
434 }
435
436 /**
437 * Get method for reporter_list
438 * <p>
439 * @return value of the attribute
440 * <p>
441 *
442 */
443 public
444 Reporter_list
445 getReporter_list()
446 {
447 return reporter_list;
448 }
449
450 /**
451 * Method to add Reporter to Reporter_list
452 *
453 */
454 public
455 void
456 addToReporter_list(
457 Reporter reporter
458 )
459 {
460 this.reporter_list.add(reporter);
461 }
462
463 /**
464 * Method to add Reporter at position to Reporter_list
465 *
466 */
467 public
468 void
469 addToReporter_list(
470 int position,
471 Reporter reporter
472 )
473 {
474 this.reporter_list.add(position, reporter);
475 }
476
477 /**
478 * Method to get Reporter from Reporter_list
479 *
480 */
481 public
482 Reporter
483 getFromReporter_list(
484 int position
485 )
486 {
487 return (Reporter) this.reporter_list.get(position);
488 }
489
490 /**
491 * Method to remove by position from Reporter_list
492 *
493 */
494 public
495 void
496 removeElementAtFromReporter_list(
497 int position
498 )
499 {
500 this.reporter_list.removeElementAt(position);
501 }
502
503 /**
504 * Method to remove first Reporter from Reporter_list
505 *
506 */
507 public
508 void
509 removeFromReporter_list(
510 Reporter reporter
511 )
512 {
513 this.reporter_list.remove(reporter);
514 }
515
516 /**
517 * Set method for compositeSequence_list
518 * <p>
519 * @param value to set
520 * <p>
521 *
522 */
523 public
524 void
525 setCompositeSequence_list(
526 CompositeSequence_list compositeSequence_list
527 )
528 {
529 ((List)this.compositeSequence_list).addAll((List)compositeSequence_list);
530 }
531
532 /**
533 * Get method for compositeSequence_list
534 * <p>
535 * @return value of the attribute
536 * <p>
537 *
538 */
539 public
540 CompositeSequence_list
541 getCompositeSequence_list()
542 {
543 return compositeSequence_list;
544 }
545
546 /**
547 * Method to add CompositeSequence to CompositeSequence_list
548 *
549 */
550 public
551 void
552 addToCompositeSequence_list(
553 CompositeSequence compositeSequence
554 )
555 {
556 this.compositeSequence_list.add(compositeSequence);
557 }
558
559 /**
560 * Method to add CompositeSequence at position to
561 * CompositeSequence_list
562 *
563 */
564 public
565 void
566 addToCompositeSequence_list(
567 int position,
568 CompositeSequence compositeSequence
569 )
570 {
571 this.compositeSequence_list.add(position, compositeSequence);
572 }
573
574 /**
575 * Method to get CompositeSequence from CompositeSequence_list
576 *
577 */
578 public
579 CompositeSequence
580 getFromCompositeSequence_list(
581 int position
582 )
583 {
584 return (CompositeSequence) this.compositeSequence_list.get(position);
585 }
586
587 /**
588 * Method to remove by position from CompositeSequence_list
589 *
590 */
591 public
592 void
593 removeElementAtFromCompositeSequence_list(
594 int position
595 )
596 {
597 this.compositeSequence_list.removeElementAt(position);
598 }
599
600 /**
601 * Method to remove first CompositeSequence from
602 * CompositeSequence_list
603 *
604 */
605 public
606 void
607 removeFromCompositeSequence_list(
608 CompositeSequence compositeSequence
609 )
610 {
611 this.compositeSequence_list.remove(compositeSequence);
612 }
613
614 /**
615 * Set method for compositeCompositeMap_list
616 * <p>
617 * @param value to set
618 * <p>
619 *
620 */
621 public
622 void
623 setCompositeCompositeMap_list(
624 CompositeCompositeMap_list compositeCompositeMap_list
625 )
626 {
627 ((List)this.compositeCompositeMap_list).addAll((List)compositeCompositeMap_list);
628 }
629
630 /**
631 * Get method for compositeCompositeMap_list
632 * <p>
633 * @return value of the attribute
634 * <p>
635 *
636 */
637 public
638 CompositeCompositeMap_list
639 getCompositeCompositeMap_list()
640 {
641 return compositeCompositeMap_list;
642 }
643
644 /**
645 * Method to add CompositeCompositeMap to CompositeCompositeMap_list
646 *
647 */
648 public
649 void
650 addToCompositeCompositeMap_list(
651 CompositeCompositeMap compositeCompositeMap
652 )
653 {
654 this.compositeCompositeMap_list.add(compositeCompositeMap);
655 }
656
657 /**
658 * Method to add CompositeCompositeMap at position to
659 * CompositeCompositeMap_list
660 *
661 */
662 public
663 void
664 addToCompositeCompositeMap_list(
665 int position,
666 CompositeCompositeMap compositeCompositeMap
667 )
668 {
669 this.compositeCompositeMap_list.add(position, compositeCompositeMap);
670 }
671
672 /**
673 * Method to get CompositeCompositeMap from
674 * CompositeCompositeMap_list
675 *
676 */
677 public
678 CompositeCompositeMap
679 getFromCompositeCompositeMap_list(
680 int position
681 )
682 {
683 return (CompositeCompositeMap) this.compositeCompositeMap_list.get(position);
684 }
685
686 /**
687 * Method to remove by position from CompositeCompositeMap_list
688 *
689 */
690 public
691 void
692 removeElementAtFromCompositeCompositeMap_list(
693 int position
694 )
695 {
696 this.compositeCompositeMap_list.removeElementAt(position);
697 }
698
699 /**
700 * Method to remove first CompositeCompositeMap from
701 * CompositeCompositeMap_list
702 *
703 */
704 public
705 void
706 removeFromCompositeCompositeMap_list(
707 CompositeCompositeMap compositeCompositeMap
708 )
709 {
710 this.compositeCompositeMap_list.remove(compositeCompositeMap);
711 }
712
713 /**
714 * Set method for featureReporterMap_list
715 * <p>
716 * @param value to set
717 * <p>
718 *
719 */
720 public
721 void
722 setFeatureReporterMap_list(
723 FeatureReporterMap_list featureReporterMap_list
724 )
725 {
726 ((List)this.featureReporterMap_list).addAll((List)featureReporterMap_list);
727 }
728
729 /**
730 * Get method for featureReporterMap_list
731 * <p>
732 * @return value of the attribute
733 * <p>
734 *
735 */
736 public
737 FeatureReporterMap_list
738 getFeatureReporterMap_list()
739 {
740 return featureReporterMap_list;
741 }
742
743 /**
744 * Method to add FeatureReporterMap to FeatureReporterMap_list
745 *
746 */
747 public
748 void
749 addToFeatureReporterMap_list(
750 FeatureReporterMap featureReporterMap
751 )
752 {
753 this.featureReporterMap_list.add(featureReporterMap);
754 }
755
756 /**
757 * Method to add FeatureReporterMap at position to
758 * FeatureReporterMap_list
759 *
760 */
761 public
762 void
763 addToFeatureReporterMap_list(
764 int position,
765 FeatureReporterMap featureReporterMap
766 )
767 {
768 this.featureReporterMap_list.add(position, featureReporterMap);
769 }
770
771 /**
772 * Method to get FeatureReporterMap from FeatureReporterMap_list
773 *
774 */
775 public
776 FeatureReporterMap
777 getFromFeatureReporterMap_list(
778 int position
779 )
780 {
781 return (FeatureReporterMap) this.featureReporterMap_list.get(position);
782 }
783
784 /**
785 * Method to remove by position from FeatureReporterMap_list
786 *
787 */
788 public
789 void
790 removeElementAtFromFeatureReporterMap_list(
791 int position
792 )
793 {
794 this.featureReporterMap_list.removeElementAt(position);
795 }
796
797 /**
798 * Method to remove first FeatureReporterMap from
799 * FeatureReporterMap_list
800 *
801 */
802 public
803 void
804 removeFromFeatureReporterMap_list(
805 FeatureReporterMap featureReporterMap
806 )
807 {
808 this.featureReporterMap_list.remove(featureReporterMap);
809 }
810
811 /**
812 * Set method for reporterCompositeMap_list
813 * <p>
814 * @param value to set
815 * <p>
816 *
817 */
818 public
819 void
820 setReporterCompositeMap_list(
821 ReporterCompositeMap_list reporterCompositeMap_list
822 )
823 {
824 ((List)this.reporterCompositeMap_list).addAll((List)reporterCompositeMap_list);
825 }
826
827 /**
828 * Get method for reporterCompositeMap_list
829 * <p>
830 * @return value of the attribute
831 * <p>
832 *
833 */
834 public
835 ReporterCompositeMap_list
836 getReporterCompositeMap_list()
837 {
838 return reporterCompositeMap_list;
839 }
840
841 /**
842 * Method to add ReporterCompositeMap to ReporterCompositeMap_list
843 *
844 */
845 public
846 void
847 addToReporterCompositeMap_list(
848 ReporterCompositeMap reporterCompositeMap
849 )
850 {
851 this.reporterCompositeMap_list.add(reporterCompositeMap);
852 }
853
854 /**
855 * Method to add ReporterCompositeMap at position to
856 * ReporterCompositeMap_list
857 *
858 */
859 public
860 void
861 addToReporterCompositeMap_list(
862 int position,
863 ReporterCompositeMap reporterCompositeMap
864 )
865 {
866 this.reporterCompositeMap_list.add(position, reporterCompositeMap);
867 }
868
869 /**
870 * Method to get ReporterCompositeMap from ReporterCompositeMap_list
871 *
872 */
873 public
874 ReporterCompositeMap
875 getFromReporterCompositeMap_list(
876 int position
877 )
878 {
879 return (ReporterCompositeMap) this.reporterCompositeMap_list.get(position);
880 }
881
882 /**
883 * Method to remove by position from ReporterCompositeMap_list
884 *
885 */
886 public
887 void
888 removeElementAtFromReporterCompositeMap_list(
889 int position
890 )
891 {
892 this.reporterCompositeMap_list.removeElementAt(position);
893 }
894
895 /**
896 * Method to remove first ReporterCompositeMap from
897 * ReporterCompositeMap_list
898 *
899 */
900 public
901 void
902 removeFromReporterCompositeMap_list(
903 ReporterCompositeMap reporterCompositeMap
904 )
905 {
906 this.reporterCompositeMap_list.remove(reporterCompositeMap);
907 }
908
909 }