A. Siberchicot, D. Charif, G. Terraz and F. Vavre https://cran.r-project.org/web/packages/Mondrian/

This first example computes the data named
*endosymbiont_1pop*
embeded in the
*Mondrian*
package.

###
*
***Input**

The data set contains 10 observations (each individual, in rows) on the following 3 variables (each endosymbiont, in columns):
*C*
,
*H*
, and
*W*
are numeric vectors indicating if the endosymbiont is detected.

The presence of a symbiont in an individual is indicated by*1*
and its absence by
*0*
.

###
*
***Output**

The mondrian function produces one plot and one table of results.

The output table has two rows (the first containing the distinct profiles of multiple infection and the second the prevalence of each profiles) and as many columns as profiles of multiple infection.

Here, there are 3 distincts profiles. Individuals having the first infection profile (110) are infected by the symbionts 'C' (1) and 'H' (1), and not by the symbiont 'W' (0). Individuals having the second infection profile (011) are infected by the symbionts 'H' (1) and 'W' (1), and not by the symbiont 'C' (0). Finaly, individuals having the third infection profile (010) are infected by the symbiont 'H' (1) and not by the symbionts 'C' (0) and 'W' (0).

The columns of the output table (containing profiles of multiple infection) match with the 'lines' in the output plot.

Here, all individuals are infected by the 'H' symbiont (central red column in the plot) but only 0.2% of the sample are only infected by this symbiont (column '010' in the table of results).

0.6% of the sample (i.e., 6 individuals among 10) are coinfected by the symbionts 'C' (blue column in the plot) and 'H' (red column) and only 0.2% (i.e., 2 individuals among 10) are coinfected by the symbionts 'W' (yellow column) and 'H' (red column).

The presence of a symbiont in an individual is indicated by

The output table has two rows (the first containing the distinct profiles of multiple infection and the second the prevalence of each profiles) and as many columns as profiles of multiple infection.

Here, there are 3 distincts profiles. Individuals having the first infection profile (110) are infected by the symbionts 'C' (1) and 'H' (1), and not by the symbiont 'W' (0). Individuals having the second infection profile (011) are infected by the symbionts 'H' (1) and 'W' (1), and not by the symbiont 'C' (0). Finaly, individuals having the third infection profile (010) are infected by the symbiont 'H' (1) and not by the symbionts 'C' (0) and 'W' (0).

The columns of the output table (containing profiles of multiple infection) match with the 'lines' in the output plot.

Here, all individuals are infected by the 'H' symbiont (central red column in the plot) but only 0.2% of the sample are only infected by this symbiont (column '010' in the table of results).

0.6% of the sample (i.e., 6 individuals among 10) are coinfected by the symbionts 'C' (blue column in the plot) and 'H' (red column) and only 0.2% (i.e., 2 individuals among 10) are coinfected by the symbionts 'W' (yellow column) and 'H' (red column).

This second example computes the data named
*endosymbiont_3pop*
(the data set is shown below) embeded in the
*Mondrian*
package.

###
*
***Input**

The data set contains 30 observations (each individual, in rows) on the following 6 variables (including 5 endosymbionts, in columns):
*pop*
is a factor
(with 3 levels:
*AlxT*
,
*MalD*
and
*MslCh*
) indicating which of the three populations each individuals belongs and
*A*
,
*C*
,
*H*
, and
*W*
are numeric vectors indicating if the endosymbiont is detected.

The presence of a symbiont in an individual is indicated by*1*
and its absence by
*0*
.

###
*
***Output**

The mondrian function produces one plot and one list of results.

The output is a list of tables (containing the distinct profiles of multiple infection) for the sub-populations and the whole sample.

Here, there are 3 sub-populations ('$AlxT', '$MalD' and '$MslCh') in the sample ('$pop').

- In the first sub-population ('$AlxT', first element in the output list, at the top-left of the plot), there are 10 individuals which are all (100%, there is only one column in the '$AlxT' element of the output list) coinfected by the symbionts 'C' (blue column) and 'H' (green column); their profile of multiple infection is '01100'.

- In the second sub-population ('$MalD', second element in the output list, at the top-right of the plot), most individuals (0.7% of 10 individuals, see the last column of the '$MalD' element of the output list) are singly-infected by the 'H' symbiont (green column).

- In the 'MslCh' sub-population (third element in the output list, at the bottom-left of the plot), most individuals (0.4% of 10 individuals, see the third column of the '$MslCh' element of the output list).

- In the whole sample (last element in the output list, at the bottom-right of the plot), the 30 individuals are split into 9 distinct profiles of multiple infection. The prevalent profile of multiple infection (0.13% of 30 individuals, see the third column of the '$pop' element of the output list) is a coinfection by the symbiont 'C' and 'H'.

The presence of a symbiont in an individual is indicated by

The output is a list of tables (containing the distinct profiles of multiple infection) for the sub-populations and the whole sample.

Here, there are 3 sub-populations ('$AlxT', '$MalD' and '$MslCh') in the sample ('$pop').

- In the first sub-population ('$AlxT', first element in the output list, at the top-left of the plot), there are 10 individuals which are all (100%, there is only one column in the '$AlxT' element of the output list) coinfected by the symbionts 'C' (blue column) and 'H' (green column); their profile of multiple infection is '01100'.

- In the second sub-population ('$MalD', second element in the output list, at the top-right of the plot), most individuals (0.7% of 10 individuals, see the last column of the '$MalD' element of the output list) are singly-infected by the 'H' symbiont (green column).

- In the 'MslCh' sub-population (third element in the output list, at the bottom-left of the plot), most individuals (0.4% of 10 individuals, see the third column of the '$MslCh' element of the output list).

- In the whole sample (last element in the output list, at the bottom-right of the plot), the 30 individuals are split into 9 distinct profiles of multiple infection. The prevalent profile of multiple infection (0.13% of 30 individuals, see the third column of the '$pop' element of the output list) is a coinfection by the symbiont 'C' and 'H'.