Writing a Paper and Uploading Code to Github Repository

From Bridges Lab Protocols
Revision as of 14:38, 6 November 2019 by Davebridges (Talk | contribs) (Wrote initial page, included instructions for github)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

As a policy, as we write a paper we upload all the raw and processed data, along with analysis scripts (generally Rmd files) to a git repository while writing the paper. This allows us to keep a log of all the changes, decisions and statistics for paper. Upon acceptance, this repository will be made public and linked to within the original paper. For more details about the Bridges Lab data and resource sharing policy see here:

Initial Steps

  • Make sure you have a github account (sign up for one here), and have Github Desktop, RStudio and Illustrator installed on your computers. You should have read/write access to the repository, if you dont let Dave know.
  • Decide which repository your project should be included with. A full list of our repositories can be found here.
  • Clone the repository if its not already on your computer
  • Make a new branch called something-manuscript to describe the manuscript you are working on. You will work only on that branch (not on master) until the paper is ready to submit. You can see what branch you are on in Github Desktop by looking on the top bar where it says "Current Branch"
  • Create a new folder for your manuscript and separately for your code. Use the existing directory structure to understand where to put your data.
  • In your manuscript folder create a file called README.md using a text editor such as Sublime or Textwrangler. This is where you will note where to find the data that goes into each figure panel. The format of this file is markdown, and an example can be found here.
  • Also create a markdown file in that folder called TODO.md. Use this to make little notes to yourself as you are writing (i.e. check on stats for this experiment, or look into more papers on such and such).

Tracking and Committing Changes

As you write and make changes save regularly and commit your changes using Github. If using Github Desktop the process is:

  1. Make some change to a script, file or figure
  2. In Github Desktop write a summary of the change, and make sure altered files are selected. Your summary should be short but clear message of what you changed. Think of it as completing the smallest possible taks (i.e. changed font size on bar graph). You cannot commit too often.
  3. When you want to store remotely (end of the day, or when switching computers, or when asking someone else to review it), select publish or push to send your branch to Github.


Writing Process

This is a recommendation, but there are other ways to approach writing a manuscript