what do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23...

25
7/9/18 1 Lecture 2: Descriptive statistics, normalizations & testing What do we need to know about a microbiome to understand it?

Upload: others

Post on 30-Apr-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

1

Lecture2:Descriptivestatistics,normalizations&testing

Whatdoweneedtoknowaboutamicrobiometounderstandit?

Page 2: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

2

ScopeofBioinformatics/Omicsdatastandards

Scope-General Scope-Specific Description

Experiment description

Reporting (Minimum information)

Documentation for publication or data deposition

Data exchange & modelingCommunication between organizations and tools

TerminologyOntologies and CV’s to describe experiments or data

Experiment execution

Physical standards Reference materials, spike-in controlsData analysis & quality metrics

Analyze, compare, QA/QC experimental results

ExistingreportingstandardsforOmicsAcronym Full name Domain Organization

CIMRCore Information for Metabolomics

Metabolomics MSIReporting

MIAMEMinimum Information about a

Transcriptomics MGEDMicroarray Experiment

MIAPEMinimum Information about a

Proteomics HUPO-PSIProteomics Experiment

MIGS-MIMSMinimum Information about a

Genomics GSCGenome/Metagenome Sequence

MIMIxMinimum Information about a

Proteomics HUPO-PSIMolecular Interaction eXperiment

MINIMESSMinimal Metagenome Sequence

Metagenomics GSCAnalysis Standard

MINSEQE

Minimum Information about a Genomics, Transcriptomics

MGEDhigh-throughput Nucleotide (UHTS)Sequencing Experiment

MISFISHIE

Minimum Information Specification

Transcriptomics MGED

For In Situ Hybridization andImmunohistochemistryExperiments

Page 3: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

3

MIxS• TheGSCfamilyofminimuminformationstandards(checklists)–MinimumInformationaboutany(x)Sequence(MIxS)• MIGS– genomes• MIMS– metagenomes• MIMARKS– markergenes• 15additionalenvironmentalpackages

Theminimuminformationaboutagenomesequence(MIGS-MIMS)specification

http://gensc.org

Page 4: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

4

Whatdoesthenumberofsequencestellusaboutthephysicalcharacteristicsofthemicrobiomes?

FromsequencestoOTU/ASVtable

Sequencing

Sample1 Sample2 ... Sample N

AbundancesofeachmicrobialtaxonineachoftheNsamples

8

Page 5: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

5

Numberofreadspersample

9

barplot(sort(sample_sums(mb), decreasing = T), names.arg = NA, log="y")

NormalizingOTU/ASVtablesforsequencingeffortRawCounts Proportions

Sample1 ... Sample N

n11 n1Nn21 n2Nn31 n3Nn41 n4Nn51 n5Nn61 n6Nn71 n7Nn.1 n.1

pij =nij/n.j

Sample1 ... Sample N

p11 p1Np21 p2Np31 p3Np41 p4Np51 p5Np61 p6Np71 p7N1 1

10

Page 6: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

6

Potentialproblemwithrelativeabundance

April 28, 2015::NYUBiological Networks

Absolute Abundance (1)

Total community size

Sample number

Abu

ndan

ce

Sample number

Abu

ndan

ce

Total community size

Sample number

Abu

ndan

ce

Relative Abundance

Absolute Abundance (2)

Total sum Normalization

Absolute Abundance (1)

Compositional Artifacts Mask Underlying Correlation

11

Negativecorrelationoftherelativeabundances• Theproportionsarenegativelycorrelatedbydesign.• Ifone(ormore)OTUs/ASVsweretoincreaseinabsoluteabundance,therelativeabundancesofallotherswilldecreasetoaccommodatetheadditiveconstraint.

12

Page 7: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

7

Compositionaldataanalysis:logratios

• Mainidea:ratiosofabsoluteandcompositionaldataarepreserved

• log $%$&= log (%/*

(&/*= log (%

(&,

• Where• 𝑀 = 𝑡𝑜𝑡𝑎𝑙𝑐𝑜𝑚𝑚𝑢𝑛𝑖𝑡𝑦𝑠𝑖𝑧𝑒• i,j=microbe

• MoredetailsisAitchison,J.(1986).Thestatisticalanalysisofcompositionaldata.

13

Othernormalizations

• Normalizedby1component,nd• 𝑦:; = log <%&

<=&= log 𝑛:; − log 𝑛?;

• ndj >0foralld• Assumingthetrueabundanceofdisthesameacrossallsamples

• Normalizedbygeometricmean(centered)• 𝑦:; = log( <%&

A <B&,…,<E&= log 𝑛:; − log(𝑔 𝑛G;, … , 𝑛H; )

• 𝑔 𝑛G;, … , 𝑛H; = ∏ 𝑛:;H:KG

G/H

• Note:log[0]->-∞;sooftenweadd‘pseudo-counts’beforethesetransformations.

14

Page 8: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

8

CLR:CenteredLog-ratiotransformation

• 𝑐𝑙𝑟 𝑥 = log $A($)

• 𝑔 𝑥 = 𝑥G𝑥N …𝑥OP

• TransformeddataareunconstrainedinN-1dimensions

15

April 28, 2015::NYUBiological Networks

Compositional Data Analysis: Data Transformations

Aitchison, J. (1986). The statistical analysis of compositional data. London; New York: Chapman and Hall.

Centered Log-ratio:

Compositional data CLR transformed data

Transformed data are in an unconstrained (D-1)-Euclidean space

April 28, 2015::NYUBiological Networks

Compositional Data Analysis: Data Transformations

Aitchison, J. (1986). The statistical analysis of compositional data. London; New York: Chapman and Hall.

Centered Log-ratio:

Compositional data CLR transformed data

Transformed data are in an unconstrained (D-1)-Euclidean space

Whyismicrobiomediversityimportant?

Page 9: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

9

Describingmicrobiomecommunityisaliketotakingademographiccensus

• Howmanyprofessionsarerepresented?• Howwellrepresentedarethedifferentprofessions?• Aresomeprofessionsmorepopular?

Town1 ... TownN

carpenter p11 p1Nbanker p21 p2Nstudent p31 p3Nteacher p41 p4Ndoctor p51 p5Npolice p61 p6Nchef p71 p7N

1 1

17

Alphadiversitydefinition(s)

• Alphadiversitydescribesthediversityofasinglecommunity(specimen).• Instatisticalterms,itisascalarstatisticcomputedforasingleobservation(column)thatrepresentsthediversityofthatobservation.• Therearemanystatisticsthatcandescribediversity:e.g.taxonomicalrichness,evenness,dominance,etc.

18

Page 10: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

10

Speciesrichness

• Supposeweobserveacommunitythatcancontainuptok‘species’.• TherelativeproportionsofthespeciesareP={p1,…,pk}.• Richnessiscomputedas

R=1(p1)+1(p2)+…+1(pk) ,where1(.)isanindicatorfunction,i.e.1(x)=1ifpi≠0,and0otherwise.

• HigherRmeansgreaterdiversity• Verydependentupondepthofsamplingandsensitivetopresenceofrarespecies

19

Rarefactioncurves

• Note:rareficationasameansfornormalizationisfromstatisticalstandpointabadidea.Don’tthrowawayinformation!• Rarefactioncurvesarenotthesame!• Usefultoassesssensitivityofsamplesizetoobservedalpha-diversityestimates.• Idea:

• LetN1,…,NK beasetofnumbersNi <Ni+1;• Letn’ij(k) beabundanceoftaxoni insamplejsubsampledtoNk totalcountspersample;

• EstimateaveragealphadiversityforeachNk overaseveralrepeatedsubsamplings;• Plottheaveragealphadiversityasafunctionofsamplesize.

20

Page 11: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

11

Rarefactions

Cho,I.,Meth,BA.,Nondorf,L.,Li,K.,Alekseyenko,AV.,Blaser,MJ."Subtherapeutic antibioticsalterthemurinecolonicmicrobiomeandearlylifeadiposity",Nature488,621-- 626(30August2012). 21

Chao1index

• Speciesrichnessindexisoftentoosensitivetodepthofsampling,• Chao1indexovercomesthisproblembyapplyingacorrection

• 𝑅R = 𝑆TUV + (XBY

NXY),

• Where𝑓G isthenumberoftaxawithasingleobservation(singletons),𝑓N isthenumberoftaxawithexactlytwoobservations.• Ifasamplecontainsalotofsingletontaxa,thenthereisagreaterchancethatthissampleisundersampled.

Page 12: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

12

Shannonindex• Supposeweobserveacommunitythatcancontainuptok‘species’.• TherelativeproportionsofthespeciesareP={p1,…,pk}.• Shannonindexisrelatedtothenotionofinformationcontentfrominformationtheory.ItroughlyrepresentstheamountofinformationthatisavailableforthedistributionofP.• Whenpi =pj,foralli andj,thenwehavenoinformationaboutwhichspeciesarandomdrawwillresultin.Astheinequalitybecomesmorepronounced,wegainmoreinformationaboutthepossibleoutcomeofthedraw.TheShannonindexcapturesthispropertyofthedistribution.• Shannonindexiscomputedas

Sk=– p1log2p1 – p2log2p2 – …– pklog2pkNoteaspiè0,log2piè –∞,wethereforedefine pilog2pi=0.

• HigherSk meanshigherdiversity

23

FromShannontoEvenness

• Shannonindexforacommunityofkspecieshasamaximumatlog2k• Wecanmakedifferentcommunitiesmorecomparableifwenormalizebythemaximum• Evennessindexiscomputedas

Ek=Sk/log2k

• Ek=1meanstotalevenness

24

Page 13: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

13

Simpsonindex

• Supposeweobserveacommunitythatcancontainuptok‘species’.• TherelativeproportionsofthespeciesareP={p1,…,pk}.• Simpsonindexistheprobabilityofresamplingthesamespecieontwoconsecutivedrawswithreplacement.• Supposeonthefirstdrawwepickedspeciei,thiseventhasprobabilitypi,hencetheprobabilityofdrawingthatspeciestwiceispi*pi.• Simpsonindexisthuscomputedas

D=1– (p12 +p22 +…+pk2)• D=0meansnodiversity(1speciesiscompletelydominant)• D=1meanscompletediversity

25

PhylogeneticDiversity(Faith’sD)

• Faith(BiologicalConservation1992,61,1-10)consideredtheproblemofselectingspeciesforconservationsoastopreservediversity.

• FaithdefinesPD(phylogeneticdiversity)asthesumofallthebranchlengths.PDisanalogoustototalinformationinthetree.

• Themarginalcontributionofatipxisthenmini,j(Dx,i +Dx,j – Di,j).Highervaluesuggestagreaterimpactonconservation.

26

Conservation evaluation and phylogenetic diversity 5

The rationale for this formula is clarified using the example of Fig. 2. The pairwise D values are represented by the arrows along the branches in the diagram. These branches show how the for- mula above provides a value equal to the gain in PD with the addition of x to the subset. Note that the value for the gain in phylogenetic diversity is based on complementarity (cf. Vane-Wright et al., 1991), in that the contribution of a given taxon to PD will depend on which other taxa are already in the subset. In practice, the taxon providing the largest G value might be added to the subset of reserved taxa.

The same formula can be used to build up a subset of a required number of taxa from scratch. Here, the building process would begin by taking those two taxa that have maximum distance, D, apart and then consecutively adding the taxon to the subset that maximises G. Such calculations would be useful, for example, in incrementally building up a set of reserve areas such that phylo- genetic diversity is maximised at each step.

Finally, the formula can be used to evaluate the PD of a pre-defined subset of taxa. This option will be useful, for example, when a given reserve system is to be evaluated relative to the overall phylogenetic diversity for a number of different groups of taxa. An estimate of the cladogram for each group of related taxa is used to calculate the PD value corresponding to the particular subset of these taxa found in the reserve system. These PD values for individual cladograms would then be summed together for an overall phylogenetic di- versity score that could be compared to that for

J

Fig. 2. A hypothetical cladogram of four taxa. Taxa i and j are already in the reserve system, and the potential contri- bution of taxon x is to evaluated. The thickened arrows cor- respond to the path-length distances Dx.i, Dx.j, and Di. j. The amount that x adds to the total length of the minimum span- ning path (the phyiogenetic diversity, PD) can be calculated by adding together the lengths between x and i and x and j, subtracting the length between i and j, and dividing the result

by 2. For further information see text.

other nominated reserve systems. One requirement of this multiple-cladogram approach is that the branch lengths for the different cladograms be measured in comparable units. I will return to this strategy in the Discussion section below.

It is noteworthy that informative distance val- ues can be prepared even in the absence of exact estimates of branch lengths, as when the exact length of a terminal branch (corresponding to the number of uniquely derived features for the termi- nal taxon) is regarded as poorly known. Length estimates for terminal branches will often be poorly estimated in cladistic analyses because fea- tures unique to a single taxon are usually deleted from the analysis. In such cases, the branches may be assigned unit length, or lengths according to an assumption of equal rates of feature derivation in all lines of descent.

When all branch length information is unknown or ignored, the lengths can all be assigned unit length so that phylogenetic diversity then depends only on the branching pattern on the cladogram, The PD value, for any subset of taxa of size N, reduces to a simple function of the number of different nodes on the cladogram that lie along the corresponding minimum spanning path:

PD = (N - 1) + no. of internal nodes (branching points) on the minimum spanning path.

Thus, the best subset of N taxa is the one that spans the greatest number of nodes on the clado- gram, and the best addition to a subset is the taxon adding the greatest number of nodes to the minimum spanning path.

These different methods of branch length as- signment are illustrated for the bumble bee (Api- dae) example discussed below.

A computer program 'PHYLOREP' , written in Fortran 77, for PD calculations is available from the author.

EXAMPLES

Bumble bees of the sibiricus group

Vane-Wright et al. (1991) used a cladogram for species of bumble bees in the sibiricus group of Bombus Latreille (Williams, in press) to demon- strate their method of taxic diversity weighting. This sample was also used in the discussion by May (1990) to highlight differences between equal weighting to all species and taxic diversity weight-

Page 14: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

14

Numbersequivalentdiversity

• Oftenitisconvenienttotalkaboutalphadiversityintermsofequivalentunits:• Howmanyequallyabundanttaxawillittaketogetthesamediversityasweseeinagivencommunity?

• Forrichnessthereisnodifferenceinstatistic• ForShannon,rememberthatlog2kisthemaximumwhichisattainedwhenallspeciesareequallyrepresented.Hencethediversityinequivalentunitsis2Sk

• ForSimpsontheequivalentunitsmeasureofdiversityis1/(1-D)

27

Howtocomparemicrobiomes?

Page 15: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

15

MotivatingexampleControl(water)

Tetracycline

Vancomycin

Tetracycline+Vancomycin

Microbiotafromfecalandcecalcontents

Weaning Sacrifice

HormonelevelsFatlevelsBonemineralcontent

Sub-TherapeuticAntibioticTreatment(STAT)

Cho,I.,Meth,BA.,Nondorf,L.,Li,K.,Alekseyenko,AV.,Blaser,MJ.“Subtherapeutic antibioticsalterthecolonicmicrobiome andearlylifeadiposityinmice”.Nature.2012Aug30;488(7413):621-6.

29

Penicillin

Questions• Arethereanyspecifictaxa,whichareassociatedwithantibiotictreatment?• Bypresence/absencepatterns• Byrelativeabundance

• Istherecorrelationbetweenabundanceofanytaxaandmetabolicphenotypes(hormonelevels,fat,bone)?

STAT

Microbiome

?

Microbiome

Phenotypes

?

30

Page 16: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

16

Hypotheses

• Areprecise statementsthatareamenabletobeingprovenfalseusingdata.• Nullhypothesis:apropositionthatcorrespondstodefaultposition.(“Nothingspecialishappening”)• Alternativehypothesis:apropositionthatdescribesanondefaultoutcome(“Somethinginteresting isgoingon”)• TheinferenceisobtainedbyrejectingtheNullhypothesis.Nullhypothesiscanneverbeconfirmedbythedata,nordoesithavetobe!

31

Exampleofhypotheses• Generalquestion:Areanytaxa associatedwithantibiotictreatment?

• Univariate hypothesisquestion:Istaxon Tassociatedwithantibiotictreatment?

• Nullhypothesis:abundanceoftaxon Tfollowthesamedistributionintreatedandcontrolgroups.

• Alternativehypothesis1:abundanceoftaxon Tfollowdistributionofdifferentforminthetwogroups.

• Alternativehypothesis2:abundanceoftaxonTfollowthesameformofdistributionbutwithdifferentmean/medianbetweengroups.

• Alternativehypothesis3:abundanceoftaxonTfollowthesameformofdistributionbutwithdifferentvariancebetweengroups.

STAT Microbiome(manytaxa)

?

STAT TaxonT?

−4 −2 0 2 4 −4 −2 0 2 4

−4 −2 0 2 4 −4 −2 0 2 4

−4 −2 0 2 4 −4 −2 0 2 4

32

Page 17: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

17

Flowofstatisticalinferenceunderhypothesistesting• DefineateststatisticthatevaluatesevidenceagainsttheNullHypothesis;

• Whatisagoodstatistictocomparetheaveragesoftwosamples:x1,…,xN andy1,…,yM?Whatisthenullhypothesishere?

• DeterminethedistributionoftheteststatisticundertheNullHypothesis;• Optionshere:

• Asymptoticpropertiesofthestatistic;• MonteCarlosimulations:bootstrap,permutation,…

• HowwouldthedistributionofstatisticabovelooklikeundertheNull?• Calculatetheteststatisticvalueintheobserveddata;• Comparetheobservedteststatistictothedistributionofthestatistic,whenthenullhypothesisistrue.• Iftheprobabilityofobservingastatisticasextremeormoreissmallenough(P<0.05?),rejectthenullhypothesis.

P-values• IftheNullHypothesiswasinfacttrueastatistic, usedtoperformthetest,wouldfollowacertaindistribution:thenulldistribution.

• P-valueisthetailprobabilityunderthenulldistribution.

−3 −2 −1 0 1 2 3

0.0

0.1

0.2

0.3

0.4

Two−tail p−value

statistic

density

−3 −2 −1 0 1 2 3

0.0

0.1

0.2

0.3

0.4

One−tail p−value

statistic

density

34

Page 18: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

18

DistributionofOTU/ASVabundancedata

• Justifiabledistributionassumptionsoftenallowforbetterstatisticaltests.• PropertiesofOTU/ASVabundancedata:

• Correlated:Sumsto1,hencetoincreasesomething,somethingelsehastodecrease• Variableacrosssubjects

• CanpossiblybemodeledthroughcompoundDirichlet-Multinomialdistribution(wewilltalkaboutthisdistributionlaterinthecourse).Marginalunivariate(Beta-binomial)testshavetobedescribed.• Whendistributionspecifictestsarenotavailable,wehavetorelyonnon-parametric(distributionfree)tests,possiblyatthecostofdecreasingthepowerofthetests.

35

Somepracticalstatisticalteststotrywithyourmicrobiomes…

Page 19: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

19

ChiSquaredtestfortaxonincidence• RawCounts

Sample1 ... Sample N

n11 n1Nn21 n2Nn31 n3Nn41 n4Nn51 n5Nn61 n6Nn71 n7Nn.1 n.1

• IncidencetableSample1 ... Sample N

111 11N121 12N131 13N141 14N151 15N161 16N171 17N

1ij = {1, if nij > 0

0, otherwise37

ChiSquaredtestfortaxonincidence• Wefocusonasingletaxon• Supposetheobservationsofthetaxoncomefromtwogroups(e.g.controlvs.STAT)• Question:Isthefrequencyofoccurrenceofthistaxonintwogroupsdifferent?• Nullhypothesis:thefrequencyisthesame.• SignificantChiSquaretestindicatesadifferenceintherateofoccurrenceofthetaxon.• InR:chisq.test

Tax Lab

1or0 Control

… …

1or0 STAT

Control STAT

Present n11 n21 n2.

Absent n12 n22 n1.

n.1 n.2 N

38

Page 20: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

20

Mann-WhitneyUorWilcoxon rank-sumtwo-sampletest

• Assumptions:• Independentobservations• Observationscanbeorderedwithrespecttoeachother

• Nullhypothesis:Thedistributionintwosamplesisthesame.IfonerandomlydrawsoneobservationfromeachsampleX,Y;thenPr(X>Y)=Pr(Y>X)• Two-sidedalternativehypothesis:Pr(X>Y)≠Pr(Y>X)• Interpretation:forcontinuousobservations,significanttestsindicatechangeinthemedian• Example:Istheabundanceofataxon differentbetweenSTATandControl?• InR:wilcox.test

39

Connectionwithpredictivity

• Mann-WhitneyU-statisticcalculation:• Converttheobservationstoranks• Computethesumofranksineachsample,R1 andR2

• U1 =R1 – n1(n1 +1)/2• U2 =R2 – n2(n2 +1)/2• U=min(U1,U2)

• OnecanshowthatUstatisticisequivalenttoAUC.AUC=U/(n1 n2)

• AUC,areaunderreceiveroperatorcharacteristic(ROC)curve,measureshowwellwecandistinguishonesamplefromanother.AUC=0.5meanspredictivitynobetterthanrandom,AUC=1.0perfectpredictivity.

Sample1 Sample2 Ranks1 Ranks20.135 2.680 8 1-0.907 1.078 18 2-0.801 0.080 16 90.452 0.493 6 5-0.523 0.010 15 110.075 -0.322 10 131.038 -0.370 3 14-1.140 0.633 19 4-2.308 -0.020 20 12-0.808 0.368 17 7

RankSums 132 78U 77 23Ustatistic 23AUC 0.77 0.23

40

Page 21: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

21

Kruskal-Wallisone-wayanalysisofvariance(morethantwosamples/groups)

• Assumptions:• Independentobservationsthatfollowdistributionwiththesameshapeandscale

• Observationscanbeorderedwithrespecttoeachother• Nullhypothesis:Thelocation(median)ofallthegroupsisthesame.• Alternativehypothesis:Locationforatleastonegroupisdifferentfromlocationofatleastoneothergroup• Example:IstheabundanceofataxondifferentinSTAT/controlover3sampledtimepoints?• InR:kruskal.test

41

Correlationcoefficients,rankcorrelations• Linearcorrelationcoefficient(Pearson)assumeslineardependencebetweentwovariables• Rankcorrelationcoefficientmeasuretheextentofmonotonicitybetweentwovariables• Nullhypothesisforcorrelationtesting:correlationcoefficientisequalto0.

● ● ● ● ●

0.0 0.5 1.0 1.5 2.0 2.5

0e

+0

02

e+

08

4e

+0

8

x

1/(

exp

(−x))

^8

0.0 0.5 1.0 1.5 2.0 2.5

1e

+0

01

e+

04

1e

+0

8

x

1/(

exp

(−x))

^8 (

log−

sca

le)

Pearsoncorrelationcoefficient:0.66(notsignificant,p=0.15)

Diaconis,P.(1988),GroupRepresentationsinProbabilityandStatistics,LectureNotes-MonographSeries,Hayward,CA:InstituteofMathematicalStatistics,ISBN0-940600-14-5 42

Page 22: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

22

Rankcorrelationcoefficients

• Spearman’sρ:RankcorrelationmeasuredefinedasthePearsoncorrelationofthetwovariablesafterconversiontoranks• Kendall’sτ:Rankcorrelationmeasurebasedoncountingconcordantpairs.[(x1,y1)and(x2,y2)areconcordantifx1>x2 wheny1>y2]• Example:Istherecorrelationbetweenanygiventwotaxa?Istherecorrelationbetweenagivenmetabolicvariableandagiventaxon?• InR:• cor.test(x, y, method=‘spearman’) • cor.test(x, y, method=‘kendall’)

43

Problemswithtestingmanyhypothesessimultaneously• WehavemanyOTUs/ASVs/taxathatwewouldliketoapplythetestto.• Ifthetestisappliedatspecifiedsignificancelevel(probabilityoffalselyrejectingthenull,whenitistrue),wecannotguaranteethatcombinedresultisatthesignificanceleveloriginallyspecified.• Sincep-valuesaredistributeduniformlyifthenullhypothesisistrue,theexpectednumberofrejectionsbymerechancem*α• Howdowecontrolsignificanceformultipletests?

44

Multiple Testing• In “Big Data”, we often want to test many hypotheses in one batch.• p-values are distributed uniformly when null hypothesis is true• The expected number of rejections by chance is m*α

●●●●●

●●●●

●●●

●●

●●●●●●●

●●●

●●●●●

● ●●●

●●●

●●●●●

●●●

●●●●●

●●●

●●●

●●●●●●

●●●●●●●●

●●●●●●●●

●●●●

●●●●●

●●

●●●

●●●●●●●●

●0.0

0.1

0.2

0.3

0.4

0.5

0.00 0.25 0.50 0.75 1.00p

coun

t rejected●

FALSETRUE

P−values under Null hypothesis with 100 trials

5

Poisson-only Count Simulation• Uncertainty Depends on Library Size True Species (or Gene) Proportion in Simulation

Proportion

Species or Gene

Model Uncertainty in NGS Count Data

6

Page 23: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

23

FWER:Family-wiseerrorrate#not-rejected

#rejected

Total

#truenullhypotheses U V m0

#non-truenullhypotheses

T S m-m0

Total m-R R m

• Supposeweperformm tests(e.g.m taxa aretestedforassociationwithantibiotictreatment)• Thenumberoftruenullhypothesesisunknownm0

• Visfalsepositiverate(TypeIerror)• Tisfalsenegativerate(TypeIIerror)• WeobserveR,butS,T,U,Vareunobserved• FWER=Pr(V≥1)

FWERcontrolmethodsadjustthesignificanceofeachindividualtesttoensureoverallsignificanceatgivenα.FWERresultinmorestringenttests. 46

Page 24: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

24

Example:Bonferroni correction

• Toensureoverallsignificanceatagivenα,oneperformseachindividualtestatα’=α/m• Verystringent,resultsinlossofpower(increaseinTypeIIerror)

47

FDR:falsediscoveryrate• ModifiestheideaofcontrollingTypeIerror,toinsteadcontroltherateatwhichtypeIerrorsdooccur• FDRistheexpectedvalueofV/R• MethodsforFDRcontrol

• Benjamini–Hochberg• Assumestestsareindependent

• Benjamini–Hochberg–Yekutieli• Assumesthattestsareuniformly

correlated:• Positivelycorrelated:ifonetesthaslow

p-value,othertestsaremorelikelytoalsobesignificant

• Negativelycorrelated:ifonetesthaslowp-value,othertestsareless likelytobesignificant

#not-rejected

#rejected

Total

#truenullhypotheses U V m0

#non-truenullhypotheses

T S m-m0

Total m-R R m

48

Page 25: What do we need to know about a microbiome to understand it?€¦ · kmeans higher diversity 23 From Shannon to Evenness •Shannon index for a community of k species has a maximum

7/9/18

25

FDRinR

• FDRisimplementedinRasap-valueadjustmentprocedure.• Input:p-valuesforasetofunivariate tests• Output:p-valuesthatareadjustedtoFDR• E.g.0.05adjustedp-valuemeansthatexpectedrateoffalsepositivesis0.05fortestssignificantatthatadjustedlevel• p.adjust• Methods:

• method = ‘fdr’: Benjamini-Hochberg• method = ‘BY’: Benjamini-Hochberg-Yekutieli

49

Filtering:reducingthenumberoftests• Wecanimprovetheoverallpowerofthetestsbyperforminglesssimultaneoustests.• Eliminate“uninteresting”taxa,e.g.ataxondoesnothavedeeptaxonomicresolution.• Eliminatetaxathatshowlowvariability.Thesearenotchangingmuchoverallthusarenotlikelytobedifferentacrossfactorlevels.• Eliminatetaxawithlowabundance.Theseareusuallynotmeasuredverywellandarelikelytohavelittlebiologicalsignificanceanyway.• Note:Acareneedstobetakenwithfilteringproceduressoasnottointroduceselectionbias,whichwillinvalidatemultiplecomparisonassumptions.Asafepracticeisforfilteringtobeblindtowardsthefactoryouwouldliketotest.

50