Sunteți pe pagina 1din 7

Pascal

Milesi, Nicolas Pocquet and Pierrick Labb November 2014

version 6.1

BioRssay

A R script for analysis of bioassays and probit graphs


Pascal Milesi, Nicolas Pocquet and Pierrick Labb 2013

Presentation of the script



The script is designed to analyze the mortality data from bioassays for one or several
strains/lines/pop.
It requires a text file with a classical R design (see below), with the strains analyzed and for each
dose (and each replicate) tested the number of dead individuals and the number of individuals
tested.
It allows taking the mortality in the controls into account, using the correction from the Abott's
formula (Abbott, 1925).
For each strain, it then calculates the mortality-dose regression using a generalized linear model
(takes over-dispersion into account and allows mortality of 0 or 1) and plots the regressions and
the data in a pdf graph.
It also provides a test to evaluate the quality of the regression using a chi-square test between
the observed dead numbers (data) and the dead numbers predicted by the regression. The test
is significant if the data are not linear (ex. mixed populations).
A new graph is built where the data or the regressions alone appear depending whether the test
is significant or not, resp. The graph is exported in a pdf and a jpg files.
The script also computes the lethal dose for 50% and 95% of the population (LD50 and LD95,
resp.), with their 95% confidence intervals (CI), using a script modified from Johnson et al
(2013), which allows taking into account the heterogeneity of the data (Finney, 1971) to
calculate the CI (i.e. a larger heterogeneity will increase the CI).
It also tests whether the mortality-dose regressions are similar for the different strains, using a
likelihood ratio test (LRT). If there are more than two strains test, it also computes the pairwise
test, and corrects it using sequential Bonferroni correction (Hommel, 1988).
Finally, it calculates the resistance ratios (RR) at LD50 and LD95, i.e. the ratios between a given
strain and the strain with the lower LD50 and LD95, respectively (usually it is the susceptible
reference).

Changes in version 6.1: New graphs are built with the regressions' confidence intervals at 95%.
Moreover, a bug is fixed in the chi-square goodness-of-fit test (the formula was wrong, leading to
unjustified significant p-values).

From version 5.1, the RR are now provided with their 95% confidence intervals, calculated
according to Robertson and Preisler (1992).

Note: if you find this script useful and worth of using to analyze your data and publish them,
please cite this work as:
Milesi P, Pocquet N and Labb P. 2013. BioRssay: a R script for bioassay analyses.
http://www.isem.univ-montp2.fr/recherche/equipes/genomique-de-
ladaptation/personnel/labbe-pierrick/
If you have ideas to improve the script or want it to do more things, do not hesitate to contact
me (email address on the above webpage).

Pascal Milesi, Nicolas Pocquet and Pierrick Labb November 2014

version 6.1

Using BioRssay

To use the script you must have the R software installed on your computer (http://cran.r-
project.org/).
Then you need to download the script and the examples files (zip file) from
http://www.isem.univ-montp2.fr/recherche/equipes/genomique-de-
ladaptation/personnel/labbe-pierrick/.
Open the script in a text editor.
Then open R and copy-paste the script. Open your data file.
When the script is finished running, the graphs and results files are in the same directory as your
data file.

Tip: clear the console between two runs of the script (control + l), it increases the speed

Data preparation

Prepare a text file (.txt) with at least 4 columns (see Example1.txt, Example2.txt and Example
3.txt):

- one column "souche" (= strain) for each strain tested,
- one column "dose" for each dose in each replicate. Note: if you have controls (i.e.
replicates without the active substance), enter them with a dose equal to 0. You must have
controls for each strains, even if you want to analyze them in one strain only.
- one column "tot" for the total number of larvae tested at each dose in each replicate,
- one column "morts" (= dead) for the number of dead larvae at each dose in each
replicate.

Additionally, you can add a "color" column if you wish to customize the graphs. In this column
just choose an integer for each strain tested, starting from 1 to the number of strains tested (n).
Note that the color are those of the palette rainbow in R (rainbow(10) if the n<10, rainbow(n) if
n>10).
Tip: use the following command in R to see the corresponding colors: plot(1:10,
col=rainbow(10))
Similarly, you can also add a "symbol" column if wish to customize the data point symbol. In this
column just choose an integer for each strain tested.

From version 5.1: you can now indicate whether you want to use one of the strains as the
reference to compute the resistance ratios. Just add "-ref" at the end of the strain name in you
file. If no strain presents the "-ref" extension, the strain with the minimum LD50 will be used as
reference.

You can have any other column you want: for example you can copy your data for a large
spreadsheet, as long as you don't use the previous labels.

Examples
Example 1
In this example there are 3 strains, for 7 doses and 2 replicates each. Note that a color column is
provided. All controls are below 5% mortality. KIS is used as the reference (indicated as KIS-ref
in the data file).

Pascal Milesi, Nicolas Pocquet and Pierrick Labb November 2014

version 6.1


After running the script, you would have the following report:



- For each strain you have first the LD50 and LD95 and their upper and lower limits (95% CI),
then the slope and intercept of the regression (with their standard error), the heterogeneity (h)
and the g factor ("With almost all good sets of data, g will be substantially smaller than 1.0 and
seldom greater than 0.4." Finney, 1971).
- The result of the chi test (Chi(p)) is then indicated to judge whether the data are well fitted to
the regression or not: here all the p-values are over 0.05 so the fits are acceptable). This is more
reliable in version 6.1.
- Finally the resistance ratios are indicated for LD50 and LD95 (RR50 and RR95).
- As there are 3 strains, the script first tests whether they are all similar (i.e. equivalent to 1
strain) or not (3 strains vs 1 strain). Here, the test is highly significant, some strains are thus
different in terms of resistance.
- To test which are different or not, pairwise tests are then performed and reported here in a
table. KIS strain is different from DZOU and from DZOU2 strains (p = 8.36E-61, and p=3.15E-48).
DZOU and DZOU2 are not different (p = 0.264).
- The significant values remain significant after Bonferroni correction (in the table below there is
a 1 in the bonferroni column).

The corresponding graphs are showed below, with the colors corresponding to those indicated
in the data file.
The first shows the regression with the data points; the second one shows only the regressions.
From version 6.1 you get two additional graphs with the 95% CI of the regression.

99
DZOU
99
DZOU
DZOU2
DZOU2
KISref
KISref

95
95

90
90
80
80

70
70
60
60
50
50
40
40
30
30
20
20
10
10
5
5

1
1


10
10
10
10
10
10

Dose(mg.L )
Dose(mg.L )

Mortality (%)

Mortality (%)

Pascal Milesi, Nicolas Pocquet and Pierrick Labb November 2014

version 6.1


99

99

DZOU
DZOU2
KISref

DZOU
DZOU2
KISref

95

95

90

90
80

80
70

Mortality (%)

Mortality (%)

60
50
40

30

20

70
60
50
40
30
20

10

10

103

102

101
1

Dose(mg.L

103

102

101

Dose(mg.L1)

Example 2
In this example there are 2 strains, for 7 doses and 2 replicates each. Note that no color column
is provided. Some controls present a mortality > 5%.

After running the script, you would have the following report:



- For each strain you have first the LD50 and LD95 and their upper and lower limits (95% CI),
then the slope and intercept of the regression (with their standard error), the heterogeneity (h)
and the g factor ("With almost all good sets of data, g will be substantially smaller than 1.0 and
seldom greater than 0.4." Finney, 1971).
- The result of the chi test (Chi(p)) is then indicated to judge whether the data are well fitted to
the regression or not: here all the p-values are over 0.05 so the fits are acceptable). This is more
reliable in version 6.1.
- Finally the resistance ratios are indicated for LD50 and LD95 (RR50 and RR95).
- As there are 2 strains, no pairwise test is required. Thus, the script only tests whether they are
all similar (i.e. equivalent to 1 strain) or different (2 strains vs 1 strain). Here, the test is highly
significant; the two strains are thus different in terms of resistance.
- In this dataset, the control showed a mortality > 0.05, so the data are corrected using Abbott's
formula. An estimation of the mortality in the controls is provided: about 2% in DZOU, and 9% in
KIS. Both estimations have converged (0 in convergence column). Note that if convergence is not
0, you should try to run the script again, usually is solves the problem.

The corresponding graphs are showed below, with the default colors.
The first shows the regression with the data points; the second one shows only the regressions.
From version 6.1 you get two additional graphs with the 95% CI of the regression.

Pascal Milesi, Nicolas Pocquet and Pierrick Labb November 2014

version 6.1


99

DZOU
KIS

99

95

90

80

Mortality (%)

80

70

60
50
40

30

20

70
60
50
40
30
20

10
5

DZOU
KIS

95

90

10

103

102

101
1

Dose(mg.L

99

103

101

Dose(mg.L

DZOU
KIS

99

95

DZOU
KIS

95

90

90

80

80

70

60
50
40

30

20

70
60
50
40
30

20

10
5

102
1

Mortality (%)

Mortality (%)

Mortality (%)

10

1
103

102
Dose(mg.L1)

101

103

102

101
1

Dose(mg.L

Example 3
In this example there are 2 strains, for 7 doses and 2 replicates each. Note that no color column
is provided. All controls are below 5% mortality. One strain does not fit a linear regression.

After running the script, you would have the following report:


- For each strain you have first the LD50 and LD95 and their upper and lower limits (95% CI),
then the slope and intercept of the regression (with their standard error), the heterogeneity (h)
and the g factor ("With almost all good sets of data, g will be substantially smaller than 1.0 and
seldom greater than 0.4." Finney, 1971).

Pascal Milesi, Nicolas Pocquet and Pierrick Labb November 2014

version 6.1


- The result of the chi test (Chi(p)) is then indicated to judge whether the data are well fitted to
the regression or not: here the p-value for KIS is over 0.05 so the fit is acceptable, but the p-value
for DZOU is below 0.05 so the data differ significantly from the predicts of the regression. Here it
is a classic case of a mix between two types of individuals, some susceptible, some resistant. This
is more reliable in version 6.1.
- Finally the resistance ratios are indicated for LD50 and LD50 (RR50 and RR95).
- As there are 2 strains, no pairwise test is required. Thus, the script only tests whether they are
all similar (i.e. equivalent to 1 strain) or different (2 strains vs 1 strain). Here, the test is highly
significant. However, as the DZOU strain does not fit a linear regression, the test cannot be
interpreted.

The corresponding graphs are showed below, with the default colors.
The first shows the regression with the data points; in the second one, as the data of one strain
(DZOU) were significantly different from the regression predicts, only the data are shown for the
corresponding strain, not the regression. From version 6.1 you get two additional graphs with
the 95% CI of the regression.

99
DZOU
DZOU
99
KIS
KIS

95
95
90
90

80
80
70
70
60
60
50
50
40
40
30
30
20
20
10
10
5
5

1
1

10
10
10
10
10
10
10
10

Dose(mg.L )
Dose(mg.L )


DZOU
DZOU
99
99
KIS
KIS

95
95
90
90

80
80
70
70
60
60
50
50
40
40
30
30
20
20

10
10
5
5
1
1

10
10
10
10
10
10
10
10

Dose(mg.L )
Dose(mg.L )

Mortality (%)

Mortality (%)

Mortality (%)

Mortality (%)

Pascal Milesi, Nicolas Pocquet and Pierrick Labb November 2014

version 6.1

References

Abbott, WS (1925). A method of computing the effectiveness of an insecticide. J. Econ. Entomol.; 18 :
265-267.
Finney DJ (1971). Probit analysis. Cambridge: Cambridge University Press. 350 p.
Hommel G (1988). A stagewise rejective multiple test procedure based on a modified Bonferroni test.
Biometrika 75, 383-6.
Johnson RM, Dahlgren L, Siegfried BD, Ellis MD (2013). Acaricide, fungicide and drug interactions in
honey bees (Apis mellifera). PLoS ONE 8(1): e54092.
Robertson, J. L., and H. K. Preisler. 1992. Pesticide bioassays with arthropods. CRC, Boca Raton, FL.

S-ar putea să vă placă și