dataesr/scientific-paragraphs-categorization huggingface dataset:
Improved Modeling of Heterogeneity Supports Porifera-Sister We investigated how the results of our phylogenetic analyses change as different evolutionary models were used to analyze either the original amino acid data or the recoded data. Phylogenies obtained under LG+G and WAG+G, as well as trees derived using GTR+G with and without Dayhoff-6, S&R-6, and KGB-6 recoding, supported Ctenophora-sister (posterior probabilities [PPs] z 1; Table  3  and Figures  S1-S4 ). Similarly, phylogenies inferred from Chang using PF-scheme and CAT-GTR+G (see STAR Methods) supported Ctenophora-sister with 100% bootstrap support and PP z 1, respectively (see Table  3  and Figures  S4D  and S4E ). Differently, CAT-GTR+G analyses of WhelanD20 recovered either Ctenophora-sister or Porifera-sister (Porifera as the sister group of all other animals) depending on the outgroups used.
WhelanD20-Opistho, the dataset including all original outgroups from  [10]  (STAR Methods; Table  3 ; Figure  S1D ), supported Ctenophora-sister (PP z 1). In contrast, WhelanD20-Holo, the dataset from which fungal outgroups were excluded, and WhelanD20-Choano, the dataset from which all outgroups but the Choanoflagellata were excluded, supported Porifera-sister (PP = 0. 68 and PP = 0. 77, respectively; Table  3 ; Figures  S2B  and S3B ). Support for Ctenophora-sister was severely reduced in CAT-GTR+G analyses of both recoded datasets, with support for Porifera-sister being higher than that for Ctenophora-sister (Table  3 ; Figures  1  and S1-S4 ). This was particularly evident for the Dayhoff-6 and S&R-6 recoded versions of both datasets. For KGB-6, the PP for Porifera-sister was 0. 78 for Chang and 0.
68 for WhelanD20-Holo. The KGB-6 recoded versions of WhelanD20-Opistho and WhelanD20-Choano failed to resolve the relationships at the root of the animal tree. However, Ctenophora-sister received the least support also with these datasets (Table  3; Figures S1J  and S3H ). Our results show that support for Ctenophora-sister decreases, while at the same time support for Porifera-sister increases, when heterogeneity in the data is better accounted for.
A key aspect of the debate is that support for both hypotheses is generally recovered from the same dataset when different substitution models and/or taxon-and gene-sampling strategies are used (contrast  [6, 10]  and  [42, 45] , and see  [7, 43, 47] ). Porifera-sister generally  [6] , but not invariably  [12, 38] , emerges when site-specific differences in amino acid composition are modeled and distant outgroups (e. g. , Fungi) are not included in the analyses. Ctenophora-sister invariably emerges when site-specific amino acid differences are not modeled  [10]  or when site-specific amino acid differences are modeled but distant outgroups are used to root the tree  [6]. These results indicate that phylogenomic datasets convey signal for both hypotheses and that discriminating between Poriferaand Ctenophora-sister requires distinguishing between phylogenetic signal and noise causing systematic errors  [43].
[10]  attempted to minimize the negative effect of compositional heterogeneity by excluding compositionally heterogeneous proteins when generating WhelanD20. However, our PPAs indicate that WhelanD20 is still too heterogeneous to allow their preferred modeling strategy (a PF-scheme) to adequately describe the data (Tables  1  and S1 ). More broadly, our results demonstrate that PFschemes (strongly advocated for by  [10, 28, 29, 38] ) are much worse than CAT-GTR+G and are not always better than unpartitioned modeling strategies at capturing the heterogeneity of the considered datasets (Tables  1  and S1 ). There are two, not mutually exclusive, explanations for these observations. The first is that PF-schemes cannot capture within-gene replacementpattern heterogeneity  [56]. The second is that protein-specific amino acid replacement patterns across WhelanD20 and Chang could not be captured by the empirical substitution matrices considered in the PartitionFinder analyses of  [10] S&R-6 (APST) (DENG) (QKR) (MIVL) (WC) (FYH) KGB-6 (AGPS) (DENQHKRT) (MIL) (W) (FY) (CV) Amino acid binning schemes used in Dayhoff-6, S&R-6, and KGB-6 analyses.
These binning schemes were originally presented in Figure  84  of  [37]  (Dayhoff-6), Figure  1  (left panel) of  [14]  (S&R-6), and Figure  6A  of  [15]  (KGB-6). The rationale used to define these recoding strategies is reported in STAR Methods. There are some commonalities between the three binning schemes, reflecting shared biochemical properties of the amino acids in each bin. (see STAR Methods for a list). Indeed, the results of our PartitionFinder analyses (Table  S3 ) show that the optimal PFschemes identified LG as the amino acid replacement matrix fitting $98% of the sites in both datasets best. That is, using PF-schemes to analyze these datasets is not very different from using a single LG matrix. Furthermore, our results demonstrate that, to further improve the adequacy with which compositional heterogeneity is described, CAT-GTR+G analyses of recoded datasets are most effective.
Our results show a correlation between overall model inadequacy, as measured by our PPA tests, and phylogenetic outcomes. WAG+G, LG+G, GTR+G (with or without recoding), and PF-schemes describe the data worse than CAT-GTR+G and invariably found support for Ctenophora-sister. Ctenophora-sister sometimes emerges in CAT-GTR+G analyses of amino acid datasets, too. However, support for this topology under CAT-GTR+G is more prominent when distant outgroups, which represent a natural source of long branches  [43] , are included in the analyses. Branch length is the product of time and substitution rate, and even slowly evolving outgroups can be long branched if they diverged much earlier than the ingroup, potentially exacerbating long-branch attraction artifacts  [18, 57]. Our PPA tests indicate that although CAT-GTR+G describes Chang and WhelanD20 better than other models, overall model adequacy can still be improved using data recoding, and Porifera-sister was favored under all recoding strategies.
The relationships at the root of the animal tree depend on model adequacy, with Ctenophora-sister emerging more prominently when the data are modeled less adequately and Porifera-sister being better supported when the data are more adequately modeled (Figure  1 ). As phylogenetic methods are less likely to recover artifactual topologies when the models of evolution more adequately describe the data  [16] [17] [18] [19] [20] , we conclude that Porifera-sister better represents the phylogenetic signal in the data. Shen et al. [11]  investigated the distribution of phylogenetic signal in a dataset from Whelan et al. [10]  and concluded that the signal for Porifera-sister is limited to a few ''outlier genes. '' However, their results were obtained contrasting the likelihood of Porifera-and Ctenophora-sister under LG+G, a model that poorly describes the datasets of  [10].
Indeed, CAT-GTR+G analyses (with and without Dayhoff-6 recoding) of a dataset of  [10]  from which  [11]  removed ''outlier genes'' still finds support for Porifera-sister (PP = 0. 98 and PP = 0. 99, respectively; Figures  S3I  and S3J ). This result rejects the conclusions of  [11]  that signal for Porifera-sister is limited to ''outlier genes'' and indicates that their approach is model dependent: arguments about model adequacy should be considered when implementing it. Data recoding reduced the impact of heterogeneity on our phylogenetic analyses (see also  [7] ), and this lent support to Porifera-sister. Notably, this result emerged independently of the outgroups included. Recently, Whelan et al. [38]  expanded ctenophoran taxon sampling and found support for Ctenophora-sister using CAT-GTR+G and close outgroups.
Based on our conclusions about the relationship between model adequacy and alternative hypotheses of animal relationships, we expected that the dataset of  [38]  should support Poriferasister once recoded. Indeed, a CAT-GTR+G analysis of the Dayhoff-6 recoded version of this dataset reached excellent convergence and found strong support for Porifera-sister (PP = 1; Figure  S3K ), indicating that the analyses of Whelan et al. [38] , are affected by the same problems that we highlighted in the case of the amino acid datasets of WhelanD20 and Chang. Ultimately, however, analyses should be conducted under models explicitly accounting for heterogeneity across both sites and lineages (STAR Methods). Such models have been proposed  [30]  but are still computationally too demanding to be applied to phylogenomic datasets.
Simion et al. [7]  also showed that the exclusion of sites for which site-specific replacement patterns change over time (heteropecillous sites  [58] ) uncovers support for Coelenterata (i. e. , Ctenophora sister to Cnidaria)  [39, 41]. This result suggests that future investigations of early animal relationships should also account for the potentially misleading effect of heteropecilly. Phylogenetic analyses of early animal relationships using models that do not describe site-specific amino acid differences (WAG+G, LG+G, GTR+G, and optimal PF-schemes) invariably support Ctenophora-sister, whereas analyses using models that can accommodate such preferences (e. g. , CAT-GTR+G) predominantely favor Porifera-sister. This model-dependent outcome has been interpreted as reflecting a fundamental lack of robustness  [59] , and it has been suggested that the relationships at the root of the animal tree might be impossible to reconstruct based on current amino acid datasets  [2, 4].
This quantity is then averaged across all sites. (3) The variance across sites of the empirical frequency of each amino-acid, averaged over all amino-acids (PPA-VAR). PPA for compositional heterogeneity test how well lineage-specific compositional preferences are accounted for by the model. We used as a primary measure maximal heterogeneity across taxa (PPA-MAX  [30] ). We also investigated whether using mean squared heterogeneity across taxa (PPA-MEAN  [30] ) could have led to different conclusions. Both PPA-MAX and PPA-MEAN use the deviation between specific taxa and the dataset average, measured as the sum over the 20 amino-acids of the absolute differences between the taxon-specific and global empirical frequencies. The maximal heterogeneity across taxa is the maximum deviation over all taxa, while the mean squared heterogeneity across taxa is the sum of the squared deviations (calculated across all the taxa in the dataset).
All PPA analyses used a minimum of 100 replicates. All PPA performed under WAG+G, LG+G, GTR+G and CAT-GTR+G used the latest release of Phylobayes MPI  [61] , which includes PPA-CONV and PPA-VAR (see below for software access). To perform PPA analyses under the optimal PF-schemes we developed a new version of Phylobayes MPI (see below for software access). For the PF analyses, amino acid frequencies and the Gamma distribution used to model across-site rate-heterogeneity were independently inferred from the data for each partition. Results of PPA analyses were quantified using Z-scores. When computing Z-scores it is assumed that the null distribution is approximately normal, with the Z-score being analogous to a standard normal quantile. Results of PPA can also be quantified using a P value, which is the fraction of simulated replicates with a test statistic less than the observed statistic.
Phylogenetic analyses Phylogenetic analyses of Chang and WhelanD20-Opistho were performed under WAG+G, LG+G, GTR+G (with and without Dayhoff-6, S&R6 and KGB-6 recoding), and CAT-GTR+G (with and without Dayhoff-6, S&R6 and KGB-6 recoding). GTR+G and CAT-GTR+G analyses were also performed (with and without Dayhoff-6, S&R6 and KGB-6 recoding) for WhelanD20-Holo and WhelanD20-Choano. Note that 6-state recoded datasets cannot be analyzed using WAG+G, LG+G or a PF-scheme as they require a 6-state GTR matrix, while WAG, LG and the other universal, predefined, matrices used by PartitionFinder are 20-state matrices. All LG+G, WAG+G, GTR+G and CAT-GTR+G analyses were performed using Phylobayes MPI v1. 7a  [61]. For each analysis two chains were run and convergence was assessed using the bpcomp and tracecomp tools in PhyloBayes.
The number of samples to be discarded as burnin was independently assessed for each analysis by visually checking traces of likelihood and parameter values. Chang was analyzed under its optimal PF-scheme using RAxML version 8. 2. 9  [63] , with support estimated using the rapid bootstrap option (100 replicates). WhelanD20 was not analyzed under its optimal PF-scheme because  [10]  already showed that this dataset supports Ctenophora-sister when the PF-scheme is used. Results of all our analyses including trace files and output of all the tests performed to investigate convergence are available (see below for data access). Testing the distribution of the signal in favor of Porifera-sister While the debate on the relationships at the root of the metazoan tree has been dominated by arguments about model choice  [6, 28, 29, 56] , a recent study  [11]  argued that signal for Porifera-sister is limited to a few outlier genes.
The study of Shen et al. [11]  used datasets from various studies, including dataset D16 from  [10] , which is very similar to WhelanD20, as the latter was obtained in  [10]  by removing genes of significant compositional heterogeneity from D16. To test their results, Shen et al. [11]  generated datasets that excluded the few genes that they identified as ''outliers,'' analyzed these datasets under LG+G, and found support for Ctenophora-sister. As datasets without ''outlier genes'' should not include signal in favor of Porifera-sister, we tested their hypothesis by analyzing one of their purportedly outlier-free, and hence Porifera-sister signal-free, datasets under CAT-GTR+G (with and without Dayhoff recoding). To run this test we selected WhelanD16-OutlierExcluded-Choano -i. e. , WhelanD16 with only Choanoflagellata as outgroups and excluding all outlier genes identified by  [11].
If support for Porifera-sister emerges from the analysis of this dataset (which should be free of any signal supporting this topology), Shen et al. 's  [11]  hypothesis would be rejected, and the emergence of Ctenophora-sister in their analyses a consequence of the use of the inadequate (see Table  1  and S1)  LG+G model. For each analysis, two chains were run in Phylobayes MPI version 1. 7a  [61]  and convergence was assessed using the bpcomp and tracecomp tools in PhyloBayes. The number of samples to be discarded as burnin was independently assessed for each analysis by visually checking traces of likelihood and parameter values. Results of all our analyses including tracefiles are available (see below for data access). Testing the effect of incrementing the number of ctenophoran lineages on the phylogenetic stability of recoded datasets Whelan et al.
[38]  have increased the number of ctenophoran species compared to those they used in  [10]. Ctenophores are all long branched (see Figure  2  in  [38] ), and adding more long branched taxa to a dataset decreases the ability of all available models to adequately describe the data (see Results and Discussion for details). Given our key finding, that relationships at the root of the animal tree depend on the relative adequacy with which alternative modeling strategies describe the data, it is not unsurprising that  [38]  recovered Ctenophora-sister using CAT-GTR+G and closely related outgroups; similarly to the case of  [12]. The dataset of  [38]  provided us with a case to further test the conclusions of our study: that support for alternative hypotheses of animal relationships depends on the ability of the model used in the analyses to describe the data.
If our conclusions hold and Ctenophora-sister is an artifact emerging when the data are inadequately modeled, the analysis of a recoded version of the dataset of  [38]  should support Poriferasister. We tested this hypothesis performing an analysis of a Dayhoff-6 recoded version of the dataset used by Whelan et al. [38]  to recover their Figure  2  (i. e. , their Whelan2017_Metazoa_Choano_RCFV_strict dataset). For this analysis, two chains were run in Phylobayes MPI version 1. 7a  [61]  and convergence was assessed using the bpcomp and tracecomp tools in PhyloBayes. The number of samples to be discarded as burnin was assessed by visually checking traces of likelihood and parameter values. Results of all our analyses including tracefiles are available (see below for data access).
A discussion of alternative evolutionary models The simplest substitution models are site-and lineage-homogeneous, representing the amino acid replacement process using the same model across sites and lineages  [23, 64]. Examples of homogeneous amino acid models include those using empirical matrices that have been derived from large collections of protein families like the JTT  [62] , WAG  [21]  and LG  [60]  matrices, and dataset-specific GTR (General Time Reversible) matrices that are directly inferred from the alignment under study. Empirical matrices are expected to fit most alignments relatively well. However, a dataset-specific GTR matrix is expected to fit the alignment from which it has been inferred best (and better than empirical matrices)  [65, 66]. A GTR matrix, if used in isolation, can only describe a site-, lineage-, rate-, composition-, and replacement-homogeneous process.
In addition to site-specific amino-acid preferences, lineage-specific compositional heterogeneity has been shown to constitute another important confounding factor in phylogenetics (e. g. ,  [7, 13-15, 31-36, 55] ). Yet, none of the above discussed models are designed to account for this type of evolutionary heterogeneity. Models that can explicitly take into consideration across-taxon compositional heterogeneity, such as the Breakpoint model  [70] , the Node Discrete Compositional Heterogeneity (NDCH) model  [55]  and the Correspondence and Likelihood Analysis (COaLA) model  [71]  have been developed. However, current implementations of these models are computationally too demanding to allow their application to large phylogenomic datasets. As an alternative to using a model that captures lineage-specific heterogeneity, one can transform the dataset so that it displays less heterogeneity, leading to weaker violations of the assumptions of lineage-homogeneous models.
DATA AND SOFTWARE AVAILABILITY Results of all our analyses including tracefiles are available at https://bitbucket. org/bzxdp/feuda_et_al_2017. Phylobayes MPI which includes PPA-CONV and PPA-VAR is available at https://github. com/bayesiancook/pbmpi. Partitioned Phylobayes MPI, to perform PPA analyses under the optimal PF-schemes is available at https://github. com/ bayesiancook/pbmpi/tree/partition.
ACKNOWLEDGMENTS We would like to thank the  University of Bristol ACRC  ( Advanced Computing Research Center ) and  Leibniz-Rechenzentrum der Bayerischen Akademie der Wissenschaften  for providing access to supercomputing infrastructure. This work was supported by a  NERC grant  ( NE/P013643/1 ) and a  Templeton Foundation  grant ( ID 60579 ) to D. P. H. P. acknowledges the  French Laboratory of Excellence project ''TULIP''  ( ANR-10-LABX-41  and  ANR-11-IDEX-0002-02 ). N. L. acknowledges  French National Research Agency  grant no. ANR-10-BINF-01-01  '' Ancestrome. ''G. W. acknowledges funding by  LMU Munich's Institutional Strategy LMUexcellent  within the framework of the  German Excellence Initiative and German Research Foundation (DFG)  grant no. Wo896/15-1. The authors would like to thank the reviewers for their helpful suggestions.
STAR+METHODS Detailed methods are provided in the online version of this paper and include the following:  WhelanD20-Opistho (A) and Chang (B). Numbers at nodes are Bayesian posterior probabilities (PPs). Solid circles indicate nodes with PP z 1. Support for the node identifying Porifera-sister is provided for each of the three recoding strategies that we tested. Top: Dayhoff-6. Middle: S&R-6. Bottom: KGB-6. See Figures  S1  and S4  for relationships within the clades. The results in Figure  1  were further corroborated by the analyses of datasets from  [11, 38]  (Figures  S3I, S3J,  and S3K ). Animal silhouettes are from http://www. phylopic. org, except for the figure of the calcarean sponge, which is from  [39]. See the supplemental figures for convergence statistics.
Dataset selection We considered two phylogenomic datasets that strongly bear on our understanding of relationships at the root of the animal tree. The first is the dataset of  [12]  -hereafter referred to as Chang, which scores 77 taxa and 51,940 amino acid positions. The second is a dataset from  [10]  that had not been reassessed in  [6]. The dataset we selected from  [10]  was dataset D20, their least compositionally heterogeneous dataset, which apparently explicitly excludes proteins of significant compositional heterogeneity (see  [10] ). This dataset scores 70 taxa and 42,542 amino acid positions. Following  [6] , dataset D20 (hereafter WhelanD20) was subjected to analyses that used different subsets of outgroups. We name ''WhelanD20-Opistho'' the version of WhelanD20 that includes all the original outgroups (Fungi, Choanoflagellata and several other holozoans); ''WhelanD20-Holo'' the dataset that excludes fungal outgroups; and ''WhelanD20-Choano'' the dataset that excludes all the outgroups but Choanoflagellata.
PartitionFinder analyses PartitionFinder version 1. 1. 1 Mac and PartitionFinder version 2. 0. 0  [24]  were used following the protocol of  [10]  to select, for WhelanD20-Opistho and Chang, the optimal sets of partitions and their associated sets of best-fitting, universal, predefined general time reversible matrices. It is important to note that we followed the protocol of  [10]  in order to be able to precisely test whether PF-schemes previously used to investigate early animal relationships can adequately describe the considered datasets. Following  [10] , not all models that have been developed for amino acid datasets, and that could be considered by PartitionFinder (e. g. , LG4X  [60] ), are included in the set of compared models. The complete list of models considered in the protocol of  [10]  only includes: LG, WAG, mtREV, Dayhoff, DCMut, JTT, VT, Blosum62, CpREV, RtREV, MtMam, MtArt, HIVb, HIVw (see PartitionFinder manual and references therein for details about these models).
Testing model adequacy Posterior Predictive Analyses were performed on WhelanD20-Opistho and Chang to test whether WAG+G, LG+G, GTR+G, the optimal PF-schemes, or CAT-GTR+G can adequately describe site-specific amino acid preferences and lineage-specific compositional heterogeneity for these datasets. These models were selected because they had previously been used in key studies of early animal evolution that reached contradictory conclusions. For example, GTR+G was used by  [8] , WAG+G was used by  [9] , PFschemes were used by  [10] , CAT-GTR+G was used by  [6]  and LG+G was used by  [11]. Other important studies  [7, 12]  used CAT+G, which has not been considered here, as CAT-GTR+G is used as a representative of the CAT-based models more broadly (see below: ''A discussion of alternative evolutionary models'' for a comparison of these models).
Conclusions We have described a new system of sized types whose key features are an abstract index language, and higher-rank index polymorphism. This allows for some more flexibility compared to similar type systems from the literature. The introduced type system is proved to enjoy a form of type soundness. We have also implemented sized type inference in a prototype tool, called HoSA. Noteworthy, inference is fully automated, i. e. , does not require any form of manual size annotations. One key motivation behind this work is achieving a form of modular complexity analysis without sacrificing its expressive power. This is achieved by the adoption of a type system, which is modular and composable by definition. Noteworthy, modularity carries to some extend through to constraint solving. The SCCs in the generated constraint problem are in correspondence with the SCC of the call-graph in the input program, and are analysed independently.