code mnemonics

Compilation of useful programming tips that I sometimes need but always forget about.

Stag all removed files in git

git rm $(git ls-files –deleted)

Roxygen skeleton

To add the roxygen2 skeleton to document a function:




 Correspondance between reshape2::melt and tidyr::gather, reshape::dcast and tidyr::spread


mini_iris <- iris[c(1, 51, 101), ]

# melt
melted1 <- mini_iris %>% melt(id.vars = "Species", = 'dimension','trait')
melted2 <- mini_iris %>% gather(key='trait', value='dimension', -Species)

# cast
melted1 %>% dcast(Species ~ trait, value.var = "dimension")
melted2 %>% spread(key='trait', value='dimension')



Insert or overwriting mode shortcut

Not really a command, but super annoying for a linux computer using a mac keyboard.

Shortcut: fn + return


my reference papers

A list of great papers on the disciplines I am most interested in: evolution, ecology, quantitative & population genetics, statistics, bioinformatics.


Is adaptation possible in self-fertilizing species?

Who will adapt to climate change?

What is a mutation accumulation line?

What is the animal model? (LMM)

Under what circumstances SNPs cannot be identified in GWA?

What is heritability?

What is missing heritability?

How to GWA in plants?

What is population stratification correction in GWA?

What is a meta-GWA?

Population structure? F statistics?

What is spatial autocorrelation in the data?

What is an environmental niche model?

What is (really) a selection coefficient?

What is phenotypic selection?

How linkage, inheritance, and sex interfere evolution at multiple locus?

What are the footprints of selection on the genome?

How does multiple testing correction work?

What is principal component analysis?

SNP imputation in association studies

What is a hidden Markov model?

What is a support vector machine?

What is the expectation maximization algorithm?

What are DNA sequence motifs?

What are decision trees?

What is dynamic programming?

What are artificial neural networks?

How to map billions of short reads onto genomes?

Some of these papers come from a blog I came across with and could not find again. Thanks to that unknown blog.