Session Roadmap


1 Introductions

- get to know github

  • github as a computational research tool

2 Get stuck in

- Collaborative github through rstudio #EvoLottery (40 mins)

  • 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.


GitHub

version control technologies

GitHub

  • More than a simple source code hosting service.

    • Provides a dynamic and collaborative social coding platform


Modern scientific workflows

can be overwhelming



  • science increasingly computational

    demands for increased openness, transparency & reproducibility

  • science always benefits from collaboration

    push to harness the power of the internet



BUT: succesful modern science workflows

can be extremely powerful




GitHub for science

  • ideal for managing the full suite of research outputs such as datasets, statistical code, figures, lab notes, and manuscripts.
  • supports peer review, commenting, and discussion.
  • Diverse range of efforts, from individual to large bioinformatics projects, laboratory repositories, as well as global collaborations have found a home on GitHub



Rstudio for r users





GitHub features

>



commits

traceability


issues

project management


graphs

project & team tracking

tracking contributors

entire process of project evolution reproducible




Practical: Github & Rstudio for collaborative coding

#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.

RECAP Forking


Back to our project.

We’ve initiated our project as a github repository but not connected it to remote repository on GitHub

In the Evolottery exercise we used a method of linking to a repository by cloning one that already exists on GitHub. Now we want to do the opposite.

usethis::use_github(protocol = "https")

(Works with GITHUB_PAT)

if for some reason it creates the repository on GitHub but doesn’t push the contents, try running git push origin master in the terminal/shell


Authentication problems

If you create the github reporsitory with ssh authentication (use_github() default), you can:

  1. Set up an ssh key
  2. Change to https authentication :

    git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

Check what authentication you are using by running this in the terminal

git remote -v

https: origin https://github.com/USERNAME/REPOSITORY.git (fetch)

ssh: origin git@github.com:USERNAME/REPOSITORY.git (push)

More details here


There are two very important documents missing in our repository

  1. A README
  2. A License

Let’s go create an issue in our repository about this.


README

READMEs are the landing page of any repository on GitHub.

usethis::use_readme_md()

Creates a simple md README

usethis::use_readme_rmd()

Creates an Rmd README in which you can run R examples and automatically creates the README.md. - Render each time you make changes to README.Rmd so README.md is updated.


License

usethis::use_mit_license("Anna Krystalli")


Referencing an issue in a commit message

Publishing html to GitHub.

  • If you haven’t already published the rendered (.html) version of your report do so now.

  • Head to GitHub and look for the Settings ⚙️

  • Scroll down to the GitHub Pages Section and set the Source to master branch.


Your repo is now hosting any html documents at the address given!

The URL will be the URL given followed by the name of the file:

http://annakrystalli.me/gapminderRR/gapminder-analysis.html


Recap

GitHub amazing for:

  • fostering reproducibility

  • empowering collaboration



GitHub tips

  • Use README to provide an overview of your project
  • use issues to keep track of bugs, tasks, and enhancements
  • include a LICENSE
  • practice by collaborating with yourself on different machines!
  • handy github glossary