Although numerous examples of GP exist in plants and animals, applications to polyploid organisms are still scarce, partly due to limited genome resources and the complexity of this system. Deep learning (DL) techniques comprise a heterogeneous collection of machine learning algorithms that have excelled at many prediction tasks. A potential advantage of DL for GP over standard linear model methods is that DL can potentially take into account all genetic interactions, including dominance and epistasis, which are expected to be of special relevance in most polyploids. In this study, we evaluated the predictive accuracy of linear and DL techniques in two important small fruits or berries: strawberry and blueberry. The two datasets contained a total of 1,358 allopolyploid strawberry (2n=8x=112) and 1,802 autopolyploid blueberry (2n=4x=48) individuals, genotyped for 9,908 and 73,045 single nucleotide polymorphism (SNP) markers, respectively, and phenotyped for five agronomic traits each. DL depends on numerous parameters that influence performance and optimizing hyperparameter values can be a critical step. Here we show that interactions between hyperparameter combinations should be expected and that the number of convolutional filters and regularization in the first layers can have an important effect on model performance. In terms of genomic prediction, we did not find an advantage of DL over linear model methods, except when the epistasis component was important. Linear Bayesian models were better than convolutional neural networks for the full additive architecture, whereas the opposite was observed under strong epistasis. However, by using a parameterization capable of taking into account these non-linear effects, Bayesian linear models can match or exceed the predictive accuracy of DL. A semiautomatic implementation of the DL pipeline is available at  All DL esources . Althougesources , more efGenomic selection (GS) is the breeding strategy consisting in predicting complex traits using genomic-wide genetic markers. The idea was developed to overcome the limitations of marker-assisted selection (MAS) and was formalized by p (number of features) small n (sample size) paradigm  there is a portion of the intra-locus allele interaction  that is passed to the progeny (particularly full-sibs), and ii) the definition of non-additive effects is more complex than in diploids as higher order interaction exist . Thus, mFragaria x ananassa) and blueberries (Vaccinium corymbosum) are considered two of the most important soft fruit commodities. Considered a rich source of vitamins and minerals, fruit markets for both species have experienced a global increase in production and consumption over the past decade (https://www.nass.usda.gov/Publications/Todays_Reports/reports/ncit0619.pdf). To ensure that production and fruit quality meet the global demand, genetic improvement, and particularly GP, has a role to play in maximizing the utility, diversity, and yield of resources. In this sense, previous experimental assessments performed in blueberry (Fragaria x ananassa) is an allo-octoploid hybrid plant originated by cross between two wild octoploid species F. chiloensis and F.virginiana  segregation. In contrast, blueberry is a tetraploid organism originated from genome duplication within the same species. In autopolyploids, the meiotic pairing is mainly described by forming either random bivalents or multivalent during the division. Since the molecular mechanisms in auto and allopolyploids are quite complex, comparing new algorithms is a relevant issue to the prospect of GP in these and other polyploid species.Among the polyploid species, strawberries , for a series of traits with presumably contrasting genetic architecture. A summary of both experimental data sets is presented in the Regarding strawberry, we used 1,233 unique genotypes which correspond to five advanced selection trials  from the strawberry breeding program at the University of Florida, Institute of Food and Agricultural Sciences (USA). These advanced trials were planted in five consecutive seasons and were given an even code starting with season 2013–2014 as T2 and ending with season 2018–2019 as T10. The number of lines in each trial was 217, 240, 236, 272, and 393 for T2, T4, T6, T8, and T10, respectively. Some of the genotypes in the last trial T10 were already tested in earlier trials, making the total number of observations sum up to 1,358 . Plants were genotyped with the Axiom IStraw90 SNP array . After qThe blueberry population used in this study encompasses one cycle of the University of Florida blueberry breeding program's recurrent selection and comprised 1,802 lines from 117 full-sib families. The population was originated from 146 parents that presented superior phenotypic performance (cultivars and advanced stage of breeding). Individuals were evaluated for five yield and fruit quality-related traits: firmness, fruit size, weight, yield, and picking scar, which were collected during two production seasons. Phenotypes were pre-corrected for fixed year effects, as detailed in The GP methods evaluated in this study were assessed by true validation, which was obtained by splitting data into a training and a validation dataset. In the strawberry dataset, we considered that predicting performance of the last stage lines (T10) is the most interest application for the industry and therefore the population was divided between training  and validation (T10) subsets with 965 and 393 lines, respectively. In the case of blueberry data, all samples were equally important and 30% of randomly sampled genotypes were assigned to the validation set. Predictive ability (PA) was defined as the correlation between observed and predicted phenotypes in the validation set; prediction was computed from parameters estimated in the training dataset only.Potential genetic structure was assessed by principal component analysis (PCA) using all genotypes. Since genetic architecture may have an impact on GP performance and on the optimum GP model , additivy represents the adjusted phenotype, μ1 is the intercept, A and D were obtained using AGHmatrix package  considered is the Hadamard product of additive effects, i.e. ith mean posterior estimates of σ2 as in Equation 1. We used both training and validation datasets combined in this stage, since this is purely a descriptive analysis and the values obtained are not employed in the later prediction stages.where the vector  package  for both.e. A⊙A   Posterio.e. A⊙A  . The addWe compared the prediction performance of DL models with two well-established linear methods: Bayesian Lasso BL,  and Bayeμ1 is the overall mean, g=Xβ, X is the genotypes' matrix and β is a vector of marker effects. In BRR, prior distributions of marker effects β are β in BL have a Laplace distribution, i.e., where  package  with a Gg (Equation 2) in a general way, i.e., g =Ω ω  where Ω  is a matrix of dummy variables that indicates the number of copies of the reference allele ranging from 0 to the ploidy level  and Reinforcement Learning (RL). s(t) is a function that can be defined as an “integral transform”  in Equation (3) must be a kernel. Assuming that the kernel is represented by k, the convolution is the transformation of f (input data in the DL context) into s(t). The operation is just the weighted sum of an infinite number of copies f shifting over the kernel. The discrete version of Equation 3 follows naturally as:where one of the functions  is applied after each convolution to produce the output layer. Finally, “pooling” layers reduces dimension and achieves a smoother representation, summarizing adjacent neurons by computing their maximum or mean.Since DL depends on numerous parameters that influence performance, optimizing hyperparameter can be a critical unresolved step, which relies heavily on heuristics. Hence, it is surprising that many DL applications in GP have not paid enough attention to this problem . SeveralTalos output is the accuracy for each hyperparameter combination; we then used hyperparameter values as independent variables and accuracy as target variable to run a random forest algorithm, which allowed us to compute the hyperparameter value importance, measured as the decrease in Gini's coefficient when adding the given hyperparameter. This hyperparameter importance can be then used as guide to improve interpretability. The R package randomForest  was emplhttps://github.com/lauzingaretti/deepGS/.The DL algorithms used in this study were implemented in Keras  and TensAdditive: 200 randomly chosen SNPs were considered as causal loci. No dominance was simulated. Total individual genetic value was the sum of effects across loci.Epistatic: 100 epistatic pairs of SNPs were randomly sampled. Epistasis was multiplicative by pairs, i.e., the genotype was the product of individual genotypes in each pair. Total genetic value was the sum of effects across pairs of loci.Mixed: 80 individual additive SNPs and 60 epistatic SNP pairs were randomly chosen. Total genetic value was the sum of effects across pairs of loci and individual additive loci.We studied the impact of genetic architecture on prediction performance by simulation using the actual observed strawberry genotypes, assessing predictive performance with the same T10 strawberry genotypes (and genotypic data) as in the real experiment, except that phenotypic responses were simulated. Three contrasting genetic architectures were considered:Allele substitution effects were sampled from a gamma distribution Γ. The trait was obtained adding the genetic value to an environmental normal residual. Environmental variance was chosen such that broad-sense heritability was set to 0.50. For each genetic architecture, five replicates were run. We compared BRR, BRR-GM, RKHS, and DL. DL architectures were specifically optimized to each phenotypic trait, since no universal architecture is able to make accurate predictions for all cases.No clear population structure was observed, neither in the strawberry nor in the blueberry datasets , suggestHeritability estimates in strawberry are slightly different from those obtained in the same material by CNN hyperparameters were optimized for each strawberry trait separately. In The final sets of hyperparameters for strawberry and blueberry phenotypes are indicated in As for the blueberry phenotypic traits, we found no differences between GP methods BL and BRR (average PA = 0.42), whereas CNNs were somewhat underperforming (average PA = 0.40). The most remarkable result in blueberry is that CNN performance was barely affected by the ploidy level employed to build the genetic relationship matrix. In fact, the “diploid” option seemed more robust than the tetraploid one, except in fruit yield, the only trait that was measured using a rating scale.f) from input (X) to output (y) variables  and traits . RecentlPrevious studies  have notAn underlying goal of our work was to investigate the effect of accounting for allele dosage in a GP context. Owing to the complex nature of polyploids, genotype calling can be a challenge and “diploidization”, i.e., considering a polyploid genome as diploid is usual . Some stIt is traditionally thought that DL requires extremely large datasets to be trained effectively . HoweverA drawback of DL models is that they lack biological or process interpretability and neither feature selection nor feature importance are obvious. In our opinion, GP algorithms are not too useful for providing biological insight into the genetic basis of phenotypes; genome wide association studies should be more appropriate. In all, our results suggest that DL performance improve as non-additive variance increases, a situation is usually encountered in fitness related traits.DL hyperparameter tuning is critical and difficult, especially in terms of computational resources. Our analysis allows us to provide some generic recommendations though. First, we and others  concludeOverall, there is no evidence that applying DL in GP applications necessarily improves the prediction accuracy upon that of classical linear model methods. PA depends on the trait and is affected by many factors; no one algorithm is uniformly better for all species and traits . PA usuavwhitaker@ufl.edu); the blueberry dataset can be obtained from P.R. Muñoz (p.munoz@ufl.edu) or Dryad Digital Repository (accession number doi: 10.5061/dryad.kd4jq6h) and https://gsajournals.figshare.com/articles/Supplemental_Material_for_de_Bem_Oliveira_et_al_2019/7728365.The strawberry dataset analyzed for this study can be obtained from V.M. Whitaker , by the MINECO grant AGL2016-78709-R to MP-E and from the EU through the BFU2016-77236-P  and the “Centro de Excelencia Severo Ochoa 2016-2019” award SEV-2015-0533. VW and LO were supported by the US Department of Agriculture/National Institute of Food and Agriculture Specialty Crop Research Initiative (SCRI) project ‘RosBREED: Combining disease resistance with horticultural quality in new rosaceous cultivars' under Award Number 2014-51181-22378.The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.


Pelophylax esculentus males (hybrids of P. ridibundus and P. lessonae) live with P. ridibundus. We identified a system where the hybrids commonly produce two types of clonal gametes (hybrid amphispermy). The haploid lessonae genome is clonally inherited from generation to generation and assures the maintenance of hybrids through a process, in which lessonae sperm fertilize P. ridibundus eggs. The haploid ridibundus genome in hybrids received from P. ridibundus a generation ago, is perpetuated as clonal ridibundus sperm and used to fertilize P. ridibundus eggs, yielding female P. ridibundus progeny. These results imply animal reproduction in which hybridogenetic taxa are not only sexual parasites, but also participate in the formation of a sexual taxon in a remarkable way. This occurs through a process by which sexual gametes are being captured, converted to clones, and returned to sexual populations in one generation.Hybridogenesis is a reproductive tool for sexual parasitism. Hybridogenetic hybrids use gametes from their sexual host for their own reproduction, but sexual species gain no benefit from such matings as their genome is later eliminated. Here, we examine the presence of sexual parasitism in water frogs through crossing experiments and genome-wide data. We specifically focus on the famous Central-European populations where  This mode of reproduction is usually found in hybrids arising from historical or ongoing hybridization events. Together with two other modes of unusual reproduction, parthenogenesis and gynogenesis5, it has the potential to clonally perpetuate the parental genomes6, and maintain an F1 hybrid genotype. While parthenogenesis and gynogenesis are fully clonal modes of reproduction, hybridogenesis is referred to as hemiclonal reproduction. It involves the selective transmission of one of the parental genomes, while the other is excluded from the germline and renewed by mating with the sexual host species7. As a consequence, hybridogenetic organisms are often considered sexual parasites. They use gametes from their sexual hosts for their own reproduction, while their sexual hosts gain no benefit from matings with hybridogenetic individuals, as their genome will be eliminated during gametogenesis and, therefore, will not contribute to future generations7.Hybridogenesis is an extraordinary mode of reproduction, comprising components from both asexual and sexual reproduction9 while the transmitted genome is clonal; it fuses with the recombinant gamete resulting in the generation of a new hybrid11. The elimination process is assumed to maintain the integrity of parental genomes, which is the main requirement for hemiclonal inheritance12.The eliminated genome is usually received as a recombinant gamete from the previous generation of the sexual host14, cases of clonal reproduction resulting only in hybrid males are rare10. Assumed reasons for their rarity are lower viability and a high level of sterility16. Existing evolutionary models predict that such systems would be unstable and go extinct19. However, some examples of stable all-male hybrid systems have been reported22, which raises the question of how these systems remain evolutionarily stable.While clonally reproducing females use several reproductive strategies to form new single-sex generations of female progenyPelophylax esculentus complex is the best-studied model of hybridogenesis. It involves two parental species, the pool frog P. lessonae (LL) and the marsh frog P. ridibundus (RR), and their hybrid the edible frog P. esculentus (RL). Pelophylax esculentus can be produced as diploid or triploid individuals of both sexes, they can also vary in their patterns of gamete production and the population assemblage. In the so-called L-E system, P. esculentus is usually represented by both sexes, clonally transmitting the ridibundus genome to gametes, and re-incorporating the P. lessonae genome via mating with sympatric P. lessonae individuals23. In some cases, matings between two hybrids resulting in P. ridibundus progeny also occur26, however, mostly inviable or infertile, presumably due to the accumulation of deleterious mutations in clonal genomes31. For the functional survival of the so-called R-E system, hybrids pass on the lessonae genome and parasitize sympatric P. ridibundus individuals to re-incorporate the ridibundus genome each generation. Interestingly, typical diploid R-E populations contain only male P. esculentus transmitting mostly the lessonae genome with cases of the ridibundus genome as well35. The inheritance pattern in water frogs is consistent with an XX-XY sex determination system, and males are heterogametic23.The European P. esculentus hybrids, which are exclusively males competing with sexual P. ridibundus males for matings with P. ridibundus females. Combining laboratory crossing experiments and genetic analysis of produced gametes and resulting offspring, we show that the maternal genomes are not systematically excluded from the germline. Instead, both maternal and paternal genomes are transmitted from one generation to another, maternal into sexual daughters and paternal into hybrid sons. These results indicate that such an unorthodox reproductive system is more common in water frogs than previously thought. We discuss the putative impact of amphispermic hybridogenesis on population dynamics, as well as the molecular mechanisms of this reproductive strategy of sexual parasites.We report a mechanism of animal reproduction in general, and hybridogenesis in particular, with significant consequences to the reproduction of a host sexual species. In this system, hybrid males sexually parasitize a sexual host and capture the maternal genome for one generation. The captured genomes are then returned in a clonal form back to the population of the sexual host via the production of sexual daughters. Our study system includes hybridogenetic P. esculentus males and P. ridibundus females , Principal coordinate analysis (PCoA), fineRADstucture heatmap, and STRUCTURE ancestry bar plots. We denoted sexual genomes of lessonae genomes of 160 RL sons. A total of 193 MLGs were found within ridibundus genomes of 160 RL sons and 60 RR daughters. Inspecting the allelic variability by filtering out variation caused by missing data showed RL sons shared the same MLG. This indicates the clonal inheritance of the L genome (further [L]) in all but one RL son (60-2013 JUV19), which inherited the R-specific allele at locus Re1Caga10 from the father  were inherited clonally as well  for axis 1 and 10.26%/13.40% (GenAlEx/radiator) for axis 2 of genetic variation  based on microsatellite profiles of 220 phased offspring. A total of 11 MLGs were found within ion Fig. . One cluP. esculentus fathers , PC 2  and PC 3 captured the variation among the sexual R and clonal [R]/[L] genomes and were optimal for differentiating family-wise R-sexual and [R]-clonal genomes. We were able to calculate linkage maps using conventional software for males and females   with an internal size standard .DNA was extracted using the NucleoSpin DNA extraction kit . A total of 246 individuals  were genotyped at 15 microsatellite loci after Christiansen and Reyer49 with modifications by Brelsford et al.50. Briefly, template DNA for each sample at equimolar concentrations (approx. 15 ng/μl) was digested using a combination of MspI and SbfI restriction enzymes. P1 and P2 adapters containing barcodes were then ligated‚ and these ligated fragments were amplified in four PCR replicates of 20 cycles, lowering the risk of polymerase-induced errors. The products were then pooled, and fragments of 350–500 bp were selected from 2% agarose gels, of which 135–139 bp belonged to the pair of Illumina primers, adaptors, and barcodes. The pool of 96 individual libraries was sequenced with a single-end run of 100 cycles (for 150 bp) on a HiSeq 2500 Illumina instrument at the Genomic Technologies Facility at the University of Lausanne, Switzerland.The detection of SNPs was based on the double digest restriction-site associated DNA (ddRADseq) approach. For comparative analysis of high-density SNP data, we chose 81 individuals from five families , which differed in the genome clonally passed down by the parents. We scanned genomes for SNPs data of both parental genomes. ddRADseq libraries were prepared following the protocol of Peterson et al.51. Hybrid genotypes were converted to separate lessonae- and ridibundus-specific alleles, following Doležálková-Kaštánková et al.35. To distinguish clonally inherited and recombined genomes in backcrossed B1 individuals, we ran the analysis to separate multilocus genotypes (MLGs) using GenAlEx v. 6. 4152. To reveal potential gene flow between L and R genomes, we analyzed allele frequencies, heterozygosity, and polymorphism using GenAlEx v. 6. 4152. We performed PCoA in GenAlEx v. 6. 4152 and, in parallel, PCA in radiator v 0.0.18 R package53 with data standardization, which was based on the total variation of microsatellite allele frequencies. MLGs with more than 65% of missing data were removed from the analysis.The microsatellite alleles were scored with GeneMapper v. 3. 7 . Raw genotypes of sexual species were checked for genotyping errors and null alleles with Micro-Checker v. 2.2.354 process_radtags (–renz_1 sbfI –renz_2 mspI -E phred33 -r -c -q -i fastq –adapter_1 ACACTCTTTCCCTACACGACGCTCTTCCGATCT –adapter_2 GTGACTGGAGTTCAGACGTGTGCTCTTCCGATCT –adapter_mm 2). To clip the adaptor sequence fragments, if present, we applied a custom script  was prepared for mapping purposes with a custom awk script, connecting series of 450 sequential scaffolds (> 190 bp) into an artificial sequence spaced with the fragments of 300 N’s. Such an artificially stitched reference genome contained 4,605 scaffolds that were used for further mapping. The reads were mapped on a draft genome assembly of P. lessonae with bowtie2 , the mapped data were filtered with samtools v 0.1.19 for the mapping quality > 20. Further, we constructed a common catalog in Stacks v 1.42 using the ref_map.pl pipeline. Genotypes were outputted with the Stacks module populations treating each family separately by specifying a family-specific “population map “ file and keeping parameters –p = 2 and –r = 0.95, having aimed to retain only the loci that were present in both parents and > 95% of the offspring in a given family. Each population catalog was whitelisted for the biallelic loci only. Ultimately, the five whitelists were merged into one , and the population's module was rerun on the initial catalog for all five families together.ddRADseq reads were demultiplexed with the STACKS v 1.42 modulehttps://github.com/DanJeffries/Hybridogen_paper.So far, known scripts phase parent-progeny duos and trios on data coming from model Mendelian species like humans and imply imputation, i.e., the probability of the mistake is calculated for a missing allele in a genotype, and, if it does not follow the Mendelian pattern, it is considered as an artifact of the data. We designed a script that separates non-Mendelian hybrid profiles to haploid ones according to species-specificity of alleles or SNP sites in parental genomes. Using the 15,676 SNP data set for five families, the R genomes were separated from L genomes using custom python scripts. Loci were phased based on their segregation patterns among mother, father, and offspring, separately for each family. For example, an R specific allele will be heterozygous in the father, homozygous in the mother, and heterozygous in all offspring of an R[L] x RR cross. The [L] allele, in this case, is the one which is present only in the father and the offspring, but not in the mother. Similar tests were performed and tailored specifically for all cross types. Such tests can be sensitive to data artifacts. For example, null alleles in one parent, so that the progeny would be heterozygous , while appearing as a homozygous. These artifacts were checked for in our scripts, and where appropriate, these loci were removed. For a detailed explanation of this phasing approach and all code used, see 55 with K = 2 was made by running a chain of 30,000 with burn-in 10,000 under the admixture model with correlated allele frequencies of microsatellites. The alpha parameter was set to 0.5 following recommendations of Wang56, who showed the importance of setting the initial value of this prior being equal to 1/K for improved accuracy while analyzing unbalanced populations . STRUCTURE analysis of the phased dataset was run with the same settings.STRUCTURE analysis (v 2.3.4)radiator53, and adegenet57 R packages. To explore relationships between phased haplotypes, we constructed SNP dendrogram (additive branch length) with the R package SNPRelate v1.16.058 using a set of 2219 SNPs, i.e., without filtering on presence/absence of loci to account for null allele variation between the samples , 59 and MSTmap61. In order to assess coancestry and genomic variation among phased R-sexual and [R]-/[L]-clonal haplotypes, we used the fineRADstructure pipeline62 of the fineSTRUCTURE Markov chain Monte Carlo (MCMC) clustering algorithm63. This method takes into account linkage information between loci and generates a coancestry matrix accounting for the closest neighboring haplotype, the data undergoes MCMC sampling, and ultimately closely related genetic clusters are inferred. Phased data in the form of a VCF file were converted into fineRADstructure input with a genomic converter module of radiator v 0.0.18 R package53. Since our dataset was mapped on a draft genome assembly that does not reflect physical linkage to a large extent, we corrected for linkage disequilibrium with the sampleLD R-script following the recommendations of fineRADstructure developers.To investigate the traces of possible recombination within the germline of the RL males, we reconstructed the sex-wise linkage maps using diploid genotypes of the parents and progeny. In sexual females, which recombine, loci were expected to distribute along with the linkage groups; however, in hemiclonal males, the distance between markers was expected to be 0 cM. We reconstructed linkage maps using programs Lep-Map3All experimental protocols were approved by the Federal Commission for Animal Experiments (FCAE) and by the Standing committee on animal health under the Federal Food Safety and Veterinary Office FSVO, Switzerland, under permit nos 119/2013: TV 5113 and TH 103. We declare that all other manipulations with animals were performed in accordance with relevant guidelines and regulations. The study was carried out in compliance with the ARRIVE guidelines.Supplementary Information.


These results generally do not hold for non-zero Measures of linkage disequilibrium (LD) play a key role in a wide range of applications from disease association to demographic history estimation. The true population LD cannot be measured directly and instead can only be inferred from genetic samples, which are unavoidably subject to measurement error. Previous studies of r2 to all levels of LD, and for both phased and unphased data. First, we provide new formulae for the effect of finite sample size on the observed r2 values. Second, we find a new empirical formula for the variance of the observed r2, equals to 2E[r2](1 − E[r2])/n, where n is the diploid sample size. Third, we propose a new routine, Constrained ML, a likelihood-based method to directly estimate haplotype frequencies and r2 from diploid genotypes under Hardy-Weinberg Equilibrium. While serving the same purpose as the pre-existing Expectation-Maximisation algorithm, the new routine can have better convergence and is simpler to use. A new likelihood-ratio test is also introduced to test for the absence of a particular haplotype. Extensive simulations are run to support these findings.This work generalises the estimation of r2 information will become more accurate as a result.Most inferences on LD will benefit from our new findings, from point and interval estimation to hypothesis testing. Genetic analyses utilising  Linkage Disequilibrium (LD) was first defined about 100 years ago as the non-random association of alleles at different loci –7, and ar2 is a popular measure of LD alongside D or D’ 2 [χ2 statistic and is only correct if the underlying  2E[r2]2 , 29. ThiAB/ab or Ab/aB. Under HWE the expected frequencies for each genotype f1, f2, …, f9 are shown in Table n1, n2, …, n9 are the counts for each genotype. It is easy to understate the challenges in maximising this log-likelihood. Direct maximisation of Eq. The term LD is often called the “gametic phase disequilibrium”, which specifically refers the correlation of alleles at the haplotype level. For diploid individuals, however, direct inference of haplotype frequencies is usually impossible when gametic phase is not known. The reason is that we are unable to tell the exact haplotype configuration for double heterozygotes, as they can be pab as the four haplotype frequencies must add to one. The feasible region of the remaining three haplotype frequencies looks like a tetrahedron with vertices , , , and . Our method, called Constrained ML, transforms the haplotype frequencies before maximising the log-likelihood function. For this two-allele two-locus scenario, the transformation is as follows:Here we propose a new approach to directly maximise Eq. u, v, w} becomes a unit cube. The log-likelihood is then maximised with respect to the new coordinates in this “box-like” constraint, where a number of common optimisation routines become available. The MLE for the haplotype frequencies can be obtained by back transforming the The feasible region of the new coordinates {n6 = n8 = n9 = 0 then we cannot rule out the possibility of pab = 0, even if the estimated frequency is not. The same principle applies to the other haplotypes. While CubeX provides an additional solution (denoted as the γ solution) should this happen, it gives little indication of which set of estimated haplotype frequency we should accept. Under this scenario, we propose to perform a likelihood-ratio test (LRT), to test whether a particular haplotype has zero frequency as a precaution. This use of an LRT will be demonstrated in the analysis of a real dataset.Sometimes, we need to decide whether a haplotype actually exists in the population. For example, if n and (1 − 1/2n), which agree to our derivation for r2 under finite sample size n and (1 − 1/n) respectively. In short, both phased and unphased simulations followed closely our theoretical expectations of observed r2 due to the effect of finite sampling.The plots of mentclass2pt{minimn. Under the same condition the variances were smaller for phased than unphased data. The variance generally increases with their expectations for E[r2] < 0.5, and then come down afterwards. As predicted, the variance goes down to 0 when E[r2] approaches 1.Figures kth iteration when ∣lk + 1)( − lk)( ∣ / max(|lk + 1) was smaller than the chosen relative tolerance. The plots of relative log-likelihood against relative tolerance are found in Fig. −2 Constrained ML was inaccurate. Between 10−3 and 10−6 Constrained ML converged better than the EM algorithm, and the two methods performed equally well for 10−7 and smaller. The IF index in Fig. −6 and beyond). The IF for Constrained ML was also more predictable and stable, while there was greater variability for the EM algorithm.Our final set of simulations compared the convergence between Constrained ML and the EM algorithm. For both methods, the maximisation terminated at the APOE  = 0.5 and then come down for larger values. Empirically speaking, the variances go like 2E[r2](1 − E[r2])/n for most r2. In addition, this formula helps predict the gain in precision by phasing the data or by increasing the sample size.We pointed out earlier that most existing claims about the variance of pABpab + pAbpaB = 0 in any intermediate E-step, the computation halts as division by zero is not permitted. The method is also known to be sensitive to initial conditions, and often to converge to a local rather than the global maximum [APOE dataset, with reasonable sample size and often extreme haplotype counts, illustrates the use of Constrained ML and the associated LRT in real applications. The EM-based MIDAS, which provides one estimate a time, got the least correct cases. Although CubeX apparently gave more correct haplotype count estimates, there were 5 ambiguous cases with two solutions. For the 5 loci pairs that potentially have only 3 haplotypes instead of 4, LRT correctly identified the answer in 4 cases, but marginally rejected the correct answer for the loci pair 1–9 at 5% α level . We should also point out estimation errors were rare but unavoidable, and this is exactly why phased data is preferred. Nonetheless, LRT provides a valuable metric to help decide which set of answer we should accept.This work proposes a new routine, Constrained ML, to estimate haplotype frequencies from genotypes under HWE. In theory, Constrained ML, EM, and CubeX all aim to maximise the same Hill 1974 log-likelihood function and hence should be identical. In reality they may produce inconsistent results because of the different ways of maximisation. CubeX estimates the haplotype frequencies by solving the cubic equation for the two-locus two-allele case. It may return two sets of answers which are both real and biologically feasible, and this is particularly common when the sample size is small, or when the loci depart from HWE . Another maximum . With our2 without assuming HWE, but they are beyond the scope of this work. Burrows’ Δ measures the so-called composite linkage disequilibrium from non-gametic frequencies, which takes the departure from HWE into account. One can further break down the nine genotypes into eight parameters to include the single-locus disequilibria and higher-order disequilibria [There exist some other methods, such as the Burrows’ method , 7, to euilibria . On the r2 to all levels of LD, and for both phased and unphased data. New formulae were provided to correct for finite sample size during r2 point estimation. We approximated the empirical variance of r2 based on computer simulations. Lastly, a new framework called Constrained ML was suggested to directly estimate haplotype frequencies from diploid genotypic data under HWE. Most inferences utilising LD information will benefit from our new findings.This work generalised the estimation of r2 estimates is the same as described by Eqs. Dirichlet distribution, which was used to calculate the underlying Simulations were run to verify whether the effect of finite sample size on Dirichlet, 1, 1, 1Another set of simulations was run to explore the empirical variance of IF index [Dirichlet distribution, which were then used to sample the genotypes with a known sample size. Two haplotypes were randomly paired up to form a genotype. All initially fixed/extinct loci were discarded and resampled. Then the log-likelihood function (Eq. −2 and 10−9.The final set of simulations studied the convergence of Constrained ML and the EM algorithm against different stopping criterion and sample sizes. We measured convergence by two metrics, the relative log-likelihood , and theIF index . For eaction Eq.  was maxiAdditional file 1. Complete results from the analysis of APOE dataset.Additional file 2. Generalisation of Constrained ML to multiallelic loci.


In Mendelian randomization (MR) analysis, variants that exert horizontal pleiotropy are typically treated as a nuisance. However, they could be valuable in identifying alternative pathways to the traits under investigation. Here, we develop MR-TRYX, a framework that exploits horizontal pleiotropy to discover putative risk factors for disease. We begin by detecting outliers in a single exposure–outcome MR analysis, hypothesising they are due to horizontal pleiotropy. We search across hundreds of complete GWAS summary datasets to systematically identify other (candidate) traits that associate with the outliers. We develop a multi-trait pleiotropy model of the heterogeneity in the exposure–outcome analysis due to pathways through candidate traits. Through detailed investigation of several causal relationships, many pleiotropic pathways are uncovered with already established causal effects, validating the approach, but also alternative putative causal pathways. Adjustment for pleiotropic pathways reduces the heterogeneity across the analyses. In Mendelian randomization (MR) studies, one typically selects SNPs as instrumental variables that do not directly affect the outcome to avoid violation of MR assumptions. Here, Cho et al. present a framework, MR-TRYX, that leverages knowledge of such outliers of horizontal pleiotropy to identify putative causal relationships between exposure and outcome. It generally uses genetic instruments for an exposure, obtained from genome-wide association studies (GWAS). If the instruments are valid, in that they are unconfounded and influence the outcome only through the exposure , then they will each provide an independent, unbiased estimate of the causal effect of the exposure on the outcome3. Meta-analysing these estimates can provide a more precise estimate of the effect of the exposure on the outcome5. If, however, some of the instruments are invalid, particularly because they additionally influence the outcome through pathways that bypass the exposure 3, then the effect estimate is liable to be biased. To date, MR method development has viewed horizontal pleiotropy as a nuisance that needs to be factored out of the analysis9. Departing from this viewpoint, here we exploit horizontal pleiotropy as an opportunity to identify alternative traits that putatively influence the outcome. We also explore how this knowledge can improve the original exposure–outcome estimates.Mendelian randomisation (MR) is now widely used to infer the causal influence of one trait (the exposure) on another (the outcome)5. This means that causal inference between two traits can be made even if they have never been measured together in the same sample of individuals. Complete GWAS summary results have now been collected from thousands of complex trait and common diseases10, meaning that one can search the database for candidate traits that might be influenced by SNPs exhibiting possible pleiotropic effects (outliers). In turn, the causal influence of each of those candidate traits on the outcome can be estimated using MR by identifying their instruments . Should any of these candidate traits putatively influence the outcome then this goes some way towards explaining the horizontal pleiotropic effect that was exhibited by the outlier SNP in the initial exposure–outcome analyses.A crucial feature of MR is that it can be performed using only GWAS summary data, where the effect estimate can be obtained solely from the association results of the instrumental single-nucleotide polymorphisms (SNPs) on the exposure and on the outcome11, identifying SNPs with large influences as outliers. Steiger filtering removes those SNPs that do not explain substantially more of the variance in the exposure trait than in the outcome, attempting to guard against using SNPs as instruments that are likely to be associated with the outcome through a pathway other than the exposure12. Finally, meta-analysis tools can be used to evaluate if a particular SNP contributes disproportionately to the heterogeneity between the estimates obtained from the set of instruments, and this has been adapted recently to detect outliers in MR analysis15. A potential limitation of heterogeneity-based outlier removal is that this practice could constitute a form of cherry picking16. While outlier removal can certainly improve power by reducing noise in estimation, it could also potentially induce higher type 1 error rates, which we go on to explore through simulations.Several methods exist for identifying outliers in MR, each likely to be sensitive to different patterns of horizontal pleiotropy. Cook’s distance can be used to measure the influence of a particular SNP on the combined estimate from all SNPs17. This suggests that many SNPs used as instruments are likely to associate with other traits, which in turn might associate with the original outcome of interest—hence giving rise to heterogeneity. As such we have an opportunity to identify previously unreported pathways by making use of outlying instruments in an MR analysis. Equipped with automated MR analysis software10, outlier detection methods and a database of complete GWAS summary datasets, we develop MR-TRYX . This framework is designed to identify putative causal factors when performing a simple exposure–outcome analysis.Recent large-scale MR scans have indicated that horizontal pleiotropy is widespread based on systematic analysis of heterogeneityIn this paper, we describe how MR-TRYX can be implemented in MR analyses and how to interpret its results. A wide range of simulations is performed to show how knowledge of horizontal pleiotropic pathways can be used to improve the power and reliability of the original exposure–outcome association analysis. Our simulations also show that outlier removal methods can induce bias or increase type 1 error rates, but adjustment for detected pleiotropic pathway can improve estimates by reducing heterogeneity without sacrificing study power. We apply MR-TRYX to four exemplar analyses to demonstrate its potential utility, showing that horizontal pleiotropic pathways can be used to discover putative causal factors for an outcome of interest.Figure We performed a wide range of simulations Fig.  to evaluIt is an obvious conceptual disadvantage in these simulations for IVW and outlier removal, which use only the exposure and outcome data, when compared against MVMR and MR-TRYX which draw on information from other sources. However, we note that the MR-TRYX adjustment approach depends on detecting candidate traits that explain the pleiotropic effect and if the relevant candidate traits are not available, there is no adjustment and the method becomes identical to random effects IVW which generally performs better than outlier removal. We also note that if we use association with candidate traits to determine whether or not to remove an outlier, then improvements can be made over simple outlier removal. What we observe here is intuitive because the potential drawback of outlier removal is that the outliers could be the only valid instruments, or false discovery rates increase due to overly precise confidence intervals. Thus, adding an extra barrier to the removal of outliers can mitigate these problems.19. Here, MVMR performs worse than other methods when the candidate trait is a mediator, as MVMR estimates the direct effect of x on y adjusting for the entirety of x's signal on y. Adjusting for outliers escapes this problem to some extent because it only adjusts some proportion of the instruments for x that are most likely to be pleiotropic, allowing some signal of x on y to persist due to the unadjusted variants.Multivariable MR targets a different estimand than univariable MR—it is estimating the direct effect rather than the total effect of the exposure on the outcome. This strategy performs generally well across the range of simulations except in the case when the candidate trait is a mediator of the x–y association in which case there is a strongly attenuated direct effect. The problem here is that it is hard for MVMR to distinguish between a model where the exposure’s influence on the outcome is mediated by a candidate trait , vs. where the exposure’s apparent effect on the outcome is simply due to pleiotropy through the candidate trait To examine the performance of MR-TRYX analysis, we tested four independent exposure–outcome hypotheses: (i) systolic blood pressure (SBP) and coronary heart disease (CHD); (ii) urate and CHD; (iii) sleep duration and schizophrenia; and (iv) education level (years of schooling) and body mass index (BMI). For each analysis we: (a) obtain MR estimates of the exposure–outcome causal relationship and detect outlier instruments; (b) identify putative causal influences (candidate traits) on the outcome trait based on their associations with outlier variants Table ; (c) adjQ = 682.7 on 157 SNPs, p = 5.74 × 10−67), the estimates from MR-Egger, weighted median and weighted mode methods were consistent (Table Q statistics. We identified 69 candidate traits that were associated with these outliers (p < 5 × 10−8). We manually removed redundant traits and traits that are similar to the exposure and the outcome (e.g. hypertension). Among the remaining candidate traits, 15 were putatively causal for CHD .Example 1: Systolic blood pressure and coronary heart disease: Blood pressure is a well-established risk factor for CHD. Random effects IVW estimates indicated that higher SBP is causally associated with higher risk of CHD . While there was substantial heterogeneity in this estimate . The effect estimate remained consistent with the original estimate, as did the IVW estimates when removing all outliers, or just outliers known to associate with candidate traits that associated with the outcome , while there was a large intercept in the MR-Egger analysis  with a much-attenuated causal effect estimate (Table p < 5 × 10−8). Among those outliers, rs653178 and rs642803 were associated with 14 traits that had conditionally independent influences on the outcome  estimate of the influence of higher urate levels on CHD risk , but there was substantial heterogeneity when all SNPs were used . Six outlier instruments were detected, which associated with 46 candidate traits (p < 5 × 10−8). Among those outliers, the SNPs rs7764984 (near HIST1H2BJ) and rs13107325 (near SLC39A8) were associated with three traits that putatively influenced the outcome: self-reported coeliac disease, body composition (impedance of leg) and memory function  when removing all six outliers and by 46% (Q = 147.7) when adjusting for the two SNP effects that had putative pleiotropic pathways. Both methods of outlier removal and adjustment provide similar estimates in terms of direction, while the magnitude of estimates differed. After removing outliers, MR-Egger causal estimates were substantially larger  than those from the method using all variants. IVW causal estimates from the adjustment method were virtually identical with the original estimates, with narrower CIs . While all methods indicate that sleep duration is unlikely to be a major causal risk factor for schizophrenia, pursuing outliers in the analysis provided putative indications that coeliac disease and memory function may be risk factors for schizophrenia . Three outliers  were identified as contributors to heterogeneity, and they showed associations (p < 5 × 10−8) with 48 candidate traits. Among those candidate traits, two were associated with BMI  on the scatter plot moved away from the fitted line after adjusting for the pleiotropic pathway, indicating that if this outlier is due to a pleiotropic pathway we have estimated its indirect effect inaccurately or partially .We next re-estimated the influence of years of schooling on BMI by accounting for outliers. Adjusting the outliers for candidate trait pathways such as alcohol intake and usual walking pace reduced heterogeneity by 15% and had a small reduction in the confidence intervals while the point estimate remained consistent  detecting instruments that exhibit horizontal pleiotropy; (ii) identifying the candidate traits on the alternative pathways from the variant to the outcome; and (iii) adequately estimating the effects of the candidate traits on the outcome. Each of these components present difficult problems, but they are all modular and build upon existing methods and resources, and the MR-TRYX framework will naturally improve as those methods and resources themselves improve. We will now discuss the consequences of underperformance of each of these components on the TRYX analysis.29). The adjustment approach depends upon those pathways being identified, which leaves it in a similar predicament to observational associations in that we cannot easily prove that all biasing pathways have been included in the model. The MR-TRYX approach falls within this category also, but we note that as fewer and fewer of the biasing pathways are identified and available to the adjustment model, the adjusted estimate will tend towards the IVW random effects estimate, which our simulations indicate can have good performance compared to, e.g., outlier removal methods. So, while clearly not a panacea for causal inference analysis, it is a valuable method within the MR toolkit, and its efficacy has been demonstrated. There is also an important contrast between outlier adjustment and multivariable MR in that the formulation of the latter is to estimate the direct effect of each exposure conditional on the others, whereas the former is to obtain an unbiased estimate of the total effect. MVMR may fail to distinguish between a pleiotropic model where the exposure (X) does not influence the outcome (Y) but has instruments that associate with another trait (A) which does influence Y, vs. a causal model in which trait A mediates the causal effect of X on Y. In both situations X will be deemed to be non-causal, despite it being indirectly causal in the latter case. This issue is discussed in detail elsewhere19. Here, outlier adjustment improves on the matter because MVMR will nullify all instruments for the exposure after adjusting for the mediator, leading to the exposure being dropped. When only the outlier variants are adjusted, the risk of erroneously removing the entire exposure signal is replaced by the lesser risk of incorrectly nullifying the effects of the outliers only. This will introduce heterogeneity and slight bias but is unlikely to remove the exposure’s entire signal.First it is important to notice that a major motivation for development of MR is that observational associations are often deemed unreliable because it is impossible to prove that there is no residual or unmeasured confounding biasing the effect estimate. But somewhat ironically, we find ourselves in a situation now where horizontal pleiotropy poses a similar challenge, in that proving that it is either absent or perfectly balanced is impossible. While several ‘pleiotropy-robust’ methods attempt to model out pleiotropic effects by assuming a particular model of genetic architecture, another strategy is to adjust for horizontal pleiotropy, by including in the same model the genetic effects on one or more traits that are hypothesised to mediate the horizontal pleiotropic pathways , or most commonly the extent to which an SNP contributes to heterogeneity 15. The philosophy of the latter two approaches is that proving horizontal pleiotropy is impossible, but that it should lead to outliers9. While a useful approximation, these approaches have two main limitations. First, determining whether a SNP is an outlier depends on the use of arbitrary thresholds, and this entails a trade-off between specificity and sensitivity. Second, if most variants are pleiotropic, then it is possible that the outlier SNPs are the valid instruments. Such a scenario can arise for complex traits such as gene expression or protein levels that have a few large effects and many small effects. For example, for C-reactive protein (CRP) levels, the SNP in the CRP gene region is likely the only valid instrument in some analyses30. In this context, bias due to horizontal pleiotropy cannot be avoided by selection of instruments since this approach may generate more bias31. This is supported by our simulation which demonstrates that in the presence of extensive pleiotropy removing outliers increased FDR and bias.The classification of an outlier in MR analysis can be based on the statistical estimates of how a SNP being included as an instrument is due to being reverse causal (Steiger filtering)32. In MR-TRYX, candidate traits are treated as endogenous variables to account for the effect of the traits on the original association. Moreover, our method is applicable in the two-sample context, whereas the previous method requires individual level data. The problem of outlier detection which remains in MR-TRYX could be sidestepped by applying the adjustment approach to all SNPs irrespective of their contributions to heterogeneity.MR-TRYX should, in principle, avoid the problem of outlier removal because instead of removing outliers in their entirety, it attempts to eliminate the component of the SNP–outcome effect that is due to horizontal pleiotropy. Hence, we avoid implicitly cherry picking from among the SNPs to be used in the analysis, and if we have low sensitivity (i.e. a more relaxed threshold for outlier detection) it does not mean that there will be an unnecessary loss of power in the overall analysis. Previous work has adjusted for the effect of pleiotropic phenotypes, but they treated pleiotropic phenotypes as exogenous variables that are not associated with the causal pathways of interest33. It is also important to note that in estimating the adjusted effect, the SNP–outcome standard error is liable to increase, which is one avenue through which heterogeneity is reduced as its outlying contribution will be down-weighted in the subsequent IVW analysis. We used radial MR plots to illustrate this explicitly in Fig. Upon identification of potentially pleiotropic SNPs, MR-TRYX can only account for these if the pathways through which pleiotropy is acting can be identified. Detecting the pathways depends on the density and coverage of the human phenome available for the analysis. We use the MR-Base database of GWAS summary results, which comprises several hundred independent traits (we selected 605 traits from UK Biobank and 342 other complex traits and diseases obtained from previous GWA studies). While being the largest available resource, it is certainly not covering the whole human phenome. Therefore, even if a pleiotropic variant is detected correctly, it may not be possible to adjust it away if the phenotype associated with the variant cannot be identified. In the empirical analyses, often fewer than half of the candidate traits were inferred to be associated with the outcome. Yet, as we illustrated, MR-TRYX allows for an informative analysis that could routinely be applied in MR analyses. Broadening phenotype coverage is an on-going pursuit that will continually improve MR-TRYX analysis34. Multivariable MR is adept at establishing conditionally independent exposures but the reason that some exposures have attenuated effects in comparison to their total effects could be because (a) their total effects were biased by pleiotropy or (b) they are mediated by the exposures that are included in the model. Interpretations of (a) and (b) are very different, because in the case of mediation the exposure is a causal factor for the outcome. Second, we were primarily using the multivariable approach for practical purposes to avoid having multiple highly related exposures taken forward to the adjustment step (e.g. multiple different measures of body composition such as body weight and BMI). This approach worked effectively, although a problem remains unsolved in automating the removal of traits that are similar to the outcome. For example, if a trait similar to the outcome CHD associates with an outlier and is included in the multivariable analysis of multiple exposures against CHD, then all the other putative exposures will be dropped from the model. In the analyses presented we manually removed traits that came up as candidate pleiotropic pathways but were, in fact, synonymous with or closely related to the outcome. Third, we note that heterogeneity does not necessarily arise only because of pleiotropy, for example the non-collapsibility of odds ratios will introduce heterogeneity automatically which cannot be adjusted away through the TRYX approach. Many other mechanisms exist that can lead to bias in MR, as has been described in detail elsewhere. Fourth, SNPs can appear to be outliers not through being pleiotropic, but through other mechanisms, such as population stratification , canalisation 35, or the influence on phenotype being changeable across the life course36. Fifth, since MR-TRYX uses the resource from MR-Base, it is recommended that the user acknowledge the limitation and restriction of MR-Base10. For example, the population should be the same for the exposure (or the candidate traits) and the outcome traits to avoid mis-estimation of the magnitude of the association. Also, sample overlap should be recognised between the GWAS studies for the SNP–exposure and SNP–outcome association to prevent effect estimates being biased37. Users should consider modifying their analyses when the limitations indicated above are avoidable. Sixth, in the case of a binary outcome, there may be parametric restrictions on the conditional causal odds ratio in our multivariable MR model where the exposure effect is linear in the exposure on the log odds ratio scale38. However, the two-stage estimator with a logistic second-stage model still yields a valid test of the causal null hypothesis38. Finally, it is necessary for the effects through the identified pleiotropic pathways to be accurately estimated. This is a recursive problem—MR-TRYX adjusts the SNP–outcome effects based on the pleiotropic effect through the outlier SNP, but it does this by introducing more SNPs into the analysis that instrument the candidate traits. These new SNPs may themselves exhibit pleiotropic effects that could lead to bias in the estimates of the candidate traits on the outcome, requiring a second round of TRYX-style candidate trait searches, and so on. In the example of education level and BMI, adjustment for the pleiotropic pathway failed to substantially reduce the degree of heterogeneity. Further developments could involve recursively analysing alternative pathways. For example, Steiger filtering could be applied at all stages of MR estimation to attempt to automatically remove reverse causal instruments or those that arise due to confounding pleiotropy17.MR-TRYX is an automated framework, and this comes with several limitations in addition to those discussed already. First, our LASSO extension to multivariable MR is used to automate the selection of exposures that will be used for adjustment. A shrinkage step of LASSO may increase the SNP–exposure effect heterogeneity, which is necessary to assess the power of multivariable MR39. An alternative mechanism that could give rise to this association is that the effect of pain on lower CHD risk is mediated through the use of medications such as aspirin that have known protective effects on CHD.In this study, we demonstrated the use of MR-TRYX through four examples of identifying putative pathways. In the first empirical example (SBP on CHD), we illustrated the validity of MR-TRYX to detect the traits that possibly influence the disease outcome. Apart from SBP, MR-TRYX also detected well-established risk factors for CHD including adiposity, cholesterol levels, and standing height. An interesting finding from this example is that headache-related traits (e.g. experience of pain due to headache and self-reported status of ibuprofen intake) were identified as candidate traits, which may influence the original association. In support of the putative finding for self-reported ibuprofen use associating with CHD, we also found that pain experienced in the last month (headache) and self-reported migraine were associated with lower risk of CHD . A previous study reported shared genetic risk between headache (migraine) and CHD, suggesting a potential role of migraine in vascular mechanisms40, which can be reversed by levothyroxine therapy41. In the education–BMI example, we showed that increased alcohol intake and slower usual walking pace may influence obesity. These identified traits have been reported as possible risk factors for higher BMI and obesity43. Additionally, the example of sleep duration and risk of schizophrenia suggested coeliac disease and body composition as putative risk factors for schizophrenia. A number of observational studies suggested that schizophrenia is linked with body composition44 and coeliac disease45. MR of binary exposures is often difficult to interpret because the instrument effects are on liability to disease, not the presence or absence of the disease. Hence, the association between coeliac disease and schizophrenia may be better interpreted as an indication of shared disease aetiology. Nevertheless, this is a valuable finding since the causal effect of those putative risk factors on risk of schizophrenia has not been investigated using an MR approach. Therefore, our example illustrates how outliers can be used to identify alternative pathways, opening the door for hypothesis-free MR approaches and a network-based approach to disease.The example of urate and CHD demonstrated the benefit of the adjustment method showing that the noise due to pleiotropy was substantially reduced after correcting for the effect of candidate traits. The presence of hypothyroidism and self-reported levothyroxine sodium intake status were identified as putative risk factors for risk of CHD, which is consistent with previous clinical trials: thyroid dysfunction is associated with overall coronary riskIn conclusion, we have introduced a framework to deal with the bias from horizontal pleiotropy, and to identify putative risk factors for outcomes in a more directed manner than typical hypothesis-free analyses, by exploiting outliers. Heterogeneity is widespread across MR analyses and so we are tapping into a potential new reservoir of information for understanding the aetiology of disease. The strategy is a departure from previous ones dealing with pleiotropy—enlarging the problem by searching across all traits for a better understanding of a specific exposure–outcome hypothesis can be fruitful.46. In order to estimate heterogeneity accurately, it is important to appropriately weight the contribution of each SNP to the overall estimate. We used the approach implemented in the RadialMR R package  to detect outliers. Full details are provided elsewhere15, but briefly, we used the so-called ‘modified 2nd order weighting’ approach to estimate total Cochran’s Q statistic as a measure of heterogeneity, as well as the individual contributions of each SNP, qi15. This has been shown to be comparable to the simulation-based approach in MR-PRESSO, providing a well-calibrated test statistic for outlier status whilst being computationally more efficient47. The probability of a SNP being an outlier is calculated based on qi being chi-square distributed with one degree of freedom. For demonstration purposes we adopted a p value threshold that was Bonferroni corrected for the number of SNPs tested in analysis (p < 0.05/number of SNPs). We are not, however, suggesting that this arbitrary threshold will necessarily be optimal for identifying outliers, and users can apply other approaches or thresholds through the MR-TRYX software.Several outlier detection methods now exist that are based on the contribution of each SNP to overall heterogeneity in an IVW meta-analysisp value threshold  are regarded as potential risk factors for the outcome and defined as candidate traits. Each candidate trait is tested for its influence on the original exposure (X) and outcome (Y) traits  uncontaminated by shared genetic effects between P and x , candidate trait (gp), and outcome (gy). Finally, we estimate the causal influence of P on y conditioning on x by regressing (gy) ~ (gx) + (gp) weighted by the inverse of the variance of the (gy) estimates. The whole process is automated within the TwoSampleMR R package which connects to the MR-Base database.Suppose we have d x Fig. , we perfgy) ~ (gx) + (gpi)+…+(gpp) and use cross-validation to obtain the shrinkage parameter that minimises the mean squared error. We retain only the candidate traits that are putatively associated with the outcome and have non-zero effects after shrinkage. Then we apply remaining traits in a multivariable model with x against the outcome, as described above34. We perform the LASSO step because many traits in the MR-Base database have considerable overlap and redundancy, and the statistical power of multivariable analysis depends on the heterogeneity between the genetic effects on the exposure variables34. Using LASSO therefore automates the removal of redundant traits  that are conditionally independent of x and jointly estimated using all remaining P traits by combining them in a multivariable analysis on the outcome y. A detailed discussion of dealing with multiple candidate traits per outlier SNP is presented in Supplementary Note In the case of an outlier SNP associating with many candidate traits we first apply a modified form of multivariable MR, involving LASSO regression of  = (gx)(xy), where (gx) is the SNP effect on x and (xy) is the causal effect of x on y. Any substantive difference between (gy) and (gx)(xy) could be due to an additional influence on y arising from the SNP’s effect through an alternative pathway.An illustration of how outliers arise in MR analyses is shown in Fig. P, which in turn influences the outcome (or the exposure and the outcome), then the SNP’s influence on the exposure and the outcome will be a combination of its direct effects through x and indirect effects through P34. If we have estimates of how the candidate trait influences the outcome, then we can adjust the original SNP–outcome estimate to the effect that it would have exhibited had it not been influencing the candidate trait. In other words, we can obtain an adjusted SNP–outcome effect conditional on the ‘candidate-trait–exposure’ and ‘candidate-trait–outcome’ effects. If the SNP influences P independent candidate traits (as selected from the LASSO step), then the expected effect of the SNP on y isIf a SNP influences a ‘candidate trait’, p1,…, pp isHence, the effect of the SNP on the outcome adjusted for alternative pathways gy), (gp), and (py) are obtained based on their respective standard errors and the standard deviation of the resultant xy) due to SNP g is obtained through the Wald ratio.We use parametric bootstraps to estimate the standard error of the P is a redundant trait for y, for example if the outcome is coronary heart disease, the outliers might detect traits such as ‘medication for heart disease’ as a potential candidate trait. It would make no sense to attempt to adjust the SNP–outcome association for a trait that is essentially the same as the outcome, it would just nullify the association. We have not yet developed an automated method to remove such traits, but we recommend manually checking any traits that are selected for automated outlier adjustment.Occasionally it might be possible that a candidate trait x on y under different circumstances. The simulations are principally designed to evaluate the potential value of adjusting outliers for putative explanatory pathways. Other aspects of the MR-TRYX framework, for example, dealing with redundant traits in the GWAS database are dealt with separately (Supplementary Note x (Gx), and x either has no direct influence on y, or has a direct effect of 0.1 on y. For all simulations, we used 10,000 individuals, and repeated each circumstance 1000 times. We summarised each scenario in two ways: (a) We estimated the proportion of simulations that gave a biased estimate of the causal effect of x on y (bxy). For each simulation we calculated the probability of the effect estimate being substantially different from the true simulated effect based on whether the true effect fell outside the 95% confidence interval of the estimate. Then for the set of 1000 simulations, we calculated the proportion of estimates that were ‘unbiased’. (b) We summarised the power and FDR by estimating the area under the receiver operator curve, characterising the sensitivity and specificity of each method at determining whether the true causal effect estimate was null or non-null. Each simulation is conducted by first simulating data to satisfy the parameters described below. We then search for instruments for x across all simulated genetic variants and retain those that are significant after Bonferroni correction, and applying the summary data-based methods based on the genetic associations for the instruments on x and y. All genetic variants are simulated to be Hardy Weinberg equilibrium with an allele frequency of 0.5.IVW effect estimates are liable to be biased when at least some of the instrumenting SNPs exhibit horizontal pleiotropy, and those SNPs tend to contribute disproportionately towards the heterogeneity in the effect estimate. We conducted simulations to evaluate how different methods perform at estimating the causal effect of We investigated three scenarios that could give rise to invalid instruments Fig. .x that primarily influence a confounder variable (e.g. u1 that influences both x and y). Therefore, the term ‘confounding pleiotropy’ indicates that the instrument’s horizontal pleiotropic effect arises because it primarily influences a confounder of x and y. See Fig. u1 has a set of independent genetic influences, Gu1, which may be detected as instruments for x.In the confounding pleiotropy scenario, there are instruments detected for bgu1,j values are sampled for each SNP mu1 from a normal distribution such that they explain 60% of the variance in u1. The value of bu1x is chosen such that u1 explains 60% of the variance in x and 40% of the variance in y. The values of bgx,j are sampled from a normal distribution for each of mx SNPs such that they explain 20% of the variance in x. The causal effect bxy is set to either 0, or some value such that x explains 10% of the variance in y. Values for eu1,ex, and ey are sampled from normal distributions with mean 0 and variances that are scaled to satisfy the variances of all other parameters described for the model. Different sets of simulations are run with different proportions of invalid instruments by simulating different numbers of genetic variants directly influencing u1 or x:Parameters: x have an independent effect on y that is mediated through some other pathway that does not include x. In these simulations, the pleiotropic influence of each instrument, Gx,i, is mediated by a different trait, ui2,In the case of horizontal pleiotropy, at least some of the instruments for x instruments for x are selected to have pleiotropic effects, such that they influence y each mediated by an independent trait ui2, which itself has its own set of 30 direct genetic influences Gu2,i. The bgu2,i,j values for the genetic effects on ui2, are sampled from a normal distribution such that they explain 20% of the variance in ui2,. Each pleiotropic Gx,i instrument has an influence on ui2, that explains 20% of its variance . The influence of each ui2, on y is such that bu2,i,y is normally distributed with mean 0 and variance 0.4. The outcome y is also influenced by x where the causal effect bxy is set to either 0, or some value such that x explains 10% of the variance in y. Values for eu2,i, ex, and ey are sampled from normal distributions with mean 0 and variances that are scaled to satisfy the variances of all other parameters described for the model.Parameters: Some number x to y, rather than confounding it In these simulations we ask: if we can identify the pathway through which an outlier SNP has a horizontal pleiotropic effect, can adjustment for that pathway improve the original exposure–outcome analysis? We assess the performance of the following methods for each simulation.51 to illustrate how pleiotropic variants can be used to identify other pathways and adjusted to estimate the causal effect of the original exposure on the outcome independent of pleiotropic bias.As applied examples, we chose two robust findings and two controversial findings that are potentially biased due to pleiotropy: (i) systolic blood pressure (SBP) and coronary heart disease (CHD); (ii) urate and CHD; (iii) sleep duration and schizophrenia; and (iv) education level (years of schooling) and body mass index (BMI). Those examples were chosen based on previous findingsr2 < 0.001). We primarily used the two-sample MR IVW method to obtain causal estimates between exposures and outcomes allowing each SNP to have a different mean effect (random effects model). A number of sensitivity analyses were applied to evaluate the consistency of causal effect estimates under different models of pleiotropy among the SNPs, including the MR-Egger6, weighted median, and weighted mode approaches8.Summary statistics (β-coefficients and SEs) for the associations of the SNPs with each exposure were obtained from the publicly available GWAS database (Supplementary Table p < 0.05/the number of SNPs). We searched the MR-Base database to identify the candidate traits that are associated with outliers (p < 5 × 10−8). We then performed multivariable MR analysis to test which candidate trait can explain the heterogeneity in the original exposure–outcome association. To perform multivariable MR, more SNPs that instrument the candidate traits were introduced into the analysis.Outliers were detected among the instruments for each exposure  all SNPs (corresponding to the raw method in our simulation), (b) outliers adjusted, (c) all outlier removed, and (c) candidate outliers removed.https://github.com/MRCIEU/TwoSampleMR) and the MR-TRYX package (https://github.com/explodecomputer/tryx) in R statistical software (ver 3.4.1). Detailed information are provided in Supplementary Note https://github.com/explodecomputer/tryx-analysis.All analyses were conducted with the TwoSampleMR package ( ver 3.4.. DetaileFurther information on research design is available in the Supplementary InformationSupplementary Data 1Supplementary Data 2Peer Review FileReporting SummaryDescription of Additional Supplementary Files