summary_metabarlist is a generic function used to produce summary statistics of a metabarlist
object.
summary_metabarlist(metabarlist, method = "dataset", groups = NULL)
a metabarlist
object
type of summary to provide. Should match with `dataset`, `motus` or `pcrs`. Default is `dataset`
a grouping vector or factor of same number of rows than `motus` or `pcrs` for which the summary should be done. Default is NULL
The summary_metabarlist
function returns basic summary statistics (nb of elements, reads and MOTUs in total or on average per pcrs) of a metabarlist
object. The format of the value returned depends on the method used.
summary_metabarlist
returns basic summary statistics of a metabarlist
object. The summary returned depends on the `method` used :
`dataset`returns a list of two data.frames: dataset_dimension contains the dimensions of the full metabarlist object, dataset_statistics contains the number of reads, motus in pcrs and samples, as well as average and sd values of reads and motus per sample
`motus` or `pcrs`returns a data.frame similar to the dataset_statistics described above according to a grouping factor/vector for MOTUs or pcrs
data(soil_euk)
## Dataset summary
summary_metabarlist(soil_euk, method = "dataset")
#> $dataset_dimension
#> n_row n_col
#> reads 384 12647
#> motus 12647 15
#> pcrs 384 11
#> samples 64 8
#>
#> $dataset_statistics
#> nb_reads nb_motus avg_reads sd_reads avg_motus sd_motus
#> pcrs 3538913 12647 9215.919 10283.45 333.6849 295.440
#> samples 2797294 12382 10926.930 10346.66 489.5117 239.685
#>
## Data summary per control type (NA = samples)
summary_metabarlist(soil_euk, method = "pcrs",
groups = soil_euk$pcrs$control_type)
#> nb_elements nb_reads nb_motus avg_reads sd_reads avg_motus
#> NA 256 2797294 125315 10926.9297 10346.656 489.51172
#> extraction 16 73393 200 4587.0625 5738.397 12.50000
#> pcr 32 323516 323 10109.8750 12491.037 10.09375
#> positive 32 342205 1772 10693.9062 9250.060 55.37500
#> sequencing 48 2505 525 52.1875 191.229 10.93750
#> sd_motus
#> NA 239.68502
#> extraction 10.93008
#> pcr 10.56580
#> positive 24.44711
#> sequencing 35.95411
## Data summary per phyla
summary_metabarlist(soil_euk, method = "motus",
groups = soil_euk$motus$phylum_name)
#> nb_reads nb_motus avg_reads sd_reads avg_motus
#> Annelida 247553 338 732.40533 6595.131372 12.147929
#> Apicomplexa 1587 41 38.70732 77.264883 4.878049
#> Arthropoda 474922 1566 303.27075 2297.171727 12.102810
#> Ascomycota 205964 813 253.33825 1559.692496 14.842558
#> Bacillariophyta 9364 5 1872.80000 4179.882678 2.200000
#> Basidiomycota 796471 790 1008.19114 11283.635740 14.975949
#> Blastocladiomycota 8 1 8.00000 NA 2.000000
#> Bryozoa 354 2 177.00000 244.658946 10.500000
#> Chlorophyta 262 13 20.15385 57.113697 3.923077
#> Chordata 747 13 57.46154 162.241905 2.307692
#> Chytridiomycota 14692 126 116.60317 463.843371 9.658730
#> Cnidaria 9 1 9.00000 NA 4.000000
#> Euglenida 3 1 3.00000 NA 2.000000
#> Euryarchaeota 4 2 2.00000 0.000000 1.000000
#> Eustigmatophyceae 17 1 17.00000 NA 1.000000
#> Firmicutes 3 1 3.00000 NA 1.000000
#> Gastrotricha 11810 31 380.96774 1057.149579 23.032258
#> Mollusca 3254 4 813.50000 653.168942 47.750000
#> Mucoromycota 24852 121 205.38843 1280.439816 15.966942
#> NA 1425205 7825 182.13482 3882.495526 8.630543
#> Nematoda 40080 430 93.20930 774.259305 8.195349
#> Pinguiophyceae 6 1 6.00000 NA 1.000000
#> Platyhelminthes 21358 143 149.35664 630.796248 10.055944
#> Porifera 947 20 47.35000 71.198961 5.000000
#> Proteobacteria 12 4 3.00000 1.414214 1.000000
#> Rotifera 6919 63 109.82540 343.048315 16.047619
#> Streptophyta 249436 199 1253.44724 9105.991740 13.402010
#> Tardigrada 656 12 54.66667 112.436918 11.583333
#> Zoopagomycota 2418 80 30.22500 99.602244 4.762500
#> sd_motus
#> Annelida 30.444706
#> Apicomplexa 8.316234
#> Arthropoda 26.520213
#> Ascomycota 30.928088
#> Bacillariophyta 2.167948
#> Basidiomycota 32.861744
#> Blastocladiomycota NA
#> Bryozoa 12.020815
#> Chlorophyta 7.931599
#> Chordata 2.323238
#> Chytridiomycota 14.639761
#> Cnidaria NA
#> Euglenida NA
#> Euryarchaeota 0.000000
#> Eustigmatophyceae NA
#> Firmicutes NA
#> Gastrotricha 43.688659
#> Mollusca 47.373516
#> Mucoromycota 34.475821
#> NA 20.233437
#> Nematoda 20.349258
#> Pinguiophyceae NA
#> Platyhelminthes 18.950185
#> Porifera 6.198472
#> Proteobacteria 0.000000
#> Rotifera 30.022265
#> Streptophyta 27.076196
#> Tardigrada 18.617969
#> Zoopagomycota 10.607191
## Data summary per Habitat (i.e. to get from soil_euk$samples).
# Here, NA values correspond to technical controls
summary_metabarlist(soil_euk, method = "pcrs",
groups = soil_euk$samples$Habitat[match(soil_euk$pcrs$sample_id,
rownames(soil_euk$samples))])
#> nb_elements nb_reads nb_motus avg_reads sd_reads avg_motus
#> NA 128 741619 2820 5793.898 9287.649 22.03125
#> Terra firme 128 1410057 69372 11016.070 11067.993 541.96875
#> White sands 128 1387237 55943 10837.789 9614.209 437.05469
#> sd_motus
#> NA 32.24364
#> Terra firme 244.95318
#> White sands 223.16204