<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6715598735361401237</atom:id><lastBuildDate>Fri, 24 Jul 2026 05:58:53 +0000</lastBuildDate><category>genetics</category><category>animalScience</category><category>R</category><category>statistics</category><category>computers</category><category>si</category><category>graphics</category><category>web</category><category>study</category><category>gheep</category><category>writings</category><category>LaTeX</category><category>video</category><category>LyX-Sweave</category><category>Sweave</category><category>agriculture</category><category>linux</category><category>life</category><category>talks</category><category>cattle</category><category>LyX</category><category>Sweave.sh</category><category>BUGS</category><category>shell</category><category>SAS</category><category>science</category><category>biology</category><category>joke</category><category>INLA</category><category>Python</category><category>honeyBee</category><category>horses</category><category>Mac</category><category>data</category><category>music</category><category>plantScience</category><category>plants</category><category>poultry</category><category>rabbits</category><title>Gregor Gorjanc (gg)</title><description>About various things that cross my mind</description><link>http://ggorjan.blogspot.com/</link><managingEditor>noreply@blogger.com (Gorjanc Gregor)</managingEditor><generator>Blogger</generator><openSearch:totalResults>369</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-4398892732236446627</guid><pubDate>Sun, 01 Oct 2023 18:34:00 +0000</pubDate><atom:updated>2023-10-01T22:02:59.003+02:00</atom:updated><title>Overload of the term &quot;additive&quot; in quantitative genetics</title><description>The following discussion came up on SLiM (&lt;a href=&quot;https://messerlab.org/slim/&quot;&gt;https://messerlab.org/slim/&lt;/a&gt;) mailing list (&lt;a href=&quot;https://groups.google.com/g/slim-discuss&quot;&gt;https://groups.google.com/g/slim-discuss&lt;/a&gt;), which I think is highly indicative of confusion among many of us about additive and non-additive gene effects, additive and non-additive genetic values, and corresponding additive and non-additive genetic variances. Doh!&lt;br /&gt;&lt;br /&gt;It started by a common comment that there is not much non-additive genetic variation, so maybe we can ignore non-additive gene action in simulations. While this is often done, it&#39;s important to be careful about how the term &quot;additive&quot; and &quot;non-additive&quot; are used, which I think is leading to lots of confusion among many (including me).&lt;br /&gt;&lt;br /&gt;Let&#39;s see how the term &quot;additive&quot; is used in multiple ways in quantitative genetics!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1) The quantitative genetics model&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;phenotypic_value = intercept + genetic_value + environmental_value&lt;br /&gt;&lt;br /&gt;is additive by construction to being with, but nobody mentions this - it&#39;s likely that biology is not so linear! But, this gives an &quot;additive&quot; model that we can work with well and it seems to be giving us good predictions for many quantities.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2) The decomposition of genetic value&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;genetic_value = additive_genetic_value + dominance_deviation + epistasis_deviation,&lt;br /&gt;&lt;br /&gt;is again additive by construction (we are summing up things), but let’s move to the additive_genetic_value (=breeding value), which is allele substitution effect (alpha) multiplied by allele dosage (if dosages are, say, 0, 1, and 2, then we have 0alpha, 1alpha, 2alpha) for each locus and then summed over all causal loci. There are two &quot;additivities&quot; here (in addition to the additive decomposition of the phenotypic value and the genetic value!) - adding up allele substitution effects within a locus, and then across the loci.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3) The allele substitution effects and gene action&lt;/b&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Allele substitution effects are obtained by a linear (=additive) regression of phenotypic values onto allele dosages, which (in a randomly mating population and without epistasis and GxE, but with dominance) turns out to be:&lt;br /&gt;&lt;br /&gt;alpha = a + d(q-p),&lt;br /&gt;&lt;br /&gt;where -a and +a are values for the two homozygotes (with &quot;origin&quot; in the middle) and d is a value of the heterozygote relative to the &quot;origin&quot; - this is the standard quantitative genetics parameterization (see Falconer &amp;amp; MacKay green book page 109 - in the 1996 version). These -a, d, and +a values are the values of genotypes (genetic values) in the first (phenotype) model shown at the top. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;The a value above is sometimes referred to as an additive gene action at a locus, and d as a dominant gene action at a locus. &lt;br /&gt;&lt;/b&gt;&lt;br /&gt;So, the above case shows ~5 uses of &quot;additivity&quot;, but the show goes on! We typically see that variance of dominance deviations, and likely also epistatic deviations, is small, so we can conclude that non-additive genetic variance can be ignored? It depends! I think we need to distinguish between:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;A) what is happening in reality&lt;/b&gt; - we don&#39;t really know, but clearly biology is highly non-linear (=non-additive), BUT 1st order approximations (=additive) will capture the majority of variation&lt;br /&gt;&lt;br /&gt;&lt;b&gt;B) what we simulate&lt;/b&gt; - relevant discussion in the mailing list, but we want simulations to mimic A, but we can only set parameters based on C (see next)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;C) what we can estimate from the data&lt;/b&gt; - indeed many studies find that the variance of breeding values seems to explain most of the variance in genetic values, leading to the usual statement that most of &quot;genetic variance is additive&quot;, BUT there is a caveat that breeding values are a 1st order approximation and as such capture additive and some of the non-additive gene effects. Studies that report dominance variance, technically variance between dominance deviations (the part not captured by breeding values - and note that breeding values capture some dominance variation!), often report small values, again indicating that most variation is &quot;additive&quot;. BUT, some of these studies are underpowered to get accurate estimates of variance between dominance deviations. On the other hand, there is quite a lot of studies of inbreeding depression and heterosis, indicating that there must/should be dominant gene effects (there are different hypothesis about this too that I will not go into!). I know that there is a substantial inbreeding depression in maize inbred lines, which then generates very large heterosis in their hybrids. Then, I guess sometimes there are real dominant gene effects, but selection is keeping allele frequency of unfavorable mutations low (so we only rarely see unfavorable/unfavorable genotype!), meaning that observed variance between dominance deviations at that locus will be low ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;So, all this &quot;additivity&quot; is convoluted.&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;These two papers touch on some of these points (there is lots more literature about this topic!):&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Data and Theory Point to Mainly Additive Genetic Variance for Complex Traits&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1000008&quot;&gt;https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1000008&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Genetic Architecture of Quantitative Traits Cannot Be Inferred from Variance Component Analysis&lt;/b&gt;&lt;br /&gt;&lt;a href=&quot;https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1006421&quot;&gt;https://journals.plos.org/plosgenetics/article?id=10.1371/journal.pgen.1006421&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://ggorjan.blogspot.com/2023/10/overload-of-term-additive-in.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-6271454754921365917</guid><pubDate>Fri, 11 Nov 2022 18:12:00 +0000</pubDate><atom:updated>2022-11-11T19:12:36.071+01:00</atom:updated><title>Find ancestor (R function)</title><description>&lt;p&gt;We have a pedigree and want to find a sub-pedigree that lists the ancestors of some individuals. Here is an R function for this, but first, lets show an example:&lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot; data-stringify-type=&quot;pre&quot; style=&quot;--saf-0: rgba(var(--sk_foreground_low,29,28,29),0.13); background: rgba(var(--sk_foreground_min,29,28,29),0.04); border-radius: 4px; border: 1px solid var(--saf-0); box-sizing: inherit; counter-reset: list-0 0 list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace !important; font-size: 12px; font-variant-ligatures: none; line-height: 1.50001; margin-bottom: 4px; margin-top: 4px; orphans: 2; overflow-wrap: break-word; padding: 8px; tab-size: 4; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2; word-break: normal;&quot;&gt;library(package = &quot;pedigreemm&quot;)
library(package = &quot;graph&quot;)
library(package = &quot;Rgraphviz&quot;)

ped &amp;lt;- data.frame( id = c(  1,   2,   3,   4,   5,   6,   7,   8,   9,  10),
                  fid = c( NA,  NA,   2,   2,   4,   2,   5,   5,  NA,   8),
                  mid = c( NA,  NA,   1,  NA,   3,   3,   6,   6,  NA,   9))
ped2 &amp;lt;- with(ped, pedigree(sire = fid, dam = mid, label = id))
g &amp;lt;- as(t(as(ped2, &quot;sparseMatrix&quot;)), &quot;graph&quot;)
plot(g)&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmCI_gN71gETMRWRuO1N24fRX_QaCnv_7FVwIR5ufH0EAln8GikJwIsCA_XX7MemQPZB_Z8B9m9gdepyjNXNr623Tv6sV5qXu3UXHQJ724vdK6gy-iHOqDTKYMDSoumyDHIG4sCH8ROD_H-L0KP6VfgjDagU3VEtg3cFQkAzeKjKoxeIQqEqezsByPAA/s811/Screenshot%202022-11-11%20at%2017.42.13.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;604&quot; data-original-width=&quot;811&quot; height=&quot;238&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmCI_gN71gETMRWRuO1N24fRX_QaCnv_7FVwIR5ufH0EAln8GikJwIsCA_XX7MemQPZB_Z8B9m9gdepyjNXNr623Tv6sV5qXu3UXHQJ724vdK6gy-iHOqDTKYMDSoumyDHIG4sCH8ROD_H-L0KP6VfgjDagU3VEtg3cFQkAzeKjKoxeIQqEqezsByPAA/s320/Screenshot%202022-11-11%20at%2017.42.13.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Now the function&lt;p&gt;&lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot; data-stringify-type=&quot;pre&quot; style=&quot;--saf-0: rgba(var(--sk_foreground_low,29,28,29),0.13); background: rgba(var(--sk_foreground_min,29,28,29),0.04); border-radius: 4px; border: 1px solid var(--saf-0); box-sizing: inherit; counter-reset: list-0 0 list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace !important; font-size: 12px; font-variant-ligatures: none; line-height: 1.50001; margin-bottom: 4px; margin-top: 4px; orphans: 2; overflow-wrap: break-word; padding: 8px; tab-size: 4; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2; word-break: normal;&quot;&gt;traceAncestors &amp;lt;- function(ids, ped, missing = NA) {
  # ids - a vector of individuals, possibly not unique
  # ped - data.frame of global pedigree with id, father, and mother columns
  
  # Take pedigree rows for ids
  sel &amp;lt;- ped[[1]] %in% ids
  ret &amp;lt;- ped[sel, ]
  # Find their parents (new ids)
  ids &amp;lt;- c(ped[[2]][sel], ped[[3]][sel])
  # ... that are unique and known
  ids &amp;lt;- unique(ids[!ids %in% missing])
  # ... that are not ids already
  ids &amp;lt;- ids[!ids %in% ret[[1]]]
  
  # Loop
  while (length(ids) &amp;gt; 0) {
    # Take pedigree rows for new ids
    sel &amp;lt;- ped[[1]] %in% ids
    ret &amp;lt;- rbind(ped[sel, ], ret)
    # Find their parents (new ids)
    ids &amp;lt;- c(ped[[2]][sel], ped[[3]][sel])
    # ... that are unique and known
    ids &amp;lt;- unique(ids[!ids %in% missing])
    # ... that are not ids already
    ids &amp;lt;- ids[!ids %in% ret[[1]]]
  }
  return(ret)
}&lt;/pre&gt;&lt;p&gt;And a few examples&lt;/p&gt;&lt;pre class=&quot;c-mrkdwn__pre&quot; data-stringify-type=&quot;pre&quot; style=&quot;--saf-0: rgba(var(--sk_foreground_low,29,28,29),0.13); background: rgba(var(--sk_foreground_min,29,28,29),0.04); border-radius: 4px; border: 1px solid var(--saf-0); box-sizing: inherit; counter-reset: list-0 0 list-1 0 list-2 0 list-3 0 list-4 0 list-5 0 list-6 0 list-7 0 list-8 0 list-9 0; font-family: Monaco, Menlo, Consolas, &amp;quot;Courier New&amp;quot;, monospace !important; font-size: 12px; font-variant-ligatures: none; line-height: 1.50001; margin-bottom: 4px; margin-top: 4px; orphans: 2; overflow-wrap: break-word; padding: 8px; tab-size: 4; text-decoration-thickness: initial; white-space: pre-wrap; widows: 2; word-break: normal;&quot;&gt;&amp;gt; traceAncestors(ids = 4, ped = ped)
  id fid mid
2  2  NA  NA
4  4   2  NA
&amp;gt; 
&amp;gt; traceAncestors(ids = 6, ped = ped)
  id fid mid
1  1  NA  NA
2  2  NA  NA
3  3   2   1
6  6   2   3
&amp;gt; 
&amp;gt; traceAncestors(ids = c(4, 6), ped = ped)
  id fid mid
1  1  NA  NA
2  2  NA  NA
3  3   2   1
4  4   2  NA
6  6   2   3
&amp;gt; 
&amp;gt; traceAncestors(ids = c(4, 6, 10), ped = ped)
   id fid mid
1   1  NA  NA
5   5   4   3
2   2  NA  NA
3   3   2   1
8   8   5   6
9   9  NA  NA
4   4   2  NA
6   6   2   3
10 10   8   9 &lt;/pre&gt;</description><link>http://ggorjan.blogspot.com/2022/11/find-ancestor-r-function.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmCI_gN71gETMRWRuO1N24fRX_QaCnv_7FVwIR5ufH0EAln8GikJwIsCA_XX7MemQPZB_Z8B9m9gdepyjNXNr623Tv6sV5qXu3UXHQJ724vdK6gy-iHOqDTKYMDSoumyDHIG4sCH8ROD_H-L0KP6VfgjDagU3VEtg3cFQkAzeKjKoxeIQqEqezsByPAA/s72-c/Screenshot%202022-11-11%20at%2017.42.13.png" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-3243519317469981147</guid><pubDate>Mon, 18 Jul 2022 12:08:00 +0000</pubDate><atom:updated>2022-07-18T14:08:44.998+02:00</atom:updated><title></title><description>&lt;p&gt;&amp;nbsp;This blog is clearly dead. Follow me at&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://twitter.com/GregorGorjanc&quot;&gt;https://twitter.com/GregorGorjanc&lt;/a&gt;&lt;/p&gt;&lt;p&gt;or&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://www.ed.ac.uk/roslin/highlanderlab&quot;&gt;https://www.ed.ac.uk/roslin/highlanderlab&lt;/a&gt;&lt;/p&gt;</description><link>http://ggorjan.blogspot.com/2022/07/blog-is-clearly-dead.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-5478907223860537697</guid><pubDate>Tue, 25 Aug 2015 15:04:00 +0000</pubDate><atom:updated>2015-08-25T17:04:53.685+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">computers</category><category domain="http://www.blogger.com/atom/ns#">Mac</category><title>Remove Spotify App Badges on Mac</title><description>See &lt;a href=&quot;http://apple.stackexchange.com/questions/153182/remove-dock-notification-badge-for-apps-not-in-notification-center&quot;&gt;here&lt;/a&gt;</description><link>http://ggorjan.blogspot.com/2015/08/remove-spotify-app-badges-on-mac.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-7752269634927720795</guid><pubDate>Thu, 13 Aug 2015 21:04:00 +0000</pubDate><atom:updated>2015-08-13T23:04:33.126+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">animalScience</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">science</category><category domain="http://www.blogger.com/atom/ns#">writings</category><title>Reliability of pedigree-based and genomic evaluations in selected populations</title><description>Paper on &quot;&lt;a href=&quot;http://www.gsejournal.org/content/47/1/65&quot;&gt;Reliability of pedigree-based and genomic evaluations in selected populations&lt;/a&gt;&quot; has finally been published after tedious reviews. This work is a follow up study on reliability of genetic evaluation in selected populations by Piter Bijma (&lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/j.1439-0388.2012.00991.x/abstract&quot;&gt;link&lt;/a&gt;), but this time connecting pedigree-based and genomic evaluations. The take-home message is that PEV-based reliabilities of genomic predictions are not so much affected by selection as pedigree predictions. This has implications when different breeding program designs are compared using PEV reliabilities - commonly PEV reliability of genomic and pedigree predictions are compared - and suggests that genotyping female selection candidates has been undervalued and should be reconsidered.</description><link>http://ggorjan.blogspot.com/2015/08/reliability-of-pedigree-based-and.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-276915728157627519</guid><pubDate>Thu, 21 May 2015 00:53:00 +0000</pubDate><atom:updated>2015-05-21T02:53:18.241+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">animalScience</category><category domain="http://www.blogger.com/atom/ns#">science</category><category domain="http://www.blogger.com/atom/ns#">video</category><title>Lush Visions Symposium - Animal Breeding Plans - videos</title><description>&lt;a href=&quot;http://www.ans.iastate.edu/events/Lushsymp/?pg=videos&quot;&gt;Here&lt;/a&gt;.</description><link>http://ggorjan.blogspot.com/2015/05/lush-visions-symposium-animal-breeding.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-122622734086992941</guid><pubDate>Mon, 16 Mar 2015 20:44:00 +0000</pubDate><atom:updated>2015-03-16T21:44:01.946+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">agriculture</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">plantScience</category><category domain="http://www.blogger.com/atom/ns#">video</category><title>Plant breeding and genetics club videos</title><description>&lt;a href=&quot;http://www.k-state.edu/pbg/&quot;&gt;Plant breeding and genetics club&lt;/a&gt; at K-state have a nice website, which hosts &lt;a href=&quot;http://www.k-state.edu/pbg/events/&quot;&gt;videos&lt;/a&gt; from the symposia they organised (there was one in 2013 and one is planned for 2015).</description><link>http://ggorjan.blogspot.com/2015/03/plant-breeding-and-genetics-club-videos.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-4193282061427949428</guid><pubDate>Fri, 06 Mar 2015 23:13:00 +0000</pubDate><atom:updated>2015-03-07T00:13:39.588+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">agriculture</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">science</category><category domain="http://www.blogger.com/atom/ns#">writings</category><title>Potential of genotyping-by-sequencing for genomic selection in livestock populations</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;
Our new paper titled &quot;&lt;b&gt;&lt;a href=&quot;http://www.gsejournal.org/content/47/1/12&quot;&gt;Potential of genotyping-by-sequencing for genomic selection in livestock populations&lt;/a&gt;&lt;/b&gt;&quot; has been published in Genetics Selection Evolution. This work shows that genotypes called from low-coverage sequencing data can be equally or even more powerful for genomic prediction than high-quality SNP genotypes. In particular manipulation of coverage allows us to increase number of genotyped individuals at the expense of genotype quality and this can bring us a long way before accuracy of genomic predictions falls significantly. Another useful application is in increasing selection intensity by genotyping more/all selection candidates.&lt;/div&gt;
</description><link>http://ggorjan.blogspot.com/2015/03/potential-of-genotyping-by-sequencing.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-7906975443083508784</guid><pubDate>Thu, 15 Jan 2015 22:21:00 +0000</pubDate><atom:updated>2015-01-15T23:21:19.575+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">web</category><title>Twitter and Youtube channels</title><description>You can follow me on &lt;a href=&quot;https://twitter.com/GregorGorjanc&quot;&gt;Twitter&amp;nbsp;&lt;/a&gt;&lt;complete id=&quot;goog_1889597251&quot;&gt;&lt;a href=&quot;https://twitter.com/GregorGorjanc&quot;&gt;@GregorGorjanc&lt;/a&gt; as well as on &lt;a href=&quot;https://www.youtube.com/channel/UC7xuyMGm_G9LI4VZzYJGkfw&quot;&gt;YouTube&lt;/a&gt;.&lt;/complete&gt;</description><link>http://ggorjan.blogspot.com/2015/01/twitter-and-youtube-channels.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-459348267990504349</guid><pubDate>Thu, 15 Jan 2015 22:16:00 +0000</pubDate><atom:updated>2015-01-15T23:16:33.637+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">computers</category><category domain="http://www.blogger.com/atom/ns#">R</category><category domain="http://www.blogger.com/atom/ns#">shell</category><title>cpumemlog: Monitor CPU and RAM usage of a process (and its children)</title><description>Long time no see ...&lt;br /&gt;
&lt;br /&gt;
Today I pushed the cpumemlog script to GitHub&amp;nbsp;&lt;a href=&quot;https://github.com/gregorgorjanc/cpumemlog&quot;&gt;https://github.com/gregorgorjanc/cpumemlog&lt;/a&gt;. Read more about this useful utility at the GitHub site.</description><link>http://ggorjan.blogspot.com/2015/01/cpumemlog-monitor-cpu-and-ram-usage-of.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-1229409741858164701</guid><pubDate>Sun, 01 Dec 2013 22:55:00 +0000</pubDate><atom:updated>2013-12-01T23:55:04.376+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">computers</category><category domain="http://www.blogger.com/atom/ns#">R</category><title>Read line by line of a file in R</title><description>Are you using R for data manipulation for later use with other programs, i.e., a workflow something like this:&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;read data sets from a disk,&lt;/li&gt;
&lt;li&gt;modify the data, and&lt;/li&gt;
&lt;li&gt;write it back to a disk.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
All fine, but of data set is really big, then you will soon stumble on memory issues. If data processing is simple and you can read only chunks, say only line by line, then the following might be useful:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div style=&quot;overflow: auto;&quot;&gt;
&lt;div class=&quot;geshifilter&quot;&gt;
&lt;pre class=&quot;r geshifilter-R&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## File&lt;/span&gt;
&lt;a href=&quot;http://inside-r.org/r-doc/base/file&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;file&lt;/span&gt;&lt;/a&gt; &amp;lt;- &lt;span style=&quot;color: blue;&quot;&gt;&quot;myfile.txt&quot;&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Create connection&lt;/span&gt;
con &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/file&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;file&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;description=&lt;a href=&quot;http://inside-r.org/r-doc/base/file&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;file&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;a href=&quot;http://inside-r.org/r-doc/base/open&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;open&lt;/span&gt;&lt;/a&gt;=&lt;span style=&quot;color: blue;&quot;&gt;&quot;r&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Hopefully you know the number of lines from some other source or&lt;/span&gt;
com &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/paste&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;paste&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;wc -l &quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;a href=&quot;http://inside-r.org/r-doc/base/file&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;file&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&quot; | awk &#39;{ print $1 }&#39;&quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; sep=&lt;span style=&quot;color: blue;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
n &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/system&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;system&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;command=com&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; intern=&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Loop over a file connection&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;for&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;i &lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;:n&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
  tmp &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/scan&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;scan&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/file&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;file&lt;/span&gt;&lt;/a&gt;=con&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; nlines=&lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; quiet=&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
  &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## do something on a line of data &lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;a href=&quot;http://www.inside-r.org/pretty-r&quot; title=&quot;Created by Pretty R at inside-R.org&quot;&gt;Created by Pretty R at inside-R.org&lt;/a&gt;&lt;/div&gt;
</description><link>http://ggorjan.blogspot.com/2013/12/read-line-by-line-of-file-in-r.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-435090305574869504</guid><pubDate>Tue, 02 Jul 2013 16:47:00 +0000</pubDate><atom:updated>2013-07-02T18:55:45.454+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">computers</category><category domain="http://www.blogger.com/atom/ns#">R</category><title>Parse arguments of an R script</title><description>R can be used also as a scripting tool. We just need to add shebang in the first line of a file (script):&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;#!/usr/bin/Rscript&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
and then the R code should follow.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Often we want to pass arguments to such a script, which can be collected in the script by the &lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;&quot;&gt;commandArgs()&lt;/span&gt; function. Then we need to parse the arguments and conditional on them do something. I came with a rather general way of parsing these arguments using simply these few lines:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;overflow: auto;&quot;&gt;
&lt;div class=&quot;geshifilter&quot;&gt;
&lt;pre class=&quot;r geshifilter-R&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Collect arguments&lt;/span&gt;
&lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt; &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/commandArgs&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;commandArgs&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;TRUE&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Default setting when no arguments passed&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/length&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;length&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &amp;lt; &lt;span style=&quot;color: #cc66cc;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
  &lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt; &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/c&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;c&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;--help&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Help section&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;--help&quot;&lt;/span&gt; %in% &lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
  &lt;a href=&quot;http://inside-r.org/r-doc/base/cat&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;cat&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;
      The R Script
&amp;nbsp;
      Arguments:
      --arg1=someValue   - numeric, blah blah
      --arg2=someValue   - character, blah blah
      --arg3=someValue   - logical, blah blah
      --help              - print this text
&amp;nbsp;
      Example:
      ./test.R --arg1=1 --arg2=&quot;&lt;/span&gt;output.txt&lt;span style=&quot;color: blue;&quot;&gt;&quot; --arg3=TRUE &lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&amp;nbsp;
  &lt;a href=&quot;http://inside-r.org/r-doc/base/q&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;q&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/save&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;save&lt;/span&gt;&lt;/a&gt;=&lt;span style=&quot;color: blue;&quot;&gt;&quot;no&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Parse arguments (we expect the form --arg=value)&lt;/span&gt;
parseArgs &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/function&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;function&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;x&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;a href=&quot;http://inside-r.org/r-doc/base/strsplit&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;strsplit&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/sub&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;sub&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;^--&quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; x&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;&quot;=&quot;&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
argsDF &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/as.data.frame&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;as.data.frame&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/do.call&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;do.call&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&quot;rbind&quot;&lt;/span&gt;&lt;span style=&quot;color: #339933;&quot;&gt;,&lt;/span&gt; parseArgs&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
argsL &amp;lt;- &lt;a href=&quot;http://inside-r.org/r-doc/base/as.list&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;as.list&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/as.character&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;as.character&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;argsDF$V2&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;
&lt;a href=&quot;http://inside-r.org/r-doc/base/names&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;names&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;argsL&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &amp;lt;- argsDF$V1
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Arg1 default&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/is.null&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;is.null&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt;$arg1&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## do something&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Arg2 default&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/is.null&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;is.null&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt;$arg2&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## do something&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;
&amp;nbsp;
&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## Arg3 default&lt;/span&gt;
&lt;span style=&quot;color: black; font-weight: bold;&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/is.null&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;is.null&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #009900;&quot;&gt;(&lt;/span&gt;&lt;a href=&quot;http://inside-r.org/r-doc/base/args&quot;&gt;&lt;span style=&quot;color: #003399; font-weight: bold;&quot;&gt;args&lt;/span&gt;&lt;/a&gt;$arg3&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #009900;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: #009900;&quot;&gt;{&lt;/span&gt;
  &lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## do something&lt;/span&gt;
&lt;span style=&quot;color: #009900;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;r geshifilter-R&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #009900;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;r geshifilter-R&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #666666; font-style: italic;&quot;&gt;## ... your code here ...&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;a href=&quot;http://www.inside-r.org/pretty-r&quot; title=&quot;Created by Pretty R at inside-R.org&quot;&gt;Created by Pretty R at inside-R.org&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It is some work, but I find it pretty neat and use it for quite a while now. I do wonder what others have come up for this task. I hope I did not miss some very general solution.&lt;!-----&gt;&lt;!-----&gt;</description><link>http://ggorjan.blogspot.com/2013/07/parse-arguments-of-r-script.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-7519349286627187385</guid><pubDate>Sun, 28 Apr 2013 14:22:00 +0000</pubDate><atom:updated>2013-04-28T16:22:10.677+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">study</category><category domain="http://www.blogger.com/atom/ns#">video</category><title>Nice introductory videos on DNA, Y chromosome, mitochondrial DNA and phylogeography</title><description>&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.yorkshiresdna.com/dna/genetic-code&quot;&gt;The genetic code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.yorkshiresdna.com/dna/y-chromosome&quot;&gt;YChr&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.yorkshiresdna.com/dna/mitochondrial-dna&quot;&gt;mtDNA&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.yorkshiresdna.com/dna/phylogeography&quot;&gt;PhyloGeography&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.yorkshiresdna.com/dna/autosomal-dna&quot;&gt;Autosomal DNA&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description><link>http://ggorjan.blogspot.com/2013/04/nice-introductory-videos-on-dna-y.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-9204505617794736850</guid><pubDate>Sun, 07 Apr 2013 09:38:00 +0000</pubDate><atom:updated>2013-04-07T11:38:06.499+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">animalScience</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">study</category><title>Integrating quantitative genetics and genomic in animal breeding graduate learning</title><description>&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;Follow link bellow for a set of graduate courses funded by USDA:&lt;/span&gt;&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;font-family: arial,helvetica,sans-serif;&quot;&gt;&lt;a href=&quot;http://enbgeo.iddl.vt.edu/&quot;&gt;Integrating quantitative genetics and genomic in animal breeding graduate learning&lt;/a&gt;&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
</description><link>http://ggorjan.blogspot.com/2013/04/integrating-quantitative-genetics-and.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-8495487025063887325</guid><pubDate>Mon, 18 Mar 2013 01:05:00 +0000</pubDate><atom:updated>2013-03-18T02:05:06.333+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">video</category><title>Medical and Population Genetics videos</title><description>Nice set of videos from Broad Institute on Medical and Population Genetics/Genomics:&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.broadinstitute.org/scientific-community/science/programs/medical-and-population-genetics/primers/primer-medical-and-pop&quot;&gt;Primer&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.broadinstitute.org/scientific-community/science/programs/medical-and-population-genetics/platforms-human-genetics&quot;&gt;Platforms for Human Genetics Workshop Materials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.broadinstitute.org/scientific-community/science/programs/medical-and-population-genetics/snapshots-genome-wide-analysis&quot;&gt;Snapshots of Genome Wide Analysis in Human Disease Workshop Materials&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.broadinstitute.org/science/programs/medical-and-population-genetics/next-generation-sequencing-workshop-materials&quot;&gt;Next-Generation Sequencing Workshop Materials&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description><link>http://ggorjan.blogspot.com/2013/03/medical-and-population-genetics-videos.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-5896128938526671329</guid><pubDate>Mon, 11 Feb 2013 08:07:00 +0000</pubDate><atom:updated>2013-02-11T09:07:37.563+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">life</category><category domain="http://www.blogger.com/atom/ns#">si</category><title>Kmečka pamet</title><description>Zdrava kmečka pamet lahko nadomesti skoraj vsak nivo izobrazbe,

Vendar noben nivo izobrazbe ne more nadomestiti zdrave kmečke pameti.

Arthur  Schopenha</description><link>http://ggorjan.blogspot.com/2013/02/kmecka-pamet.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-3409232257444724970</guid><pubDate>Sun, 27 Jan 2013 02:29:00 +0000</pubDate><atom:updated>2013-01-27T03:31:28.761+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">animalScience</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">writings</category><title>The contribution of dominance and inbreeding depression in estimating variance components for litter size in Pannon White rabbits </title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;
Our &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/jbg.12022/abstract&quot;&gt;paper&lt;/a&gt; on analysis of dominance in Pannon White rabbits has been accepted and will appear in Journal of Animal breeding and Genetics. Abstract says:&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
In a synthetic closed population of Pannon White rabbits, additive (VA), dominance (VD) and permanent environmental (VPe) variance components as well as doe (bFd) and litter (bFl) inbreeding depression were estimated for the number of kits born alive (NBA), number of kits born dead (NBD) and total number of kits born (TNB). The data set consisted of 18,398 kindling records of 3883 does collected from 1992 to 2009. Six models were used to estimate dominance and inbreeding effects. The most complete model estimated VA and VD to contribute 5.5 ± 1.1% and 4.8 ± 2.4%, respectively, to total phenotypic variance (VP) for NBA; the corresponding values for NBD were 1.9 ± 0.6% and 5.3 ± 2.4%, for TNB, 6.2 ± 1.0% and 8.1 ± 3.2% respectively. These results indicate the presence of considerable VD. Including dominance in the model generally reduced VA and VPe estimates, and had only a very small effect on inbreeding depression estimates. Including inbreeding covariates did not affect estimates of any variance component. A 10% increase in doe inbreeding significantly increased NBD (bFd = 0.18 ± 0.07), while a 10% increase in litter inbreeding significantly reduced NBA (bFl = −0.41 ± 0.11) and TNB (bFl = −0.34 ± 0.10). These findings argue for including dominance effects in models of litter size traits in populations that exhibit significant dominance relationships.&lt;/div&gt;

&lt;p  style=&quot; margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block;&quot;&gt;   &lt;a title=&quot;View The contribution of dominance and inbreeding depression in estimating variance components for litter size in Pannon White rabbits on Scribd&quot; href=&quot;http://www.scribd.com/doc/122379721/The-contribution-of-dominance-and-inbreeding-depression-in-estimating-variance-components-for-litter-size-in-Pannon-White-rabbits&quot;  style=&quot;text-decoration: underline;&quot; &gt;The contribution of dominance and inbreeding depression in estimating variance components for litter size i...&lt;/a&gt; by   &lt;a title=&quot;View &#39;s profile on Scribd&quot; href=&quot;undefined&quot;  style=&quot;text-decoration: underline;&quot; &gt;&lt;/a&gt; &lt;/p&gt;&lt;iframe class=&quot;scribd_iframe_embed&quot; src=&quot;http://www.scribd.com/embeds/122379721/content?start_page=1&amp;view_mode=scroll&quot; data-auto-height=&quot;false&quot; data-aspect-ratio=&quot;undefined&quot; scrolling=&quot;no&quot; id=&quot;doc_59400&quot; width=&quot;100%&quot; height=&quot;600&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;</description><link>http://ggorjan.blogspot.com/2013/01/the-contribution-of-dominance-and.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-8628121206312341794</guid><pubDate>Sun, 27 Jan 2013 02:13:00 +0000</pubDate><atom:updated>2013-01-27T03:27:03.265+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">writings</category><title>Genomic evaluations using similarity between haplotypes</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;
Our &lt;a href=&quot;http://onlinelibrary.wiley.com/doi/10.1111/jbg.12020/abstract&quot;&gt;paper&lt;/a&gt; on using haplotypes to build relationships between individuals has been accepted and will appear in Journal of Animal breeding and Genetics. Abstract says:&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Long-range phasing and haplotype library imputation methodologies are accurate and efficient methods to provide haplotype information that could be used in prediction of breeding value or phenotype. Modelling long haplotypes as independent effects in genomic prediction would be inefficient due to the many effects that need to be estimated and phasing errors, even if relatively low in frequency, exacerbate this problem. One approach to overcome this is to use similarity between haplotypes to model covariance of genomic effects by region or of animal breeding values. We developed a simple method to do this and tested impact on genomic prediction by simulation. Results show that the diagonal and off-diagonal elements of a genomic relationship matrix constructed using the haplotype similarity method had higher correlations with the true relationship between pairs of individuals than genomic relationship matrices built using unphased genotypes or assumed unrelated haplotypes. However, the prediction accuracy of such haplotype-based prediction methods was not higher than those based on unphased genotype information.&lt;/div&gt;

&lt;p  style=&quot; margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block;&quot;&gt;   &lt;a title=&quot;View Genomic evaluations using similarity between haplotypes on Scribd&quot; href=&quot;http://www.scribd.com/doc/122379269/Genomic-evaluations-using-similarity-between-haplotypes&quot;  style=&quot;text-decoration: underline;&quot; &gt;Genomic evaluations using similarity between haplotypes&lt;/a&gt; by   &lt;a title=&quot;View &#39;s profile on Scribd&quot; href=&quot;undefined&quot;  style=&quot;text-decoration: underline;&quot; &gt;&lt;/a&gt; &lt;/p&gt;&lt;iframe class=&quot;scribd_iframe_embed&quot; src=&quot;http://www.scribd.com/embeds/122379269/content?start_page=1&amp;view_mode=scroll&quot; data-auto-height=&quot;false&quot; data-aspect-ratio=&quot;undefined&quot; scrolling=&quot;no&quot; id=&quot;doc_46666&quot; width=&quot;100%&quot; height=&quot;600&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;</description><link>http://ggorjan.blogspot.com/2013/01/genomic-evaluations-using-similarity.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-16480336538750906</guid><pubDate>Fri, 25 Jan 2013 17:45:00 +0000</pubDate><atom:updated>2013-01-25T18:45:46.434+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">agriculture</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">plants</category><category domain="http://www.blogger.com/atom/ns#">talks</category><category domain="http://www.blogger.com/atom/ns#">writings</category><title>Simulation of different strategies to implement genomic selection in plant breeding</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;
Our submitted abstract for the &lt;a href=&quot;http://www.vipca.at/conferences/active/conference3/index.php&quot;&gt;VIPCA&lt;/a&gt; conference.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Gorjanc G, Crossa J,&amp;nbsp;Dreisigacker S, Autrique E, Hickey J&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Genomic information provides a rich resource for plant improvement. The greatest advantage of genomic information is achived when used early in a programme. The aim of this contribution was to present different ways of utilizing genomic information in cross and self pollinated species early in the bi-parental population (BP) cycle in the F2 generation by simulation. Simulation mimicked a real breeding programme with BP of different degree of relationship. Simulated trait heritability was 0.5. Predictions were always within a focal BP (BPX) avoiding the effect of inflated accuracy due to population structure. Measure of interest was the correlation between true and predicted additive genetic value (accuracy). Predictions were based on training on collected data within BPX, from BP having one parent in common with BPX (BPPC), from BP having one grand-parent in common with BPX (BPGC), and from unrelated BP (BPUR). Results show that genomic predictions can be accurate early in the cycle. Accurate predictions within the BPX can be obtained with a small number of markers and moderate phenotyping of F2 derived lines. With 200 markers and 50 phenotypes accuracy was around 0.60 and increased to 0.80 with 100 phenotypes. Use of information from relatives requires denser marker panels and more phenotypes to properly model the expanding number of linkage blocks in progressively distantly related BP. However, these requirements can be spread over many related BP reducing the cost per BP. For example accuracy of 0.6 can be achieved by using 1,000 markers and 50 phenotypes from 4 BPPC and 40 BPUR or by using 10,000 markers and 50 phenotypes from 8 BPGC and 50 BPUR. Requirement for denser marker panels increases needed investment, which can be offset by proper use of imputation method making the whole procedure cost effective for real applications.&lt;/div&gt;
</description><link>http://ggorjan.blogspot.com/2013/01/simulation-of-different-strategies-to.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-5181912206762824085</guid><pubDate>Thu, 27 Dec 2012 23:31:00 +0000</pubDate><atom:updated>2012-12-28T00:31:53.473+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">computers</category><category domain="http://www.blogger.com/atom/ns#">shell</category><title>Functions dim, nrow, and ncol for shell</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;
Ever wanted to find out quickly the number of rows and/or columns in file directly from terminal. There are many ways to skin this cat. Here is what I used for number of rows for quite a while:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;wc -l filename&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
What about number of columns? &quot;Easy&quot;, just combine head and awk commands:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;head -n 1 filename | awk &#39;{ print NF }&#39;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
not a big problem (there are likely better ways to do this), but is long and tedious.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
I got sick of typing commands above and assembled them in three easy to use function with &lt;a href=&quot;http://www.r-project.org/&quot;&gt;R&lt;/a&gt;-like names: &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;nrow&lt;/span&gt;, &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ncol&lt;/span&gt;, and &lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;dim&lt;/span&gt;. &lt;b&gt;Functions are simply a collection of above ideas and assume that the file is of &quot;rectangular shape&quot;, i.e., a table, a matrix, etc.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;dim()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; for FILE in $@; do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; NROW=$(nrow $FILE | awk &#39;{ print $1}&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; NCOL=$(ncol $FILE | awk &#39;{ print $1}&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; echo &quot;$NROW $NCOL $FILE&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; unset NROW NCOL&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; done&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export -f dim&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;nrow ()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; for FILE in $@; do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; wc -l $FILE&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; done&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export -f nrow&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ncol ()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; for FILE in $@; do&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; TMP=$(head $FILE -n 1 | awk &#39;{ print NF }&#39;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; echo &quot;$TMP $FILE&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; unset TMP&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; done&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;export -f ncol&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Add these files to your .bashrc or .profile or something similar and you can now simply type:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;nrow filename&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ncol filename&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;dim filename&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;A simple test:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;touch file.txt&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;echo &quot;line1 with four columns&quot; &amp;gt;&amp;gt; file.txt&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;echo &quot;line2 with four columns&quot;&amp;nbsp;&amp;gt;&amp;gt; file.txt&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;nrow file.txt&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;div&gt;
2 file.txt&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;ncol file.txt&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;4 file.txt&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;dim file.txt&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;2 4 file.txt&lt;/span&gt;&lt;/div&gt;
</description><link>http://ggorjan.blogspot.com/2012/12/functions-dim-nrow-and-ncol-for-shell.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-7362745716411347986</guid><pubDate>Tue, 04 Dec 2012 15:25:00 +0000</pubDate><atom:updated>2012-12-04T16:25:16.780+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">computers</category><category domain="http://www.blogger.com/atom/ns#">linux</category><title>Recover deleted file under linux</title><description>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://www.cyberciti.biz/tips/linux-ext3-ext4-deleted-files-recovery-howto.html&quot;&gt;Here&lt;/a&gt; is a nice summary, but the bottom line is that the Ubuntu/Debian package testdisk has a nice utility called photorec that can be used to search for deleted files and recover. This is not a GUI program, though!&lt;/div&gt;
</description><link>http://ggorjan.blogspot.com/2012/12/recover-deleted-file-under-linux.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-770927052005051958</guid><pubDate>Tue, 23 Oct 2012 16:01:00 +0000</pubDate><atom:updated>2012-10-23T18:01:36.245+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">computers</category><category domain="http://www.blogger.com/atom/ns#">shell</category><title>AWK one-liners</title><description>See &lt;a href=&quot;http://nixshell.wordpress.com/2009/04/01/awk-one-liners/&quot;&gt;here&lt;/a&gt;.</description><link>http://ggorjan.blogspot.com/2012/10/awk-one-liners.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-7048439042076149017</guid><pubDate>Thu, 11 Oct 2012 11:46:00 +0000</pubDate><atom:updated>2012-10-11T13:46:09.644+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">agriculture</category><category domain="http://www.blogger.com/atom/ns#">animalScience</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">writings</category><title>InterBull and ICAR papers</title><description>&lt;a title=&quot;View Reliability of breeding values in selected populations on Scribd&quot; href=&quot;http://www.scribd.com/doc/109700016/Reliability-of-breeding-values-in-selected-populations&quot; style=&quot;margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;&quot;&gt;Reliability of breeding values in selected populations&lt;/a&gt;&lt;iframe class=&quot;scribd_iframe_embed&quot; src=&quot;http://www.scribd.com/embeds/109700016/content?start_page=1&amp;view_mode=scroll&amp;access_key=key-gqpxdtp9tr4ib6jqkdi&quot; data-auto-height=&quot;true&quot; data-aspect-ratio=&quot;0.707514450867052&quot; scrolling=&quot;no&quot; id=&quot;doc_87093&quot; width=&quot;100%&quot; height=&quot;600&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;

&lt;a title=&quot;View Partitioning International Genetic Trends by Origin in Holstein bulls on Scribd&quot; href=&quot;http://www.scribd.com/doc/108440517/Partitioning-International-Genetic-Trends-by-Origin-in-Holstein-bulls&quot; style=&quot;margin: 12px auto 6px auto; font-family: Helvetica,Arial,Sans-serif; font-style: normal; font-variant: normal; font-weight: normal; font-size: 14px; line-height: normal; font-size-adjust: none; font-stretch: normal; -x-system-font: none; display: block; text-decoration: underline;&quot;&gt;Partitioning International Genetic Trends by Origin in Holstein bulls&lt;/a&gt;&lt;iframe class=&quot;scribd_iframe_embed&quot; src=&quot;http://www.scribd.com/embeds/108440517/content?start_page=1&amp;view_mode=scroll&amp;access_key=key-1gmaxlcgl9wyecs8aloz&quot; data-auto-height=&quot;true&quot; data-aspect-ratio=&quot;0.707514450867052&quot; scrolling=&quot;no&quot; id=&quot;doc_2053&quot; width=&quot;100%&quot; height=&quot;600&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;</description><link>http://ggorjan.blogspot.com/2012/10/interbull-and-icar-papers.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-3459690006341181433</guid><pubDate>Sun, 30 Sep 2012 05:07:00 +0000</pubDate><atom:updated>2012-09-30T07:07:06.643+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">animalScience</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">talks</category><title>Whole-genome evaluation of complex traits using SNP, haplotype, or QTL information</title><description>This is the presentation (and abstract bellow) of my talk at local congress &lt;a href=&quot;http://www.mf.uni-mb.si/mf/instituti/chmgf/Genetika2012%20Home.html&quot;&gt;Genetika 2012&lt;/a&gt;.&lt;br /&gt;
&lt;a href=&quot;http://www.scribd.com/doc/108439861/Whole-genome-evaluation-of-complex-traits-using-SNP-haplotype-or-QTL-information&quot; style=&quot;-x-system-font: none; display: block; font-family: Helvetica,Arial,Sans-serif; font-size-adjust: none; font-size: 14px; font-stretch: normal; font-style: normal; font-variant: normal; font-weight: normal; line-height: normal; margin: 12px auto 6px auto; text-decoration: underline;&quot; title=&quot;View Whole-genome evaluation of complex traits using SNP, haplotype, or QTL information on Scribd&quot;&gt;Whole-genome evaluation of complex traits using SNP, haplotype, or QTL information&lt;/a&gt;&lt;iframe class=&quot;scribd_iframe_embed&quot; data-aspect-ratio=&quot;1.33333333333333&quot; data-auto-height=&quot;true&quot; frameborder=&quot;0&quot; height=&quot;600&quot; id=&quot;doc_90707&quot; scrolling=&quot;no&quot; src=&quot;http://www.scribd.com/embeds/108439861/content?start_page=1&amp;amp;view_mode=slideshow&amp;amp;access_key=key-2m2zvs95fz68w9715p05&quot; width=&quot;100%&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;br /&gt;
Abstract:&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;JUSTIFY&quot; style=&quot;margin-bottom: 0in;&quot;&gt;
&lt;span lang=&quot;en-GB&quot;&gt;Whole-genome
technologies provide rich &lt;/span&gt;&lt;span lang=&quot;en-GB&quot;&gt;data for
dissection of complex traits. While gene discovery is still largely
limited, the data at hand can be successfully used for evaluation of
genetic merit. The aim of this work was to demonstrate the value of
different sources of information (pedigrees, Single Nucleotide
Polymorphisms – SNP, haplotypes, or Quantitative Trait Loci –
QTL) for genetic evaluation of non-phenotyped individuals in a
typical animal breeding scenario via simulation. In the first step a
coalescent simulation was used to create a base population with
structured chromosomes that were in the second step dropped and
recombined through the pedigree of 10 generations with 50 sires per
generation, 10 dams per sire, and 2 offspring per dam. Phenotypic
values were simulated with different genetic architectures (QTL
effects were sampled from Gaussian or gamma distribution and minor
allele frequency less than 0.3) and heritability of 0.25. Genotypic
data was available for all individuals from generation 4 onwards,
while phenotypic data was available for individuals in generations 4
and 5. Genetic evaluation was based on linear mixed models with
relationship matrix between individuals. This matrix was built using
pedigree, SNP, haplotype, or QTL data. Haplotypes of different length
were considered (from 5 to all the way up to 2000 SNP) with an option
to account for similarities between haplotypes while building
relationship matrices. The accuracy of different methods was assessed
by correlation between true and evaluated additive genetic values for
individuals in generations 6, 8 and 10. Average accuracy over ten
replications for Gaussian trait over generations was between 0.45 to
0.10 for pedigree data, 0.50 to 0.35 for SNP and haplotype data and
0.6 to 0.4 for QTL data. In the case of long haplotypes accuracies
dropped considerably, but accounting for similarities between
haplotypes prevented this drop. In the case of gamma trait accuracies
were slightly higher in generation 6 and dropped faster in the later
generations in the case of pedigree, SNP, and haplotype data due to
recombinations. On the other hand accuracies were substantially
higher with QTL data and quite stable over generations (from 0.75 to
0.65) though still far from perfect (even though QTL genotypes are
known), due to estimation errors. Results demonstrate the value and
limitations of genotypic information for the evaluation of additive
genetic merit in animal populations.&lt;/span&gt;&lt;/div&gt;
</description><link>http://ggorjan.blogspot.com/2012/09/whole-genome-evaluation-of-complex.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6715598735361401237.post-6997001599047389095</guid><pubDate>Sat, 29 Sep 2012 00:00:00 +0000</pubDate><atom:updated>2012-09-29T02:00:52.703+02:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">animalScience</category><category domain="http://www.blogger.com/atom/ns#">genetics</category><category domain="http://www.blogger.com/atom/ns#">web</category><title>Software Tools for Animal Gene Mapping</title><description>&lt;a href=&quot;http://animalgene.umn.edu/&quot;&gt;Here&lt;/a&gt; are some cool tools for animal genetics:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;AGDP for the analysis of genome differences between opulations&lt;/li&gt;
&lt;li&gt;SNPEVG graphical tool for SNP effect viewing and graphing&lt;/li&gt;
&lt;li&gt;...&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</description><link>http://ggorjan.blogspot.com/2012/09/software-tools-for-animal-gene-mapping.html</link><author>noreply@blogger.com (Gorjanc Gregor)</author><thr:total>0</thr:total></item></channel></rss>