783 |
18 Sep 08 |
jari |
1 |
/* |
783 |
18 Sep 08 |
jari |
$Id$ |
783 |
18 Sep 08 |
jari |
3 |
|
783 |
18 Sep 08 |
jari |
Copyright (C) 2006 Johan Enell |
783 |
18 Sep 08 |
jari |
5 |
|
783 |
18 Sep 08 |
jari |
This file is part of the se.lu.onk.MergeBioAssay plug-in for |
783 |
18 Sep 08 |
jari |
BASE. Available at http://baseplugins.thep.lu.se/ and BASE web |
783 |
18 Sep 08 |
jari |
site is http://base.thep.lu.se |
783 |
18 Sep 08 |
jari |
9 |
|
783 |
18 Sep 08 |
jari |
This is free software; you can redistribute it and/or modify it |
783 |
18 Sep 08 |
jari |
under the terms of the GNU General Public License as published by |
783 |
18 Sep 08 |
jari |
the Free Software Foundation; either version 3 of the License, or |
783 |
18 Sep 08 |
jari |
(at your option) any later version. |
783 |
18 Sep 08 |
jari |
14 |
|
783 |
18 Sep 08 |
jari |
The software is distributed in the hope that it will be useful, but |
783 |
18 Sep 08 |
jari |
WITHOUT ANY WARRANTY; without even the implied warranty of |
783 |
18 Sep 08 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
783 |
18 Sep 08 |
jari |
General Public License for more details. |
783 |
18 Sep 08 |
jari |
19 |
|
783 |
18 Sep 08 |
jari |
You should have received a copy of the GNU General Public License |
783 |
18 Sep 08 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
783 |
18 Sep 08 |
jari |
22 |
*/ |
96 |
06 Apr 06 |
enell |
23 |
package mergebioassay; |
6 |
10 Oct 05 |
enell |
24 |
|
6 |
10 Oct 05 |
enell |
25 |
/** |
6 |
10 Oct 05 |
enell |
* A simple class that wraps a BioAssay_point. It holds the basic values a BioAssay_point |
6 |
10 Oct 05 |
enell |
* has, which is reporter, position, intenisty1 and intensity2. |
6 |
10 Oct 05 |
enell |
28 |
* |
6 |
10 Oct 05 |
enell |
* @author Johan Enell |
6 |
10 Oct 05 |
enell |
30 |
*/ |
6 |
10 Oct 05 |
enell |
31 |
public class BioAssay_point { |
6 |
10 Oct 05 |
enell |
32 |
public int reporter, position; |
6 |
10 Oct 05 |
enell |
33 |
public float int1, int2; |
6 |
10 Oct 05 |
enell |
34 |
|
6 |
10 Oct 05 |
enell |
35 |
/** |
6 |
10 Oct 05 |
enell |
* Will constuct a new BioAssay_point. |
6 |
10 Oct 05 |
enell |
37 |
* |
6 |
10 Oct 05 |
enell |
* @param position the position of the point |
6 |
10 Oct 05 |
enell |
* @param reporter the reorter id of the point |
6 |
10 Oct 05 |
enell |
* @param int1 intensity 1 of the point |
6 |
10 Oct 05 |
enell |
* @param int2 intensity 2 of the point |
6 |
10 Oct 05 |
enell |
42 |
*/ |
6 |
10 Oct 05 |
enell |
43 |
public BioAssay_point(int position, int reporter, float int1, float int2) { |
6 |
10 Oct 05 |
enell |
44 |
this.position = position; |
6 |
10 Oct 05 |
enell |
45 |
this.reporter = reporter; |
6 |
10 Oct 05 |
enell |
46 |
this.int1 = int1; |
6 |
10 Oct 05 |
enell |
47 |
this.int2 = int2; |
6 |
10 Oct 05 |
enell |
48 |
} |
6 |
10 Oct 05 |
enell |
49 |
|
6 |
10 Oct 05 |
enell |
50 |
/** |
6 |
10 Oct 05 |
enell |
* Will calculate the ration of the point |
6 |
10 Oct 05 |
enell |
52 |
* |
6 |
10 Oct 05 |
enell |
* @return the ratio of the point, -1 if one of the intensities is 0 or less. |
6 |
10 Oct 05 |
enell |
54 |
*/ |
6 |
10 Oct 05 |
enell |
55 |
public float ratio() { |
6 |
10 Oct 05 |
enell |
56 |
return (int1 > 0 && int2 > 0) ? int1 / int2 : -1; |
6 |
10 Oct 05 |
enell |
57 |
} |
6 |
10 Oct 05 |
enell |
58 |
} |