9 Ancestral State Reconstruction II
Previously, we looked at reconstructing the evolutionary history of binary traits, such as the presence or absence of sexual swellings in macaques, and categorical traits such as the modes of burrowing in carnivores. In this chapter, we’ll be applying the same principles to continuous data.
The logic of ancestral state reconstruction applies equally to continuous traits like body size as it does to categorical traits. Here, we’ll be looking at the evolutionary history of whales, dolphins and porpoises (Cetacea).
As always, check that you have set your working directory!
9.1 Data
The data we have here is taken from a study of the evolution of cetacean brain and body size (Montgomery et al. 2013). The reduced version here contains only body mass and the log transformed body mass for 42 species.
9.2 Tree
We also have a tree from the 10ktrees project (Arnold et al. 2010). For more information about this website, see chapter 3.
We need to check the data and tree match up. Get into this habit! It will save you a lot of time and patience.
$tree_not_data
[1] "Balaenoptera_acutorostrata" "Balaenoptera_bonaerensis"
[3] "Balaenoptera_edeni" "Berardius_arnuxii"
[5] "Berardius_bairdii" "Caperea_marginata"
[7] "Cephalorhynchus_eutropia" "Cephalorhynchus_hectori"
[9] "Delphinus_capensis" "Delphinus_tropicalis"
[11] "Eubalaena_australis" "Eubalaena_glacialis"
[13] "Eubalaena_japonica" "Feresa_attenuata"
[15] "Hyperoodon_ampullatus" "Hyperoodon_planifrons"
[17] "Indopacetus_pacificus" "Lagenodelphis_hosei"
[19] "Lagenorhynchus_australis" "Lagenorhynchus_cruciger"
[21] "Lissodelphis_peronii" "Mesoplodon_bidens"
[23] "Mesoplodon_bowdoini" "Mesoplodon_carlhubbsi"
[25] "Mesoplodon_ginkgodens" "Mesoplodon_grayi"
[27] "Mesoplodon_hectori" "Mesoplodon_layardii"
[29] "Mesoplodon_perrini" "Mesoplodon_peruvianus"
[31] "Mesoplodon_stejnegeri" "Orcaella_brevirostris"
[33] "Orcaella_heinsohni" "Peponocephala_electra"
[35] "Phocoena_dioptrica" "Phocoena_sinus"
[37] "Platanista_minor" "Sousa_chinensis"
[39] "Stenella_attenuata" "Stenella_frontalis"
[41] "Tasmacetus_shepherdi" "Tursiops_aduncus"
$data_not_tree
character(0)
Clearly some species need to be dropped from the tree!
whale.tree <- drop.tip(whale.tree,
geiger::name.check(whale.tree, whale.data)$tree_not_data)
geiger::name.check(whale.tree, whale.data)
[1] "OK"
9.3 Ancestral State Reconstructions
Now we’re going to dive in with a reconstruction. We are using phytools for this analysis so we should load the package and create a named data vector (Revell 2012).
The function we need is called fastAnc and it returns the ancestral states in a simple list.
ancstates <- fastAnc(tree = whale.tree, #Our phylogeny
x, #Our data vector
CI = TRUE) #Estimate 95% confidence intervals
ancstates
Ancestral character estimates using fastAnc:
43 44 45 46 47 48 49 50
6.422936 7.205471 7.440591 7.465284 7.456463 7.511707 6.248774 6.097254
51 52 53 54 55 56 57 58
6.044864 6.078069 5.983733 5.962172 5.641527 5.423179 5.255812 5.204571
59 60 61 62 63 64 65 66
5.225028 5.260263 4.960018 4.901903 4.871755 4.888973 5.503471 5.567067
67 68 69 70 71 72 73 74
5.710190 5.130854 4.989830 5.001555 4.960103 4.976035 5.039423 5.403331
75 76 77 78 79 80 81 82
5.850745 4.870560 4.871380 4.883752 5.590679 5.292187 6.267476 5.540614
Lower & upper 95% CIs:
lower upper
43 5.745860 7.100012
44 6.599516 7.811426
45 7.009526 7.871657
46 7.037792 7.892775
47 7.023487 7.889440
48 7.078101 7.945312
49 5.617637 6.879912
50 5.480639 6.713870
51 5.396996 6.692732
52 5.495449 6.660689
53 5.489021 6.478445
54 5.474786 6.449558
55 4.977189 6.305864
56 4.818460 6.027899
57 4.833079 5.678546
58 4.834286 5.574857
59 4.930739 5.519317
60 4.970172 5.550353
61 4.679687 5.240349
62 4.656292 5.147513
63 4.621817 5.121692
64 4.661301 5.116645
65 5.175817 5.831126
66 5.231290 5.902844
67 5.455762 5.964619
68 4.810518 5.451190
69 4.731256 5.248405
70 4.760819 5.242292
71 4.767162 5.153044
72 4.800446 5.151624
73 4.692067 5.386779
74 4.792073 6.014589
75 5.352644 6.348847
76 4.380205 5.360915
77 4.449659 5.293101
78 4.482168 5.285335
79 4.892863 6.288496
80 4.417990 6.166384
81 5.492347 7.042604
82 4.959783 6.121445
To get an idea of what these results show, we should probably plot it. The nodelabels function maps the ancestral states listed in our ancstates object onto the nodes of the tree which are listed in the same order.
plot(whale.tree, cex = .8, label.offset = .01, no.margin = TRUE)
nodelabels(round(ancstates$ace, digits = 2), cex = .67)
As is often the case, there are better ways to plot this information! The function contMap calls fastAnc and then maps the history of the trait onto the tree as a heatmap. This is a much clearer plot.
9.4 BayesTraits
Simply reconstructing the history of a trait can be very interesting. See some papers by Montgomery et al. (2010, 2013) for just a few great examples. However, this methodology is not limited to simply estimating the past.
Most of what we are going to do here could probably be acheived in R either with existing packages or some clever coding. However, the standard package for several analyses has been BayesTraits for some time.
BayesTraits is a command line program, which can make it kind of intimidating. Actually (like R), it’s relatively easy to use but can take some getting used to. Fortunately, Randi Griffin has written an excellent R package btw that can operate the program from within R.
It’s worth noting at this point that btw is not written to run BayesTraits for you so that you don’t have to understand the program. Randi states very clearly that the package is purely for optimising workflow. In other words, this allows you to have all your data, results and code in one place. You still need to understand how to use the program. Fortunately the manual is very detailed.
First up, download BayesTraits version 3 for your operating system.
IMPORTANT! BayesTraits output files will be written into your working directory. They will overwrite any files with the same name so don’t have any files called “data.txt”, “tree.nex” or “inputfile.txt” in this directory unless you are ok with losing them.
Next, we need to install btw. This isn’t a CRAN archived package so we’ll be installing directly from Randi Griffin’s GitHub. Once installed, we can use BayesTraits from within R!
There are some important differences in how R and BayesTraits read data that need to be summarised here.
- The first column of your data must contain species names.
- Species names must match exactly between tree and data (but don’t worry about the order).
- No spaces in species names.
- Discrete characters have to be of class character or factor (between 0-9) and NOT integer.
- Ambiguous discrete characters can be represented as 01.
- Missing data must be represented as - rather than NA.
BayesTraits consists of modules (see manual for details) that are numbered and can be called up for different analyses.
If you can’t get R and Bayestraits to play nicely together, you may want to consider using Bayestraits directly from the command prompt (Windows) or terminal (Mac). It’s fairly straightforward once you’ve got the hang of it so be patient. Alternatively, all of this can be done with R packages like ape (Paradis and Schliep 2018), geiger (Harmon et al. 2008) and phytools (Revell 2012) amongst others.
9.5 Modelling Evolution
If we have some data about traits across a group of animals and an associated tree, we may want to ask about how that trait has evolved over time. For this we can compare the trait to models of evolutionary change.
9.5.1 Brownian Motion
Brownian motion (BM) is the most commonly used model of evolutionary change. In some ways, it can represent a kind of null model but do not confuse this! It doesn’t mean nothing is changing or that evolution is not taking place.
Brownian motion assumes three things;
- Evolutionary changes in a trait are randomly distributed around a mean of 0.
- Evolutionary changes in a trait are independent of previous changes and changes on other branches.
- Larger changes are more likely to occur on longer branches.
All this means that BM is a random walk model in which the trait varies along the branches essentially at random.
We can use BayesTraits (via R) to model the evolution of body size in cetaceans with the assumption of Brownian motion. First we need to isolate our variables into a data table for btw. The way to do this is quite simple. We can simply extract the two columns we need (1 and 2) into a new object.
species log.body.mass
1 Kogia_breviceps 5.523746
2 Kogia_sima 5.226600
3 Physeter_catodon 7.573065
4 Platanista_gangetica 4.775465
5 Delphinapterus_leucas 5.803457
6 Monodon_monoceros 6.198198
This first analysis corresponds to Continuous: Random Walk Model A ML in the BayesTraits manual. We can see from the manual that the commands to run this are “4 1 Run”. You need to be familiar with BayesTraits to interpret this so the first time you do it, you may want to do it in BayesTraits directly (via the command prompt or terminal). In essence, BayesTraits asks us questions and provides us with options for what we want it to do and 4, 1, Run are the options to run this analysis.
Given that we know what we want to do ahead of time, we can enter the commands into a command vector in R. To run these commands through BayesTraits, R will write them into a text file so BayesTraits can interpret them when needed. Note that you don’t need to enter Run into this vector as btw will take care of that for us.
Note that if you have nodelabels in your tree, there will be an error when running BayesTraits. You can remove nodelabels without effecting the structure of your tree like this.
I have a path on my desktop just for BayesTraits analyses. Remember that there must be a copy of BayesTraitsV3 stored here. That’s all you need as the output will be read back into R by btw. You also should remember to change your working directory back if you are finished with BayesTraits. In this chunk, I’ve saved the existing directory at the start and reset it immediately after the analysis is completed.
wd.reset <- getwd()
setwd("~/Desktop/BayesTraits")
m1 <- bayestraits(data = BT.data, tree = whale.tree, commands = command_vec1)
setwd(wd.reset)
On we go! The object that should have appeared in your R environment contains all the outputs you need from BayesTraits. Let’s have a look at the results component of the Log.
Tree.No Lh Alpha.1 Sigma.2.1
1 1 -31.9823 6.422936 6.315406
These results give us the Log likelihood (Lh), the reconstructed ancestral node (Alpha.1) and the phylogenetically corrected variance of the data (Sigma.2.1). The important thing to look at here is the log likelihood. We will use that to compare the BM model to other models.
9.5.2 Directional Evolution
So far we’ve looked at the random walk model of evolution. In reality, what we are usually interested in is deviations from the random walk model. We can investigate this using similar methods, but with a directional model.
An example of a case when we might be interested in a directional model is Cope’s rule (Kingsolver and Pfennig 2004, Hone and Benton 2005). Cope’s rule states that over time, lineages tend to have larger body sizes. So basically, on average animals tend to get bigger over evolutionary time.
Let’s see if we can detect a trend in cetacean body mass. For this analysis, we need a non-ultrametric tree (a phylogram rather than a chronogram). Luckily that’s what we already have. The branch lengths here describe evolutionary distance in terms of genetic change and so shorter branches indicate fewer genetic changes.We’re using BayesTraits again so the first step is to get our data into the right format.
As before, we run the random walk (BM) model first. Remember we need to set the working directory to a path where BayesTraits is stored.
setwd("~/Desktop/BayesTraits")
RW.commands <- c("4", "1")
RWmod <- bayestraits(BT.data, whale.tree, RW.commands)
RWmod$Log$results
Tree.No Lh Alpha.1 Sigma.2.1
1 1 -31.9823 6.422936 6.315406
The directional model takes a different set of commands.
setwd("~/Desktop/BayesTraits")
D.commands <- c("5", "1")
Dmod <- bayestraits(BT.data, whale.tree, D.commands)
Dmod$Log$results
Tree.No Lh Alpha.1 Beta.1 Sigma.2.1
1 1 -30.22462 7.951217 -12.37922 5.808331
Now we need to compare these models! What he have so far is two models and a log likelihood assigned to each. This means we can compare them using a likelihood ratio test. The general formula for an LR test is;
\[\text{LR}=2\times(\text{Lh}_{\text{ Model B}} - \text{Lh}_{\text{ Model A}})\]
The result is the likelhood ratio statistic (LR) which is asymptotically \(\chi^2\) distributed with degrees of freedom equal to the difference in the number of parameters between the models. Model A has 1 parameter (the root value) and model B has 2 (the root and the direction of change) so the degrees of freedom are 1.
[1] 3.515352
[1] 0.06080274
Note: pchisq gives the proportion of the distribution to the left of the value. To test if the model is better than the null model, we use 1 - pchisq.
The btw package has a function that will do all this for us. Be careful with interpretation though. Note that the p-value is different. Take this away from 1 and you have your p-value as above.
model1.Lh model2.Lh LRstat pval
1 -31.9823 -30.22462 3.515352 0.9391973
So what have we got here? Well we have tested two models of the evolution of body size in cetacea. The first is a random walk (Brownian motion) model of evolution in which we have estimated two parameters. The second is a directional model in which we have estimated 3 parameters. Model comparison showed no significant difference between them (LR = 3.52, p = 0.06) and so we should favour the simpler, 2 parameter model. Thus we have no evidence for a directional trend in cetacean body mass evolution.
9.6 Changes in the rate of evolution of a trait
Often when investigating the evolution of a continuous trait, we might have reason to suggest that in some lineages, the rate of evolution of that trait changed.
Let’s say we have a hypothesis that says the rate of change of body mass changed at the root of mysticetes (node 44). We can paint that onto the tree for demonstration using paintSubTree and plotSimmap in phytools (Revell 2012).
require(phytools)
tree1 <- paintSubTree(whale.tree, 44, "2")
plotSimmap(tree1, lwd = 2, fsize = 0.7)
Now we can run the test. Here the function brownie.lite in phytools compares the single rate model to the multi-rate model we have specified!
ML single-rate model:
s^2 se a k logL
value 6.165 1.3453 6.4229 2 -31.9823
ML multi-rate model:
s^2(1) se(1) s^2(2) se(2) a k logL
value 7.1119 1.6786 1.2663 0.8687 6.6116 3 -30.475
P-value (based on X^2): 0.0825
R thinks it has found the ML solution.
Here we’ve found no evidence of a regime shift in mysticete cetaceans (p = 0.083).
9.7 Uncertainty
If you are familiar with cetaceans and their evolutionary history, you might be surprised by our findings so far in this chapter. The prevailing state of knowledge suggests that cetaceans have evolved large body sizes since the transition to the water of an approximately dog-sized ancestor at the root of our tree. Given what we know about the fossil record of cetacea, we would expect to detect an increase in body size over the tree. To solve this puzzle, we need to look at what information we provided our analysis with.
As the old saying goes, if you put garbage in, you’ll get garbage out and this seems to apply here. For example, let’s look closely at our reconstructions. You can see here that both reconstructions have estimated the mass of the ancestor of cetaceans. Remember that these are log transformed data so we have to transform them back if we want to get a straightforward measurement of mass.
[1] 2648111
[1] 89375216
So depending on our model of evolution the ancestor was either 2,648.1 kg or 89,375.2 kg. A big difference between models so which one we choose really matters.
This is even more of a problem when we look at the fossil record of cetaceans. Indohyus (Raoellidae) is thought to be the species that most closely represents the transition to the water by cetacean ancestors (Thewissen et al. 2009) and its mass is estimated at around 10kg. An early species of cetacean called Pakicetus was estimated at around 45kg. So we are orders of magnitude away from what the fossil record shows us!
This problem is well understood in phylogenetic comparative methods. In fact, all methods of ancestral state reconstruction perform very poorly when compared to what we know from the fossil record (Webster and Purvis 2002). As you might expect, the deeper into your tree you try to estimate an ancestral state, the greater the uncertainty. This is especially clear when you look at estimating the root (Gascuel and Steel 2014). The solution is to incorporate fossil data in the analysis (Slater et al. 2012).
9.7.1 Fossils
To demonstrate the importance of fossil data, let’s take a closer look at the evolution of body size in cetaceans. With fastAnc, we found a mass of around 2,650kg for the root of the cetaceans.
The package RRphylo (Castiglione et al. 2018) contains data on fossil and living cetaceans (Serio et al. 2019). Using these data, we can hopefully perform a more rigorous ancestral state reconstruction (Castiglione et al. 2020). Note that the values here differ between datasets because the previous dataset used a log10 transformation whereas this one uses a natural log transformation!
library(RRphylo)
data("DataCetaceans")
DataCetaceans$treecet -> treecet
DataCetaceans$masscet -> masscet
The RRphylo function performs a variant of ancestral state reconstruction called phylogenetic ridge regression (Castiglione et al. 2020).
RRphylo returns a lot of information as a list. Included in this list is the tree used (useful for plotting) and aces which contains the estimates for the traits at the nodes.
plot(RR$tree, cex = .4, label.offset = .5, no.margin = TRUE)
nodelabels(round(RR$aces, digits = 1), cex = .5)
Using this reconstruction, we can extract the mass of the root. Remember that we need exp to calculate the untransformed value rather than raising to the power of 10 because of the natural log transformation.
[1] 727063.9
So our new estimate of the mass of the ancestor of cetaceans is 727.1kg. This is much closer to the estimated mass of early archeocete cetaceans like Ambulocetus natans at about 430kg and Indocetus ramani at around 630kg.
If we still aren’t satisfied that we have included the best information we have available, we can actually fossilise a node by passing a named list of ancestral states to the RRphylo function. Following the example of Castiglione et al. (2020), we can set the node of the ancestor of mysticetes to a known mass. Here we are assuming that the most recent common ancestor of all mysticetes can be represented by the species Mystacodon selenensis which weighed arond 150kg. Also we need to know that this ancestor is represented by the node labelled 128 in our tree object.
Now we can pass this state to the argument aces in RRphylo and the analysis will hold node 128 at the value we have set. You should be able to see that in the following plot, the ancestor of mysticetes is reconstructed as 11.9 rather than 12.9 in the previous reconstruction.
RR2 <- RRphylo(treecet, masscet, aces = x)
plot(RR2$tree, cex = .4, label.offset = .5, no.margin = TRUE)
nodelabels(round(RR2$aces, digits = 1), cex = .5)
Hopefully you can see that the more fossil information you include in your reconstructions, the more reliable they are.
9.7.2 Revisiting Mysticete Body Mass
In using the fossil data we have added in here, Castiglione et al. (2020) demonstrated that mysticetes actually do conform to Cope’s rule because they have an increasing trend in body size over time. This shows just how important adding in fossil data can be if you want the full picture.
This seems to suggest that we should also find a regime shift in mysticetes. Let’s have a closer look. We begin again by painting the tree at the specific node leading to mysticetes.
Next we run brownie.lite on our expanded dataset.
ML single-rate model:
s^2 se a k logL
value 0.2047 0.0265 13.2057 2 -178.7922
ML multi-rate model:
s^2(1) se(1) s^2(2) se(2) a k logL
value 0.176 0.0245 0.4012 0.147 13.2056 3 -176.0958
P-value (based on X^2): 0.0202
R thinks it has found the ML solution.
There you have it! We can now say that we have evidence in favour of a regime shift in mysticete body size (p = 0.02).
9.8 Further info
We’ve only just scratched the surface of what is possible with ancestral state reconstruction. For some background reading, have a look at chapter 4 of The comparative approach in evolutionary anthropology and biology (Nunn 2011).
Bibliography
Arnold, C., Matthews, L.J., and Nunn, C.L. (2010) ‘The 10kTrees Website: A New Online Resource for Primate Phylogeny’. Evolutionary Anthropology: Issues, News, and Reviews [online] 19 (3), 114–118. available from <https://doi.org/10.1002/evan.20251>
Castiglione, S., Serio, C., Mondanaro, A., Melchionna, M., Carotenuto, F., Di Febbraro, M., Profico, A., Tamagnini, D., and Raia, P. (2020) ‘Ancestral State Estimation with Phylogenetic Ridge Regression’. Evolutionary Biology [online] available from <https://doi.org/10.1007/s11692-020-09505-x>
Castiglione, S., Tesone, G., Piccolo, M., Melchionna, M., Mondanaro, A., Serio, C., Febbraro, M.D., and Raia, P. (2018) ‘A New Method for Testing Evolutionary Rate Variation and Shifts in Phenotypic Evolution.’ Methods in Ecology and Evolution [online] 9, 974–983. available from <https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.12954>
Gascuel, O. and Steel, M. (2014) ‘Predicting the Ancestral Character Changes in a Tree Is Typically Easier Than Predicting the Root State’. Systematic Biology [online] 63 (3), 421–435. available from <https://doi.org/10.1093/sysbio/syu010>
Harmon, L., Weir, J., Brock, C., Glor, R., and Challenger, W. (2008) ‘GEIGER: Investigating Evolutionary Radiations’. Bioinformatics 24, 129–131
Hone, D.W.E. and Benton, M.J. (2005) ‘The Evolution of Large Size: How Does Cope’s Rule Work?’ Trends in Ecology & Evolution [online] 20 (1), 4–6. available from <https://liverpool.idm.oclc.org/login?url=https://search.ebscohost.com/login.aspx?direct=true&db=edselp&AN=S0169534704003143&site=eds-live&scope=site>
Kingsolver, J.G. and Pfennig, D.W. (2004) ‘Individual-Level Selection as a Cause of Cope’s Rule of Phyletic Size Increase’. Evolution [online] 58 (7), 1608. available from <https://liverpool.idm.oclc.org/login?url=https://search.ebscohost.com/login.aspx?direct=true&db=edsjsr&AN=edsjsr.3449385&site=eds-live&scope=site>
Montgomery, S.H., Capellini, I., Barton, R.A., and Mundy, N.I. (2010) ‘Reconstructing the Ups and Downs of Primate Brain Evolution: Implications for Adaptive Hypotheses and Homo Floresiensis’. BMC Biology [online] 8 (1), 9. available from <https://doi.org/10.1186/1741-7007-8-9>
Montgomery, S.H., Geisler, J.H., McGowen, M.R., Fox, C., Marino, L., and Gatesy, J. (2013) The Evolutionary History of Cetacean Brain and Body Size. [online] 67 (11), 3339–3353. available from <www.jstor.org/stable/24032748>
Nunn, C.L. (2011) The Comparative Approach in Evolutionary Anthropology and Biology [online] University of Chicago Press. available from <https://books.google.co.uk/books?id=qj4cSzJGQJAC>
Paradis, E. and Schliep, K. (2018) ‘Ape 5.0: An Environment for Modern Phylogenetics and Evolutionary Analyses in R’. Bioinformatics 35, 526–528
Revell, L.J. (2012) ‘Phytools: An R Package for Phylogenetic Comparative Biology (and Other Things).’ Methods in Ecology and Evolution 3, 217–223
Serio, C., Castiglione, S., Tesone, G., Piccolo, M., Melchionna, M., Mondanaro, A., Febbraro, M.D., and Raia, P. (2019) ‘Macroevolution of Toothed Whales Exceptional Relative Brain Size.’ Evolutionary Biology [online] 46, 332–342. available from <https://link.springer.com/article/10.1007/s11692-019-09485-7>
Slater, G.J., Harmon, L.J., and Alfaro, M.E. (2012) ‘Integrating Fossils with Molecular Phylogenies Improves Inference of Trait Evolution’. Evolution [online] 66 (12), 3931–3944. available from <https://doi.org/10.1111/j.1558-5646.2012.01723.x>
Thewissen, J.G.M., Cooper, L.N., George, J.C., and Bajpai, S. (2009) ‘From Land to Water: The Origin of Whales, Dolphins, and Porpoises’. Evolution: Education and Outreach [online] 2 (2), 272–288. available from <https://doi.org/10.1007/s12052-009-0135-2>
Webster, A.J. and Purvis, A. (2002) ‘Testing the Accuracy of Methods for Reconstructing Ancestral States of Continuous Characters’. Proceedings of the Royal Society of London. Series B: Biological Sciences [online] 269 (1487), 143–149. available from <https://doi.org/10.1098/rspb.2001.1873>


Last Updated: 2017-08-11
The EIDAWS WFCatalog provides access to metadata and quality parameters for archives contributing data to EIDA. The supported request types are HTTP-GET and HTTP-POST. Service response is in JSON. Please refer to http://www.orfeus-eu.org/data/eida/eidaws/wfcatalog/ for a complete description of the service.
Metadata is presented with a daily granularity. Metadata for the previous day is always available with a maximum delay of 12 hours.


Girl Develop It is here to provide affordable and accessible programs to learn software through mentorship and hands-on instruction.
Things to keep in mind:
We are here for you!
Every question is important
Help each other
Have fun!
What to Expect
This is a survey of a very broad topic
Get a sense of what you'd like to know more about
I don't know everything, and neither will you
Getting to Know You
What's your name?
What do you want to take from this class?
What's the best meal you've ever had?
What We'll Be Covering:
The History of Computing
What is a Computer Program
How Programming Languages Developed
Basic Programming Concepts
What Should I Do Next?
Computation: The Early Years
Computation: The Early Years
Examples of some early analog calculators.
Computation: The Early Years
Diagram of Charles Babbage's Difference Engine.
Computation: The Early Years
An actual difference engine built out.
Computation: The Early Years
A program for the computation of Bernoulli numbers designed for the analytical engine.
Computation: The Early Years
Our Lady of Conceptual Programming, Ada Lovelace
How Do We Talk To Computers?
What is a Computer Program?
At its core, a computer program is a way of getting something done.
Program Examples
But how do you go from an idea to a computer program? And what IS a computer program?
Computer Program
One of the ways to accomplish getting something done is a list of instructions that tells the computer exactly what to do and allows interaction with human beings.
Those instructions have to be written in a language that the computer can understand.
What is a Programming Language?
A programming language is basically a set of strings (letters, numbers, commands) that is changed into machine code that the computer can understand.
Computer Programs
Computers don't understand things the same way humans do.
Words and symbols that make sense to human eyes need to be translated down to binary for the computer to understand.
Binary
Binary is a system of expressing everything using only 1s and 0s.
The Evolution of Programming Languages
First Generation: Machine Code
Second Generation (1949): Assembly Code
Third Generation (Late 1950s): High-Level Language
Fourth Generation (1980s): Even Higher-Level Language
How We Talk To Computers: The First Generation
Machine code, is the straight-up use
of binary as a means of programming.
How We Talk To Computers: The First Generation
How We Talk To Computers: The First Generation
One character per column
That's 80 bytes per card
MicroSD = 199,963,443 cards
How We Talk To Computers: The Second Generation
How We Talk To Computers: The Second Generation
Assembly code is code that
uses chunks of text as symbols for specific processes.
Our Lady of Code Compilation, Grace Hopper
How We Talk To Computers: The Third Generation
Third-generation languages are languages
that machine-independent and whose syntax is abstracted and
reads in a much more human fashion.
Before / Assembly
section .text
global _start ;must be declared for linker (ld)
_start: ;tell linker entry point
mov edx,len ;message length
mov ecx,msg ;message to write
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80 ;call kernel
mov eax,1 ;system call number (sys_exit)
int 0x80 ;call kernel
section .data
msg db 'Hello, world!',0xa ;our dear string
len equ $ - msg ;length of our dear string
The best thing about computers is that they will do exactly what you tell them to do.
The worst thing about computers is that they will do exactly what you tell them to do.
How To Talk To Computers: A Demo
How To Talk To Computers: A Demo
PEBKAC
Ever heard of the acronym "PEBKAC"?
ProblemExistsBetweenKeyboardAndChair
In other words, user error.
Remember, when you're writing a program and the computer is executing it, the computer is only doing what you told it to do. If it's not working the way you expect, look for an error in your program.
Pseudo Code
Let's Talk To Computers!
Let's Talk To Computers: Concepts
We'll be covering
Variables,
Conditionals, and
Loops!
Let's Meet the Terminal!
The terminal is a space where we
run chunks of code and test them to make sure that it's behaving in
the way we want it to.
For this course, we'll be making use of an online terminal named repl.it.
Let's Talk To Computers: Variables
A variable is essentially a storage container for information.
Usually when a string is created in a program, it's surrounded by quotation marks.
Variable Types: Numbers as Strings
You can store numbers as a string variables too!
This is best used for numbers that aren't/shouldn't be used in mathematical
equations. Numbers can also become part of strings if directly added to them.
jennys_number = "8675309"
Variable Types: Booleans
Variables can also be used to store TRUE or FALSE as a value.
Variable Types: Booleans
Variables can also be used to store TRUE or FALSE as a value.
logged_in = False
prime_member = False
You can define a condition, then use a Boolean to tell the computer whether that condition is true or false.
Variable Ability #1
The value of variables can be updated over the course of a program.
One nice thing about some newer languages is that it looks similar to writing English.
However, when dispensing with punctuation, the computer substitutes indentation to make that
actions execute correctly and in the right order.
And now, a break for one of those programming jokes...
A programmer's partner sends them to go pick up some groceries, asking
them to get a loaf of bread, and, if there are eggs, to get twelve.
The programmer returns with twelve loaves of bread.
Let's Talk To Computers: Loops
A loop is a set of instructions that repeats until a certain condition is reached.
Two kinds of loops are For Loops and While Loops.
Why Use Loops?
Loops are awesome at doing repetitive tasks and reducing the amount of code you need to write.

Why Use Loops?
number_of_cars = 276
while number_of_cars > 0:
print('You get a car!')
number_of_cars = number_of_cars - 1
An infinite loop is a loop that will never meet the condition to stop. It will keep going until it's used up all your computer's (or server's) memory (RAM). This is bad!
Example for our loop:
If the cookie_jar_contents = cookie_jar_contents - 1 line was missing, it would keep looping because the cookie jar contents will never be 0!
Using What We've Learned
We've run through Variables,If/Else Statements,
and Loops... now let's try to think through how we'd use them all together!


class: center, middle # Intro to Docker InfraKit Drew MacInnis (github.com/drmdrew) - https://github.com/drmdrew/infrakit-demo --- class: center, middle # What is Docker InfraKit? https://github.com/docker/infrakit > A toolkit for creating and managing declarative, > self-healing infrastructure.
--- # InfraKit Origins https://blog.docker.com/2016/10/introducing-infrakit-an-open-source-toolkit-for-declarative-infrastructure/ > While working on Docker for AWS and Azure, ... > We started InfraKit to solves these problems and to > provide the ability to create a self healing infrastructure > for distributed systems. --- # InfraKit Origins (cont.) https://blog.docker.com/2016/03/democratizing-scale-google-borg-twitter-aurora-docker/ * March 2016: Docker Inc. acquires Conductant, Inc. - Bill Farner, David Chung, and John Sirois - Bill Farner: Apache Aurora project (Aurora is a Mesos framework) - http://aurora.apache.org/ > "The Quest for an Open Borg"
> "Aurora is responsible for management and scaling of microservices > at Twitter and is used daily by over a thousand engineers across the company"
> "In building Aurora, we focused on technical as well as organizational scalability. > ... > At Twitter, we needed Aurora to excel at both. > Today, Aurora manages clusters with **tens of thousands** of machines > used by **hundreds of engineers** to develop and deploy hundreds of services. > It accomplishes this feat with an **operations team of just three engineers**" --- # Getting Started ## Build from source (golang) ```bash mkdir -p ~/go/src/github.com/docker cd !$ git clone git@github.com:docker/infrakit.git cd infrakit make binaries ``` ## Use a docker infrakit image (I had problems!) ```bash Attaching to infrakitdemo_group_1 group_1 | panic: user: Current not implemented on linux/amd64 group_1 | group_1 | goroutine 1 [running]: group_1 | panic(0x73a720, 0xc42000b120) group_1 | /usr/local/go/src/runtime/panic.go:500 +0x1a1 group_1 | github.com/docker/infrakit/discovery.Dir(0x720720, 0xc420033b3f) ``` --- # Demo 1: A Quick Tutorial https://github.com/docker/infrakit/blob/master/docs/tutorial.md --- # Future From Docker blog 2016/10: > In a future release, InfraKit will also become > part of the Docker Engine. ## Docker for AWS/Azure https://beta.docker.com/docs/aws/ --- # Questions? --- # Thank you!


Item submission failed!
Your item failed the verification process! Perhaps this will help you figure out why:
{% for error in errors %}
- {{error}}
{% endfor %}
If you believe this message in in error
E-mail me a copy of the listed errors and what you were trying to do, and I'll see if it's something that needs to be fixed on my end.
{% endblock %}


public static enum StanbolSolrVocabulary.SolrFieldName extends java.lang.Enum<StanbolSolrVocabulary.SolrFieldName>
| Enum Constant and Description |
|---|
BINARYCONTENT
Name of the field which holds the binary content
|
BIRTHPLACES
Name of the field which holds the birthplaces/placeofbirths of the persons mentioned in the content.
|
CAPITALS
Name of the field which holds the capital cities of the countries mentioned in the content.
|
CAPTIONS
Name of the field which holds the captions of the images belonging to the persons mentioned in the content.
|
CONTENT
Name of the field which holds the actual content.
|
COUNTRIES
Name of the field which holds the countries of the cities mentioned in the content.
|
CREATIONDATE
Name of the field which holds the creation date of the content.
|
ENHANCEMENTCOUNT
Name of the field which holds the number of enhancements for the content.
|
FIELDS
Name of the field which holds the fields on which the persons mentioned in the content studied.
|
GIVENNAMES
Name of the field which holds the given names of the persons mentioned in the content.
|
GOVERNORS
Name of the field which holds the governors of the provinces mentioned in the content.
|
ID
Name of the unique ID field.
|
IMAGECAPTIONS
Name of the field which holds the image captions of the entities mentioned in the content.
|
KNOWNFORS
Name of the field which holds the important events which are known/invented through the persons mentioned in
the content.
|
LARGESTCITIES
Name of the field which holds the largest cities of the entities mentioned in the content.
|
LEADERNAMES
Name of the field which holds the names of the leaders of the countries mentioned in the content.
|
MIMETYPE
Name of the field which holds the mime type (content type) of the content.
|
ORGANIZATIONS
Name of the field which holds entities which carry the dbpedia Organization property.
|
PEOPLE
Name of the field which holds entities which carry the dbpedia Person property.
|
PLACEOFBIRTHS |
PLACES
Name of the field which holds entities which carry the dbpedia Place property.
|
REGIONS
Name of the field which holds the geographic regions of the cities mentioned in the content.
|
SHORTDESCRIPTIONS
Name of the field which holds the short descriptions of the persons mentioned in the content.
|
TITLE
Name of the field which holds the title of the content.
|
WORKINSTITUTIONS
Name of the field which holds the names of the institutions at which the persons mentioned in the content
worked.
|
| Modifier and Type | Method and Description |
|---|---|
static StanbolSolrVocabulary.SolrFieldName[] |
getAnnotatedEntityFieldNames() |
static StanbolSolrVocabulary.SolrFieldName[] |
getSemanticFieldNames() |
static boolean |
isAnnotatedEntityFacet(java.lang.String facetName) |
static boolean |
isNameReserved(java.lang.String name) |
java.lang.String |
toString() |
static StanbolSolrVocabulary.SolrFieldName |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static StanbolSolrVocabulary.SolrFieldName[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final StanbolSolrVocabulary.SolrFieldName PLACES
public static final StanbolSolrVocabulary.SolrFieldName PEOPLE
public static final StanbolSolrVocabulary.SolrFieldName ORGANIZATIONS
public static final StanbolSolrVocabulary.SolrFieldName ID
public static final StanbolSolrVocabulary.SolrFieldName TITLE
public static final StanbolSolrVocabulary.SolrFieldName CONTENT
public static final StanbolSolrVocabulary.SolrFieldName BINARYCONTENT
public static final StanbolSolrVocabulary.SolrFieldName MIMETYPE
public static final StanbolSolrVocabulary.SolrFieldName CREATIONDATE
public static final StanbolSolrVocabulary.SolrFieldName ENHANCEMENTCOUNT
public static final StanbolSolrVocabulary.SolrFieldName COUNTRIES
public static final StanbolSolrVocabulary.SolrFieldName IMAGECAPTIONS
public static final StanbolSolrVocabulary.SolrFieldName REGIONS
public static final StanbolSolrVocabulary.SolrFieldName GOVERNORS
public static final StanbolSolrVocabulary.SolrFieldName CAPITALS
public static final StanbolSolrVocabulary.SolrFieldName LARGESTCITIES
public static final StanbolSolrVocabulary.SolrFieldName LEADERNAMES
public static final StanbolSolrVocabulary.SolrFieldName GIVENNAMES
public static final StanbolSolrVocabulary.SolrFieldName KNOWNFORS
public static final StanbolSolrVocabulary.SolrFieldName BIRTHPLACES
public static final StanbolSolrVocabulary.SolrFieldName PLACEOFBIRTHS
public static final StanbolSolrVocabulary.SolrFieldName WORKINSTITUTIONS
public static final StanbolSolrVocabulary.SolrFieldName CAPTIONS
public static final StanbolSolrVocabulary.SolrFieldName SHORTDESCRIPTIONS
public static final StanbolSolrVocabulary.SolrFieldName FIELDS
public static StanbolSolrVocabulary.SolrFieldName[] values()
for (StanbolSolrVocabulary.SolrFieldName c : StanbolSolrVocabulary.SolrFieldName.values()) System.out.println(c);
public static StanbolSolrVocabulary.SolrFieldName valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namejava.lang.NullPointerException
- if the argument is nullpublic final java.lang.String toString()
toString
in class java.lang.Enum<StanbolSolrVocabulary.SolrFieldName>
public static StanbolSolrVocabulary.SolrFieldName[] getSemanticFieldNames()
public static StanbolSolrVocabulary.SolrFieldName[] getAnnotatedEntityFieldNames()
public static boolean isNameReserved(java.lang.String name)
public static boolean isAnnotatedEntityFacet(java.lang.String facetName)


Documentation
Getting started
To run regenie, use the command ./regenie
on the command line,
followed by options and flags as needed.
To get a full list of options use
./regenie --help
The directory examples/
contains some small example files that are
useful when getting started. A test run on a set of binary traits can be achieved by the
following 2 commands.
In Step 1 the whole genome regression model is fit to the traits, and a set of genomic predictions are produced as output
./regenie \
--step 1 \
--bed example/example \
--exclude example/snplist_rm.txt \
--covarFile example/covariates.txt \
--phenoFile example/phenotype_bin.txt \
--remove example/fid_iid_to_remove.txt \
--bsize 100 \
--bt --lowmem \
--lowmem-prefix tmp_rg \
--out fit_bin_out
In Step 2 a set of imputed SNPs are tested for association using a Firth logistic regression model
./regenie \
--step 2 \
--bgen example/example.bgen \
--covarFile example/covariates.txt \
--phenoFile example/phenotype_bin.txt \
--remove example/fid_iid_to_remove.txt \
--bsize 200 \
--bt \
--firth --approx \
--pThresh 0.01 \
--pred fit_bin_out_pred.list \
--split \
--out test_bin_out_firth
One of the output files from these two commands is included in the example/
directory and
you can check they are the same using the following command (the message should be printed out)
cmp test_bin_out_firth_Y1.regenie example/example.test_bin_out_firth_Y1.regenie \
&& echo "Files are identical"
Input
| Option | Argument | Type | Description |
|---|---|---|---|
--bgen, --bed, --pgen |
FILE | Required | Input genetic data file. Either BGEN file eg. file.bgen , or bed/bim/fam prefix that assumesfile.bed , file.bim , file.fam exist, or pgen/pvar/psam prefix that assumesfile.pgen , file.pvar , file.psam exist |
--sample |
FILE | Optional | Sample file corresponding to input BGEN file |
--with-bgi |
FLAG | Optional | Specify to use accompanying bgi index file to get variant information (assumes file name is file.bgen.bgi |
--ref-first |
FLAG | Optional | Specify to use the first allele as the reference allele for BGEN or PLINK bed/bim/fam file input [default is to use the last allele as the reference] |
--keep |
FILE | Optional | Inclusion file that lists individuals to retain in the analysis |
--remove |
FILE | Optional | Exclusion file that lists individuals to remove from the analysis |
--extract |
FILE | Optional | Inclusion file that lists IDs of variants to keep |
--exclude |
FILE | Optional | Exclusion file that lists IDs of variants to remove |
--phenoFile |
FILE | Required | Phenotypes file |
--phenoCol |
STRING | Optional | Use for each phenotype you want to include in the analysis |
--phenoColList |
STRING | Optional | Comma separated list of phenotypes to include in the analysis |
--covarFile |
FILE | Optional | Covariates file |
--covarCol |
STRING | Optional | Use for each covariate you want to include in the analysis |
--covarColList |
STRING | Optional | Comma separated list of covariates to include in the analysis |
--pred |
FILE | Optional | File containing predictions from Step 1 (see Overview). This is required for --step 2 |
Genetic data file format
regenie can read BGEN files, bed/bim/fam files or pgen/psam/pvar files in Step 1 and Step 2.
The BGEN file format is described here.
The bed/bim/fam file format is described here.
The pgen/pvar/psam file format is described here.
Tools useful for genetic data file format conversion are : PLINK, QCTOOL, BCFTOOLS.
Step 2 of regenie can be sped up with BGEN files by using v1.2 format with 8 bits encoding
(genotype file can be generated with PLINK2 using
option --export bgen-1.2 'bits=8'
) as well as passing on an accompanying .bgi index file
(a useful tool to create such file is bgenix which is part of the BGEN library).
To include X chromosome genotypes in step 1 and/or step 2, males should be coded as diploid so that their genotypes are 0/2. This can be done in PLINK by setting the sex of all individuals to female before generating the genotype file. Chromosome values of 23 (for human analyses), X, XY, PAR1 and PAR2 are all acceptable and will be collapsed into a single chromosome.
Sample inclusion/exclusion file format
2 2
7 7
.
No header. Each line starts with individual FID IID. Space/tab separated.
Samples listed in the file that are not in bgen/bed/pgen file are ignored.
Variant inclusion/exclusion file format
20
31
.
No header. Each line must start with variant ID (if there are additional columns, file must be space/tab separated).
Variants listed in this file that are not in bgen/bed/pgen file are ignored.
Covariate file format
FID IID V1 V2 V3
1 1 1.46837294454993 1.93779743016325 0.152887004505393
2 2 -1.2234390803815 -1.63408619199948 -0.190201446835255
3 3 0.0711531925667286 0.0863906292357564 0.14254739715665
.
Line 1 : Header with FID, IID and covariate names.
Followed by lines of values. Space/tab separated.
Each line contains individual FID and IID followed by covariate values.
Samples listed in this file that are not in bgen/bed/pgen file are ignored. Genotyped samples that are not in this file are removed from the analysis.
No missing values are allowed.
If --step 2
is specified, then the covariate file should be the same
as that used in Step 1.
Phenotype file format
FID IID Y1 Y2
1 1 1.64818554321186 2.2765234736685
2 2 -2.67352013711554 -1.53680421614647
3 3 0.217542851471485 0.437289912695016
.
Line 1 : Header with FID, IID and phenotypes names.
Followed by lines of values. Space/tab separated.
Each line contains individual FID and IID followed by P phenotype values
(for binary traits, must be coded as 0=control, 1=case, NA=missing unless using --1
).
Samples listed in this file that are not in bgen/bed/pgen file are ignored. Genotyped samples that are not in this file are removed from the analysis.
Missing values must be coded as NA.
With QTs, missing values are mean-imputed in Step 1 and they are dropped when testing each phenotype in Step 2 (unless using --force-impute
).
With BTs, missing values are mean-imputed in Step 1 when fitting the level 0 linear ridge regression and they are dropped when fitting the level 1 logistic ridge regression for each trait . In Step 2, missing values are dropped when testing each trait.
To remove all samples that have missing values at any of the phenotypes, use option --strict
in Step 1 and 2. This is also useful when analyzing a single trait to avoid making a new bed/pgen/bgen file just for the complete data set of individuals (so setting the phenotype values of individuals to remove to NA), although --remove
can also be used in that situation.
Predictions file format
Running --step 1 --out foo
will produce
- A set of files containing genomic predictions for each phenotype from Step 1 (see Output section below).
- A file called
foo_pred.list
listing the locations of the prediction files.
The file list is needed as an input file when using --step 2
via the --pred
option.
It has one line per phenotype (in any order) that specifies the name of the phenotype and its
corresponding prediction file name.
Each phenotype must have exactly one prediction file and phenotype names
must match with those in the phenotype file.
Phenotypes in this file not included in the analysis are ignored.
Each prediction file contains the genetic predictions for the phenotype (space separated).
Line 1 starts with 'FID_IID' followed by $N$ sample identifiers. It is followed by 23 lines containing the genetic predictions for each chromosome (sex chromosomes are collapsed into chromosome 23).
More specifically, each line has $N+1$ values which are the chromosome number followed by the $N$ leave-one chromosome out (LOCO) predictions for each individual.
Samples in this file not in the bed/pgen/bgen input file are ignored. Genotyped samples not present in this file will be ignored in the analysis of the corresponding trait.
Samples with missing LOCO predictions must have their corresponding phenotype value set to missing.
Options
| Option | Argument | Type | Description |
|---|---|---|---|
--step |
INT | Required | specify step for the regenie run (see Overview) [argument can be 1 or 2 ] |
--bt |
FLAG | Optional | specify that traits are binary with 0=control,1=case,NA=missing (default is quantitative) |
-1,--cc12 |
FLAG | Optional | specify to use 1/2/NA encoding for binary traits (1=control,2=case,NA=missing) |
--bsize |
INT | Required | size of the genotype blocks |
--cv |
INT | Optional | number of cross validation (CV) folds [default is 5] |
--loocv |
FLAG | Optional | flag to use leave-one out cross validation |
--lowmem |
FLAG | Optional | flag to reduce memory usage by writing level 0 predictions to disk (details below). This is very useful if the number of traits is large (e.g. greater than 10) |
--lowmem-prefix |
FILE PREFIX | Optional | prefix where to temporarily write the level 0 predictions |
--print-prs |
FLAG | Optional | flag to print whole genome predictions (i.e. PRS) without using LOCO scheme |
--nb |
INT | Optional | number of blocks (determined from block size if not provided) |
--strict |
FLAG | Optional | flag to removing samples with missing data at any of the phenotypes |
--ignore-pred |
FLAG | Optional | skip reading the file specified by --pred (corresponds to simple linear/logistic regression) |
--use-prs |
FLAG | Optional | flag to use whole genome PRS in --pred (this is output in step 1 when using --print-prs ) |
--split |
FLAG | Optional | flag to split asssociation results into separate files for each trait. |
--gz |
FLAG | Optional | flag to output files in compressed gzip format (LOCO prediction files in step 1 and association results files in step 2) [this only works when compiling with Boost Iostream library (see Install tab)]. |
--force-impute |
FLAG | Optional | flag to keep and impute missing observations for QTs in step 2 |
--write-samples |
FLAG | Optional | flag to write sample IDs for those kept in the analysis for each trait in step 2 |
--print-pheno |
FLAG | Optional | flag to write phenotype name in the first line of the sample ID files when using --write-samples |
--firth |
FLAG | Optional | specify to use Firth likelihood ratio test (LRT) as fallback for p-values less than threshold |
--approx |
FLAG | Optional | flag to use approximate Firth LRT for computational speedup (only works when option --firth is used) |
--firth-se |
FLAG | Optional | flag to compute SE based on effect size and LRT p-value when using Firth correction (instead of based on Hessian of unpenalized log-likelihood) |
--spa |
FLAG | Optional | specify to use Saddlepoint approximation as fallback for p-values less than threshold |
--pThresh |
FLOAT | Optional | P-value threshold below which to apply Firth/SPA correction [default is 0.05] |
--test |
STRING | Optional | specify to carry out dominant or recessive test [default is additive; argument can be dominant or recessive ] |
--chr |
INT | Optional | specify which chromosomes to test in step 2 (use for each chromosome to include) |
--chrList |
STRING | Optional | Comma separated list of chromosomes to test in step 2 |
--minMAC |
INT | Optional | flag to specify the minimum minor allele count (MAC) when testing variants [default is 5]. Variants with lower MAC are ignored. |
--minINFO |
FLOAT | Optional | flag to specify the minimum imputation info score (IMPUTE/MACH R^2) when testing variants. Variants with lower info score are ignored. |
--nauto |
INT | Optional | number of autosomal chromosomes (for non-human studies) [default is 22] |
--niter |
INT | Optional | maximum number of iterations for logistic regression [default is 30] |
--maxstep-null |
INT | Optional | maximum step size for logistic model with Firth penalty under the null [default is 25] |
--maxiter-null |
INT | Optional | maximum number of iterations for logistic model with Firth penalty under the null [default is 1000] |
--threads |
INT | Optional | number of computational threads to use [default=all] |
--debug |
FLAG | Optional | debug flag (for use by developers) |
--verbose |
FLAG | Optional | verbose screen output |
--help |
FLAG | Optional | Prints usage and options list to screen |
When step 1 of regenie is run in low memory mode (i.e. using --lowmem
),
temporary files are created on disk (using --lowmem-prefix tmp_prefix
determines
where the files are written [as in tmp_prefix_l0_Y1
,...,tmp_prefix_l0_YP
for P phenotypes]). If the prefix is not specified, the default is to use the
prefix specified by --out
(see below).
These are automatically deleted at the end of the program (unless the run
was not successful in which case the user would need to delete the files)
Output
| Option | Argument | Type | Description |
|---|---|---|---|
--out |
FILE PREFIX | Required | Output files that depends on --step |
A log file file.log
of the output is generated.
Using --step 1 --out file
For the phenotypes, files file_1.loco
,...,file_P.loco
are output with the
per-chromosome LOCO predictions as rows of the files.
If option --gz
was used, the files will be compressed in gzip format and have extension .loco.gz
.
Genotyped individuals specified using option --remove
are excluded from this file.
Hence, this can be used if genotype files in step 1 and 2 have different number of samples
(so only keeping samples present in both files).
Individuals with missing phenotype values kept in the analysis are included in the file and have their predictions set to missing.
The list of blup files needed for step 2 (association testing) is written to file_pred.list
.
If using --print-prs
, files files_1.prs
,...,files_P.prs
will be written with the
whole genome predictions (i.e. PRS) without using LOCO scheme (similar format as the .loco files).
The list of these files is written to file_prs.list
and can be used in step 2 with --pred
and
specifying flag --use-prs
. Note that as these are not obtained using a LOCO scheme,
association tests could suffer from proximal contamination.
Using--step 2 --out file
By default, results are written to a single file file.regenie
, which has one line per
SNP along with a header line.
If option --gz
was used, the file will be compressed in gzip format and have extension .regenie.gz
.
The first 7 entries of each row specify chromosome, posistion, ID, reference allele (allele 0), alternative allele (allele 1), frequency of the alternative allele, and the test performed (additive/dominant/recessive). With BGEN/PGEN files, the imputation INFO score is also provided (IMPUTE info score for BGEN and Mach Rsq for PGEN). Allele frequency and INFO score, if applicable, are computed using all individuals included in the analysis (so they are the same for all phenotypes).
These are followed by the estimated effect sizes, standard errors, chi-square test statistics and p-values for each phenotype.
When using option --split
, the results are written in separate files for
each phenotype
file_<phenotype1_name>.regenie,...,file_<phenotypeP_name>.regenie
with the same format.
If option --gz
was used, the files will be compressed in gzip format and have extension .regenie.gz
.
If option --write-samples
was used, IDs of samples used for each trait will be written in files
file_<phenotype1_name>.regenie.ids,...,file_<phenotypeP_name>.regenie.ids
(tab separated, no header).


--- layout: archive title: Zulip Chat Archive permalink: /stream/113488-general/topic/trace.20simp!.html ---
can we trace simp!?
set_option trace.simplify.rewrite true
it doesn't trace which definitions are unfolded by simp!!
{% endraw %}Last updated: Apr 24 2020 at 19:02 UTC


Submit a post to the Steem blockchain
Username:
Posting private key:
Title of post:
Post body:
Content of the post
Tags:


We provide an AI-driven dynamic IVR system that helps you engage with your customers without sacrificing the quality of their interaction! Sign up below to try!


Slide Downloader
Enter url and click download-button to download.
URL
Download
file_download
Searching...


{% extends "tutorial.html" %}
{% block headauthor %}Malte Ubl
HTML5 gives us great tools to enhance the visual appearance of web applications. This is especially true in the realm of animations. However, with this new power also come new challenges. Actually these challenges aren't really that new and it might sometimes make sense to ask your friendly desk neighbor, the Flash programmer, how she has overcome similar things in the past.
Anyway, when you work in animation it becomes hugely important that users perceive these animations to be smooth. What we need to realize is that smoothness in animations can't really be created by simply increasing the frames per second beyond any cognitive threshold. Our brain is, unfortunately, smarter than that. What you will learn is that true 30 frames of animation per second (fps) is much better than 60 fps with just a few frames dropped in the middle. People hate jaggedness.
This article will try to give you the tools and techniques to work on improving the experience of your own application.
By no means do we want to discourage you from building awesome, stunningly visual apps with HTML5.
Then when you notice that performance could be a little better, come back here and read up on how you can improve the elements of your application. It can, of course, help to do some things right in the first place but never let that get in your way of being productive.
Hardware acceleration is an important milestone for overall render performance in the browser. The general scheme is to offload tasks that would otherwise be calculated by the main CPU to the graphics processing unit (GPU) in your computer's graphics adapter. This can yield massive performance gains and can also reduce resource consumption on mobile devices.
While acceleration of canvas and WebGL are special purpose features that might not apply to your specific application the first three aspects can help pretty much every app to become faster.
GPU acceleration works by offloading well-defined and specific tasks to special purpose hardware. The general scheme is that your document is broken down into multiple "layers" which are invariant to the aspects of your page that are accelerated. These layers are rendered using the traditional render pipeline. The GPU is then used to composite the layers onto a single page applying the "effects" that can be accelerated on the fly. A possible outcome is that an object that is animated on the screen does not require a single "relayout" of the page while the animation happens.
What you need to take away from that is that you need to make it easy for the rendering engine to identify when it can apply it's GPU acceleration magic. Consider the following example:
While this works, the browser doesn't really know that you are performing something that is supposed to be perceived as smooth animation by a human being. Consider what happens when you achieve the same visual appearance using CSS3 transitions instead:
How the browser implements this animation is completely hidden from the developer. This in turn means that the browser is able to apply tricks such as GPU acceleration to achieve the defined goal.
There are two useful command-line flags for Chrome to help debugging GPU acceleration:
Safari has similar runtime flags described here.
CSS Transitions make style animation trivial for everyone, but they also are a smart performance feature. Because a CSS transition is managed by the browser, the fidelity of its animation can be greatly improved, and in many cases hardware accelerated. Currently WebKit (Chrome, Safari, iOS) have hardware accelerated CSS transforms, but it's coming quickly to other browsers and platforms.
You can use "transitionEnd" events in order to script this into powerful combinations, though right now, capturing all supported transition end events means watching
Many libraries have now introduced animation APIs that leverage transitions if present and fall back to standard DOM style animation otherwise. scripty2, YUI transition, jQuery animate enhanced.
I'm sure you've found yourself animating the x/y position of an element across the page before. You probably manipulated the inline style's left and top properties. With 2D transforms, we can use the
We can combo this with DOM animation to use the best thing possible
We use Modernizr to feature test for CSS 2D Transforms and CSS Transitions, if so we're going to use translate to shift the position. If this is animated using a transition there is a good chance the browser can hardware accelerate it. To give the browser another push in the right direction we'll use the "magic CSS bullet" from above. If our browser is less capable, we'll fallback to jQuery to move our element. You can pick up the jQuery Transform polyfill plugin by Louis-Rémi Babé to make this whole thing automatic.
For more details on how and why to use
When you discover that the speed of your application can be improved, it is time to dig into profiling to find out where optimizations could yield the greatest benefit. Optimizations will often have negative impact on the maintainability of your source code and should thus only be applied if necessary. Profiling tells you which parts of your code would yield the greatest benefits when their performance would be improved.
JavaScript profilers give you an overview on the performance of your application on the JavaScript function level by measuring the time it takes to execute each individual function from its starts to its end.
The gross execution time of a function is the overall time it takes to execute it from top to bottom. The net execution time is the gross execution time minus the time it took to execute functions called from the function.
Some functions get called more often than others. Profilers usually give you the time it took for all invocations to run as well as the average and minimum and maximum execution time.
For more details, check out the Chrome Dev Tools docs on profiling.
The performance of JavaScript has a strong influence in to how fluid and responsive your application will feel. It is important to understand that, while JavaScript profilers measure the execution time of your JavaScript, they also indirectly measure the time spent doing DOM operations. These DOM operations are often at the heart of your performance issues.
E.g. in the code above almost no time is spent executing actual JavaScript. It is still very likely that the drawArray-function will show up in your profiles because it is interacting with the DOM in a very wasteful fashion.
Anonymous functions are not easy to profile because they inherently don't have a name under which they could show up in the profiler. There are two ways to work around this:
rewrite to:
It is not commonly known that JavaScript supports naming function expressions. Doing this will make them show up perfectly in the profiler. There is one problem with this solution: The named expression actually puts the function name into the current lexical scope. This might clobber other symbols, so be careful.
Imagine you have a long function and you suspect that a small part of it might be the reason for your performance problems. There are two ways to find out which part is the problem:
The latest Chrome Web Inspector development tools contain the new "Timeline View" which shows a timeline of the low level actions performed by the browser. You can use this information to optimize your DOM operations. You should aim to reduce the number of "actions" the browser has to perform while your code executes.
The timeline view can create an immense amount of information. You should thus try to create minimal test cases that you can execute independently.
The image above shows the output of the timeline view for a very simple script. The left pane shows the operations performed by the browser in chronical order, while the timeline in the right pane shows the actual time consumed by an individual operation.
More info on the timeline view. An alternative tool for profiling in Internet Explorer is DynaTrace Ajax Edition.
When you want to profile your application, try to single out the aspects of its functionality that might trigger slowness as close as possible. Then try to do a profile run that only executes parts of your code that are relevant to these aspects of your application. This will make the profiling data easier to interpret because it is not intermixed with code paths that are not related to your actual problem. Good examples for individual aspects of your application might be:
Executing only the right part of your application can be harder in a GUI program than when you optimize, say, the ray tracer of your 3D engine. When you, for example, want to profile the stuff that happens when you click a button, you might trigger unrelated mouseover events along the way that make your results less conclusive. Try to avoid that :)
There is also a programatic interface to activate the debugger. This allows precise control over when profiling starts and when it ends.
Start a profiling with:
Stop profiling with:
When you do profiling make sure you can actually reproduce your results. Only then will you be able to tell whether your optimizations did actually improve things. Also function level profiling is done in the context of your whole computer. It is not an exact science. Individual profile runs might be influenced by many other things happening on your computer:
It also makes sense to execute the same code path multiple times in one profiling session. This way you decrease the influence of above factors and the slow parts may stand out even more clearly.
When you identified a slow spot in your program, try to think of ways to improve the execution behavior. After you changed your code, profile again. If you are satisfied with the result, move on, if you are not seeing an improvement you should probably roll back your change and not leave it in "because it can't hurt".
A common theme for improving the speed of web client applications is to minimize DOM interaction. While the speed of JavaScript engines has increased by an order of magnitude, accessing the DOM has not gotten faster at the same rate. This is also for very practical reasons never going to happen (things like layouting and drawing stuff on a screen just take time).
Whenever you retrieve a node or a list of nodes from the DOM, try to think about whether you might be able to reuse them in a later computation (or even just the next loop iteration). As long as you don't actually add or delete nodes in the relevant area, this is often the case.
Before:
After:
The same way you can cache DOM nodes you can also cache the values of attributes. Imagine you are animating an attribute of a node's style. If you know that you (as in that part of the code) are the only one that will ever touch that attribute you can cache the last value on every iteration so that you will not have to read it repeatedly.
Before:
After:
Loops are often hot points for optimization. Try to think of ways to decouple actual number crunching to working with the DOM. It is often possible to do a calculation and then, after it is done, apply all the results in one go.
Before:
After:
As discussed earlier accessing the DOM is relatively slow. It becomes very slow when your code is reading a value which has to be recalculated because your code recently modified something related in the DOM. Thus, it should be avoided to intermix reading and writing access to the DOM. Ideally your code should always be grouped in two phases:
Try not to program a pattern such as:
Before:
After:
This advice should be considered for actions happening within one JavaScript execution context. (e.g. within an event handler, within an interval handler or when handling an ajax response.)
Executing the function paintSlow() from above creates this image:
Switching to the faster implementation yields this image:
These images show that reordering the way your code accesses the DOM can greatly enhance render performance. In this case the original code has to recalculate styles and layout the page twice to create the same result. Similar optimization can be applied to basically all "real world" code and yield some really dramatic results.
Read more: Rendering: repaint, reflow/relayout, restyle by Stoyan Stefanov
JavaScript execution in the browser follows an "Event Loop" model. By default the browser is in an "idle" state. This state can be interrupted by events from user interactions or such things as JavaScript timers or Ajax callbacks. Whenever a piece of JavaScript runs at such an interruption point, the browser will usually wait for it to finish until it repaints the screen (There might be exceptions for extremely long running JavaScripts or in cases such as alert-boxes which effectively interrupt the JavaScript execution).
Consequences
Regular version:
Lets add some delay:
The delayed version shows that the browser paints twice although the two changes to the page are only 1/100 of a second a part.
Users want web apps that load fast and feel responsive. However, users have different thresholds into what they perceive as slow depending on the action that they do. E.g. an app should never do a lot of computation on a mouseover event because this might create a bad user experience while the user continues to move his mouse. However, users are used to accepting a little delay after they clicked on a button.
Thus it might make sense to move your initialization code to be executed as late as possible (e.g. when the user clicks a button that activates a particular component of your application).
Before: After:Introduction
The Strategy
Visual fidelity++ with HTML5
Hardware Acceleration
These aspects of your document can be accelerated by the GPU:
What can be accelerated?
You want to animate an element in the browser from left to right. The traditional approach to is to set a JavaScript timer and then repeatedly setting the "left" property of the style object every N milliseconds.
Now, you simply define the final position of the object and then tell the browser to perform an animation to the final destination over a certain period of time.
--show-composited-layer-borders
shows a red border around elements that are
being manipulated at the GPU level. Good for confirming your manipulations occur within the GPU layer.
--show-paint-rects
all non-GPU changes are painted and this throws
a light border around all areas that are repainted. You can see the browser optimizing paint areas in action.
CSS3 Transitions
"webkitTransitionEnd transitionend oTransitionEnd"
.
CSS3 Translate
translate()
functionality to replicate this behavior.

window.requestAnimationFrame
requestAnimationFrame
was introduced by Mozilla and iterated on by WebKit with the goal of providing you a native API for running animations, whether they be DOM/CSS-based or on <canvas>
or WebGL. The browser can optimize concurrent animations together into a single reflow and repaint cycle, leading to higher fidelity animation. For example, JS-based animations synchronized with CSS transitions or SVG SMIL. Plus, if you're running the animation loop in a tab that's not visible, the browser won't keep it running, which means less CPU, GPU, and memory usage, leading to much longer battery life.
requestAnimationFrame
, view Paul Irish's article requestAnimationFrame for smart animating.
Profiling
JavaScript Profiling
The DOM
function drawArray(array) {
for(var i = 0; i < array.length; i++) {
document.getElementById('test').innerHTML += array[i]; // No good :(
}
}
Tips and Tricks
Anonymous Functions
$('.stuff').each(function() { ... });
$('.stuff').each(function workOnStuff() { ... });
Profiling long functions
function myLongFunction() {
...
(function doAPartOfTheWork() {
...
})();
...
}
Don't forget to remove these extra functions after profiling is done; or even use them as a starting point to refactor your code.
DOM Profiling
Profiling Strategies
Single out aspects
GUI Profiling
Programatic Interface
console.profile()
console.profileEnd()
Repeatability
Measure, improve, measure
Optimization Strategies
Minimize DOM interaction
Cache DOM Nodes
function getElements() {
return $('.my-class');
}
var cachedElements;
function getElements() {
if (cachedElements) {
return cachedElements;
}
cachedElements = $('.my-class');
return cachedElements;
}
Cache Attribute Values
setInterval(function() {
var ele = $('#element');
var left = parseInt(ele.css('left'), 10);
ele.css('left', (left + 5) + 'px');
}, 1000 / 30);
var ele = $('#element');
var left = parseInt(ele.css('left'), 10);
setInterval(function() {
left += 5;
ele.css('left', left + 'px');
}, 1000 / 30);
Move DOM Manipulation Out of Loops
document.getElementById('target').innerHTML = '';
for(var i = 0; i < array.length; i++) {
var val = doSomething(array[i]);
document.getElementById('target').innerHTML += val;
}
var stringBuilder = [];
for(var i = 0; i < array.length; i++) {
var val = doSomething(array[i]);
stringBuilder.push(val);
}
document.getElementById('target').innerHTML = stringBuilder.join('');
Redraws and Reflows
function paintSlow() {
var left1 = $('#thing1').css('left');
$('#otherThing1').css('left', left);
var left2 = $('#thing2').css('left');
$('#otherThing2').css('left', left);
}
function paintFast() {
var left1 = $('#thing1').css('left');
var left2 = $('#thing2').css('left');
$('#otherThing1').css('left', left);
$('#otherThing2').css('left', left);
}
Redraws and the Event Loop
E.g. setTimeout(function() { ... }, 0)
This effectively tells the browser to execute the callback as soon as the event loop is idle again (effectively some browsers will wait at least 10ms). You need to be aware that this will create two JavaScript execution cycles which are very close together in time. Both might trigger a repaint of the screen which might double the overall time spent with painting. Whether this actually triggers two paints depends on heuristics in the browser.
function paintFast() {
var height1 = $('#thing1').css('height');
var height2 = $('#thing2').css('height');
$('#otherThing1').css('height', '20px');
$('#otherThing2').css('height', '20px');
}
function paintALittleLater() {
var height1 = $('#thing1').css('height');
var height2 = $('#thing2').css('height');
$('#otherThing1').css('height', '20px');
setTimeout(function() {
$('#otherThing2').css('height', '20px');
}, 10)
}
Lazy Initialization
var things = $('.ele > .other * div.className');
$('#button').click(function() { things.show() });
$('#button').click(function() { $('.ele > .other * div.className').show() });
Spreading event handlers across a page might take a relatively long time and can also be tedious once elements are dynamically replaced which then requires reattaching event handlers to the new elements.
The solution in this case is to use a technique called event delegation. Instead of attaching individual event handlers to elements, the bubbling nature of many browser events is used by actually attaching the event handler to a parent node and checking the target node of the event to see if the event is of interest.
In jQuery this can be easily expressed as:
$('#parentNode').delegate('.button', 'click', function() { ... });
Sometimes the opposite can be true: You are using event delegation and you're having a performance problem. Basically event delegation allows constant-complexity initialization time. However, the price of checking if an event is of interest has to be paid for every invocation of that event. This might come in expensive, especially for events that occur frequently like "mouseover" or even "mousemove".
$(document).ready
takes a long time
Malte's personal advice: Never do anything in $(document).ready
. Try to deliver your document in its final form. OK, you are allowed to register event listeners, but only using id-selector and/or using event delegation. For expensive events such as "mousemove", delay the registration until they are needed (mouseover event on the relevant element).
And if you really need to do stuff, such as making an Ajax request to get actual data, then show a nice animation; you might want to include the animation as a data URI if it is an animated GIF or the like.
Adding Flash to a page will always slow down rendering a little because the final layout of the window has to be "negotiated" between the browser and the Flash plugin. When you cannot completely avoid putting Flash on your pages, make sure you set the "wmode" Flash-parameter to the value "window" (which is the default). This will disable the ability to composite HTML and Flash elements (You won't be able to see an HTML element that lies above the Flash movie and your Flash movie cannot be transparent). This might be an inconvenience but it will dramatically improve your performance. For example check out the way that youtube.com carefully avoids placing layers above the main movie player.
Writing to localStorage is a synchronous operations that involves spinning up your hard disk. You never want to do "long running" synchronous operations while doing animations. Move the access to localStorage to a spot in your code where you are sure that the user is idle and no animations are going on.
First you want to make sure that your selector can be run through document.querySelectorAll. You can test that in the JavaScript console. If there is an exception rewrite your selector to not use any special extension of your JavaScript framework. This will speed up your selector in modern browsers by an order of magnitude.
If this doesn't help or if you also want to be fast in modern browsers, follow these guidelines:
A bunch of DOM node inserts, removes and updates can be really slow. This can generally be optimized by generating a large string of html and the using domNode.innerHTML = newHTML
to replace the old content. Note that this might be really bad for maintainability and might create memory links in IE so be careful.
Another common problem is that your initialization code might create a lot of HTML. E.g. a jQuery plugin that transforms a select box into a bunch of divs because that is what the design people wanted in ignorance of UX best practices. If you really want your page to be fast, never do that. Instead deliver all the markup from the server side in its final form. This again has many problems so think hard whether the speed is worth the tradeoff.


{% extends "_layout.html" %} {% load formatting %} {% block meta_title %}Sponsors and partners – {{ block.super }}{% endblock %} {% block main %} {% regroup sponsors_list by get_level_display as sponsor_levels %}
We’re grateful to companies that help us organize PyCon CZ and allow keeping ticket prices as low as possible.
Do you want to sponsor us too? Check out our offer or contact us.
{% for level in sponsor_levels %}


What city has the best climate?
When planning your trip or vacation you often check weather data for humidity and temperature.
Below is the collection of the yearly average values for the following cities:


A sample application demonstrating how to connect to Facebook and Twitter using the Kinvey AngularJS SDK.
Get Started


By accessing the website at {{portalUrl}}, you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this website are protected by applicable copyright and trademark law.
In no event shall Midnight Lizard or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on Midnight Lizard's website, even if Midnight Lizard or a Midnight Lizard authorized representative has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you.
The materials appearing on Midnight Lizard's website could include technical, typographical, or photographic errors. Midnight Lizard does not warrant that any of the materials on its website are accurate, complete or current. Midnight Lizard may make changes to the materials contained on its website at any time without notice. However Midnight Lizard does not make any commitment to update the materials.
Midnight Lizard has not reviewed all of the sites linked to its website and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by Midnight Lizard of the site. Use of any such linked website is at the user's own risk.
Midnight Lizard may revise these terms of service for its website at any time without notice. By using this website you are agreeing to be bound by the then current version of these terms of service.


by ANIKA
Posted on January 1, 2019 at 12:00 PM
There’s a good reason why office designing ideas always change with the times. Your office tells a story about you and your brand to the people who visit it. You want it to be good, don’t you? No one wants their potential hire or top client to enter a workspace and think, “Did I just travel back in time to my dad’s old cubicle farm?”
Implementing well-though-out office designing ideas can not only impress your partners and give your business credibility, it is also the key to improve employee morale and productivity. After all, good office design will always bring together form and functionality to make that aesthetically inviting environment where people feel comfortable working in.

Don’t worry, you’ve come to the right place as we were lucky enough to catch up with most talented voice in the A&D industry to discuss how to decorate that ideal workplace:
Don’t worry, you’ve come to the right place as we were lucky enough to catch up with 4 of the most talented voices in the A&D industry to discuss how to decorate that ideal workplace:
ALL comments
| name | Comment |


«Vestibulum quis porttitor dui! Quisque viverra nunc mi, a pulvinar purus condimentum a. Aliquam condimentum mattis neque sed pretium»
Compellingly actualize fully researched processes before proactive outsourcing. Progressively syndicate collaborative architectures before cutting-edge services. Completely visualize parallel core competencies rather than exceptional portals.
© 2017 Brand All Rights Reserved.


@LogMethods public class ResourceHelper extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PATH_SEPARATOR
|
static boolean |
RESOURCES_ARE_IN_JAR
|
static java.net.URL |
RESOURCES_URL
The path to the default, root Resources location.
|
| Constructor and Description |
|---|
ResourceHelper()
|
| Modifier and Type | Method and Description |
|---|---|
static java.io.InputStream |
getResource(java.lang.String _path)
Gets a single Resource file, as an
InputStream . |
static java.lang.String |
getResourceAsString(java.lang.String _path,
java.nio.charset.Charset _charset)
Gets a single Resource file, as a
String . |
static java.util.Set<java.io.InputStream> |
getResources(java.lang.String _path)
Gets a concurrent collection of Resource files, as
InputStream s, from a given Resource
folder Path.
|
static java.util.Set<java.nio.file.Path> |
getResourcesAsPaths(java.lang.String _path)
Gets a concurrent collection of Resource file
Path s, from a given Resource folder Path.
|
static java.util.Set<java.lang.String> |
getResourcesAsStrings(java.lang.String _path,
java.nio.charset.Charset _charset)
Gets a concurrent collection of Resource files, as
String s, from a given Resource folder
Path.
|
public static final boolean RESOURCES_ARE_IN_JAR
public static final java.lang.String PATH_SEPARATOR
public static final java.net.URL RESOURCES_URL
public static java.io.InputStream getResource(java.lang.String _path)
InputStream
._path
- The path to the Resource file to return.
(The path must start at the Resource folder [exclusive], use only forward slashes, and be prefixed with a forward slash.)
(i.e. If the resource is src\main\resources\resource_folder\reource_file.txt, then you will pass in "/resource_folder/reource_file.txt".)
(Note: the passed in path will be trimmed, prefixed with a forward slash if needed, and all backslashes will be replaced with forward slashes.)
InputStream
, because the resource my be in a Jar;
or null
, if the resource was not found.
java.lang.IllegalArgumentException
- If the given Path is blank.public static java.lang.String getResourceAsString(java.lang.String _path, java.nio.charset.Charset _charset)
String
._path
- The path to the Resource file to return.
(The path must start at the Resource folder [exclusive], use only forward slashes, and be prefixed with a forward slash.)
(i.e. If the resource is src\main\resources\resource_folder\reource_file.txt, then you will pass in "/resource_folder/reource_file.txt".)
(Note: the passed in path will be trimmed, prefixed with a forward slash if needed, and all backslashes will be replaced with forward slashes.)
_charset
- The encoding if the file to return, as a string.String
; or null
, if the resource was not found.java.lang.IllegalArgumentException
- If the given Path is blank or if the given Charset is
null
.
public static java.util.Set<java.io.InputStream> getResources(java.lang.String _path)
InputStream
s, from a given Resource folder
Path.
Note: This will only return files that are diretly under the given Resource folder, but no files in subfolders.
_path
- The path to a Resource folder, to parse for files.
(The path must start at the Resource folder [exclusive], use only forward slashes, and be prefixed ans suffixed with a forward slash.)
(i.e. If the resource is src\main\resources\resource_folder, then you will pass in "/resource_folder/".)
(Note: the passed in path will be trimmed, prefixed/suffixed with a forward slash if needed, and all backslashes will be replaced with forward slashes.)
InputStream
s (because the
resource my be in a Jar);
or null
, if the Resource folder was not found, or an empty collection, if the Resource folder had no files.
java.lang.IllegalArgumentException
- If the given Path is blank.public static java.util.Set<java.lang.String> getResourcesAsStrings(java.lang.String _path, java.nio.charset.Charset _charset)
String
s, from a given Resource folder Path.
Note: This will only return files that are diretly under the given Resource folder, but no files in subfolders.
_path
- The path to a Resource folder, to parse for files.
(The path must start at the Resource folder [exclusive], use only forward slashes, and be prefixed ans suffixed with a forward slash.)
(i.e. If the resource is src\main\resources\resource_folder, then you will pass in "/resource_folder/".)
(Note: the passed in path will be trimmed, prefixed/suffixed with a forward slash if needed, and all backslashes will be replaced with forward slashes.)
_charset
- The encoding if the file to return, as a string.String
s;
or null
, if the Resource folder was not found, or an empty collection, if the Resource folder had no files.
java.lang.IllegalArgumentException
- If the given Path is blank or if the given Charset is
null
.
public static java.util.Set<java.nio.file.Path> getResourcesAsPaths(java.lang.String _path)
Path
s, from a given Resource folder Path.
Note: This will only return files that are diretly under the given Resource folder, but no files in subfolders.
_path
- The path to a Resource folder, to parse for files.
(The path must start at the Resource folder [exclusive], use only forward slashes, and be prefixed ans suffixed with a forward slash.)
(i.e. If the resource is src\main\resources\resource_folder, then you will pass in "/resource_folder/".)
(Note: the passed in path will be trimmed, prefixed/suffixed with a forward slash if needed, and all backslashes will be replaced with forward slashes.)
Path
s;
or null
, if the Resource folder was not found, or an empty collection, if the Resource folder had no files.
java.lang.IllegalArgumentException
- If the given Path is blank.


Welcome to COVID-19 Predictor
Income
Age 45-74 %
Gender: Male %
Health Insurance %
Pop-Density
Test per 100 People
Submit


The Jackrabbit API extensions provide various methods to edit and explore the member relationship of users and groups:
org.apache.jackrabbit.api.security.user.Group
org.apache.jackrabbit.api.security.user.Authorizable
With the default configuration Jackrabbit 2.x stores the group members as weak references in a rep:members multi value property in the group node. If the groupMembershipSplitSize configuration parameter is set and valid, the group memberships are collected in a node structure below rep:members instead of the default multi valued property. Its value determines the maximum number of member properties until additional intermediate nodes are inserted. Valid parameter values are integers > 4. The node structure is a balanced b-tree where only the leave nodes carry the actual values in residual properties which name is the principal name of the member.
As of Oak the user manager automatically chooses an appropriate storage structure depending on the number of group members. If the number of members is low they are stored as weak references in a rep:members multi value property. This is similar to Jackrabbit 2.x. If the number of members is high the user manager will limit the size of the multi value properties and create overflow rep:MemberReferences nodes below a rep:membersList node to hold the extra members.
[rep:Group] > rep:Authorizable, rep:MemberReferences + rep:members (rep:Members) = rep:Members multiple protected VERSION /* @deprecated */ + rep:membersList (rep:MemberReferencesList) = rep:MemberReferencesList protected COPY [rep:MemberReferences] - rep:members (WEAKREFERENCE) protected multiple < 'rep:Authorizable' [rep:MemberReferencesList] + * (rep:MemberReferences) = rep:MemberReferences protected COPY
(irrelevant properties excluded)
{ "jcr:primaryType": "rep:Group", "rep:principalName": "contributor", "rep:members": [ "429bbd5b-46a6-3c3d-808b-5fd4219d5c4d", "ca58c408-fe06-357e-953c-2d23ffe1e096", "3ebb1c04-76dd-317e-a9ee-5164182bc390", "d3c827d3-4db2-30cc-9c41-0ed8117dbaff", "f5777a0b-a933-3b4d-9405-613d8bc39cc7", "fdd1547a-b19a-3154-90da-1eae8c2c3504", "65c3084e-abfc-3719-8223-72c6cb9a3d6f" ] }
(irrelevant properties excluded)
{ "jcr:primaryType": "rep:Group", "rep:principalName": "employees", "rep:membersList": { "jcr:primaryType": "rep:MemberReferencesList", "0": { "jcr:primaryType": "rep:MemberReferences", "rep:members": [ "429bbd5b-46a6-3c3d-808b-5fd4219d5c4d", "ca58c408-fe06-357e-953c-2d23ffe1e096", ... ] }, ... "341": { "jcr:primaryType": "rep:MemberReferences", "rep:members": [ "fdd1547a-b19a-3154-90da-1eae8c2c3504", "65c3084e-abfc-3719-8223-72c6cb9a3d6f", ... ] } } }
Note: The exact threshold value that determines the storage strategy is an implementation detail and might even vary depending on the underlying persistence layer. In Oak 1.0 the threshold value is set to 100.
Upon upgrade from a Jackrabbit 2.x repository to OAK the group member lists that adjusted to reflect the new content structure as created by the OAK user management implementation; this means that the group member node structure will be changed by the migration process. Applications that rely on these implementation details of Jackrabbit 2.x user management instead of use the corresponding API calls will need to be modified accordingly.
Importing group members through the import methods in javax.jcr.Session or javax.jcr.Workspace is storage agnostic and supports both, property based and node based, strategies and is backward compatible to content exported from Jackrabbit 2.x. The group member lists that are modified during an import are internally processed using the normal user manager APIs. This implies that the node structure after the import might not be the same as the one represented in the input.
Since Oak 1.3.4 the default user management implementation also allows to modify group membership by specifying the member id(s) (see JCR-3880 and OAK-3170). The following details are worth mentioning:
Adding a different implementation of Authorizable is not allowed. This is always verified when calling Group.addMember(Authorizable).
Adding the target group as member of itself will not succeed. When adding members by ID (Group.addMembers(String...)) the violation is spotted by simple ID comparison.
The group representing the EveryonePrincipal is specially handled. Due to it’s dynamic nature adding members to this group is not allowed and adding it as a member to any other group would cause a cyclic membership.
Note however, that this validation is omitted in case of Group.addMembers(String...) with ImportBehavior.BESTEFFORT (see above).
Since Oak 1.7.0 the explicit check for cyclic group membership has been moved from the Validator to the Group implementation. As before cyclic membership might not be spotted and the membership resolution will log the cycle upon collection of all members/groups.
The following scenarios may leave the cycle unnoticed upon adding members: - Group.addMember(Authorizable) when the editing Session cannot read all groups included in the cycle. - Group.addMembers(String...) with ImportBehavior.BESTEFFORT where the member ID is not resolved.
See OAK-3170 for additional information.
Note that as of Oak 1.0 the implementation is responsible for defining the content structure and will expand the multi-valued rep:members property accordingly. Consequently, the following configuration option groupMembershipSplitSize present with Jackrabbit 2.x is not supported anymore.


an object-oriented computer programming language commonly used to create interactive effects within web browsers.
The typeof operator evaluates to "number", "string", or "boolean" if its operand is a number, string, or boolean
value and returns true or false based on the evaluation. Here is a list of the return values for the typeof Operator. Type. String
Returned by typeof. Number.
Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container. Before you use a variable in a JavaScript program, you must declare it. Variables are declared with the var keyword as follows.
Coding conventions are style guidelines for programming
Functions are one of the fundamental building blocks in JavaScript. A function is a JavaScript procedure—a set of statements that performs a task or calculates a value. To use a function, you must define it somewhere in the scope from which you wish to call it.
a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation).
A JavaScript method is a property containing a function definition.
The arguments object is a local variable available within all functions. You can refer to a function's arguments within the function by using the arguments object.
a numerical or other measurable factor forming one of a set that defines a system or sets the conditions of its operation.
Method chaining is a technique that can be used to simplify code in scenarios that involve calling multiple functions on the same object consecutively.
a binary variable, having two possible values called “true” and “false.”
In JavaScript there is Undefined (type), undefined (value) and undefined (variable). Undefined (type) is a built-in JavaScript type. undefined (value) is a primitive and is the sole value of the Undefined type. Any property that has not been assigned a value, assumes the undefined value.
The NaN property represents "Not-a-Number" value. This property indicates that a value is not a legal number
escape() function computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.
The alert() method displays an alert box with a specified message and an OK button.An alert box is often used if you want to make sure information comes through to the user.
JavaScript comments can be used to explain JavaScript code
Query is a cross-platform JavaScript library designed to simplify the client-side scripting of HTML. It is free, open-source software using the permissive MIT License.
Attributes provide additional information about HTML elements.
In JavaScript, return statements cease execution in a function and return a value to the caller; JavaScript functions require an explicit return statement for returning the result of an expression (the value) from a function.


--- layout: post title: In the woods date: '2018-04-10T11:30:23+02:00' categories: - Sketchbooks - Sketches - Klare Lijn — Ligne Claire picture_url: https://film-Storyboards.tumblr.com/post/172796778534/agenda-sketch ---


public class Node
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.util.ArrayList<Node> |
neigh
Array List carrying the pointers to the child nodes
|
int |
nodeID
Integer variable for unique nodeID
|
private Node |
parent
Pointer to parent Node
|
| Constructor and Description |
|---|
Node()
Constructor method
|
Node(int ID)
Constructor takes the nodeID and creates an empty ArrayList to store neighbour.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNeigh(Node newNeigh)
Adds a neighbor to the node.
|
java.util.ArrayList<Node> |
getNeigh()
Method to get the neighboring nodes (as an ArrayList of type Node)
|
int |
getNodeID()
Gets the NodeID
|
Node |
getParent()
Gets the parent node.
|
private boolean |
isNeighbour(Node node)
Checks if the given node is a neighbor.
|
void |
removeAllNeighbours()
Removes the all neighbors.
|
void |
removeNeigh(int rmNodeID)
Removes the neighbor with given node ID.
|
void |
setNodeID(int nodeID)
Sets the NodeID.
|
private void |
setParent(Node parent)
Sets the parent of the node.
|
public int nodeID
private Node parent
protected java.util.ArrayList<Node> neigh
public Node()
public Node(int ID)
ID
- The node ID for the new nodepublic java.util.ArrayList<Node> getNeigh()
public int getNodeID()
public void setNodeID(int nodeID)
nodeID
- the new node idpublic Node getParent()
public void addNeigh(Node newNeigh)
newNeigh
- The new neighboring nodepublic void removeAllNeighbours()
public void removeNeigh(int rmNodeID)
rmNodeID
- the nodeID of the node to be removedprivate void setParent(Node parent)
parent
- the new parentprivate boolean isNeighbour(Node node)
node
- the node