Practical 2: Github & Rstudio for collaborative coding

Welcome to the evolutionary lottery of skull and beak morphology

#EvoLottery



Beak and skull shapes in birds of prey (“raptors”) are strongly coupled and largely controlled by size.

  • In this exercise, each participant will fork a github repo, and contribute a file required to simulate the evolutionary trajectory of an imaginary species’ body size.

  • We’ll use github to collate all species files and plot them all up together at the end! We’ll also discover the skull and beak shapes associated with each simulated species size.

handy github glossary



GO!

fork repo

github: make your own copy of the repository** on github

  • fork are linked and traceable


github: Github makes a copy into your account


github: clone it: copy repo link to initiate Rstudio project



create new project in Rstudio

rstudio: Create new project


rstudio: Checkout from version control repository


rstudio: Clone project from a git repository


rstudio: Paste repo link copied from Github into Repository URL field. Click Create Project.


rstudio: Rstudio project now contains all files from the github repo.



make a change to the repo

rstudio: open params/params_tmpl.R


rstudio: save as new .R script in params/ folder. Use species name of your choice to name new file. Please to not overwrite file params/params_tmpl.R.


rstudio: edit file with parameters of your choice and save.



The parameters each participants need to supply are:

  • sig2: A numeric value greater than 0 but smaller than 5

  • species.name: a character string e.g. "anas_krystallinus". Try to create a species name out of your name!

  • color: a character string e.g. "red", "#FFFFFF" (tip: pick a color using Rstudio’s Color picker:)


commit changes locally to git

rstudio: in the git tab, select the new file you created and click Commit


rstudio: write an informative commit message and click Commit


rstudio: your new file has now been commited



push changes to Github

rstudio: on the git tab click ⇧ to push changes to Github


rstudio: changes have now been updated in the Github repo



create pull request

github: in your repository, create new pull request to merge fork to master repo (ie the original repo you forked)


github: github checks whether your requested merge creates any coflicts. If all is good, click on Create pull request


github: write an informative message, explaining your changes to the master repo administrators. Click on Create pull request


github: check original repo to see your merged changes




exercise

your mission

We’ll merge all contributions and plot them together at the end!

resources

link to presentation handout

Karthik Ram’s article: ‘Git can facilitate greater reproducibility and increased transparency in science’

Getting started with GitHub from materials for a software carpentry course at UBC

Slides for lecture Karl Broman gave on git/github, with notes

joeyklee’s friendly github intro. Mozilla Science Lab workshop