or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
SORTEE Code Club Hackathon: Creating a Code Standard
tags:
sortee
open-code
reproducibility
This is the collaborative notebook for SORTEE's Code Club Hackathon: Creating a Code Standard for the Society for Open, Reliable, and Transparent Ecology & Evolution (SORTEE).
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →`
) for thecode blocks
.Otherwise, it's like a Google doc: it allows simultaneous editing. There's a section for practice down there ⬇️
Table of Contents:
- SORTEE Code Club Hackathon: Creating a Code Standard
- Hackathon outline
- ICE BREAKER (practice HackMD editing)
- Collaboratively writing the "perfect" Open, Reliable, and Transparent (ORT) piece of code
- Group 1: Reported
- Group 2: Run
- Group 3: Reliable
- Group 4: Reproducible
- Group 5: Organisation & Structure
- Group 6: Other (opinionated) considerations for public code sharing
- Useful links
- Other TO-DOs
- Give feedback
Hackathon outline
Audience = Anyone with a Github account and experience in coding for scientific analysis is welcome to participate!
🔗 You will receive the zoom link to participate in the Hackathon on SORTEE's Slack
Why a Code Standard? Publishing our code and data is an important Open, Reliable, and Transparent (ORT) practice to ensure the reproducibility of research. A field-specific Code Standard can facilitate the production and reviewing of code as an accessible and easy way to implement ORT practices in your own coding by example.
Which code will we work on? The selected code is for a simple ecology/evolution analysis, coming from the published paper: Van Dis et al. (2023). Phenological mismatch affects individual fitness and population growth in the winter moth, Proc Roy Soc B, 290(2005)
How will we work? We will collaboratively edit a piece of R code in this Github repository. We will split up into six groups, with each group having a specific goal for code editing:
(following the the 17-step code review checklist for Ecology and Evolution)
How to get started? Join the main breakout room for your group on zoom (find your group here). Together discuss what would constitute the "perfect" ORT piece of code considering your group's focus area (see above).
Below you will find suggestions of tasks for each group to get started. Discuss, edit and supplement these tasks. When you agree on a task, self-organise who will work on this task. The task owners can go to a side breakout room to start rewriting the code.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →commit
andpush/pull
to the Github repo to keep track of your changes. Make sure you are on thehackathon2
branch.ICE BREAKER (practice HackMD editing)
Let's learn how to use this HackMD document by answering an ice breaker question!
Somewhere on the screen (probably at the top), you should see three icons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Q: What is the word for to code in your first/second/third language?
Answers:
Collaboratively writing the "perfect" Open, Reliable, and Transparent (ORT) piece of code
We have breakout rooms standing ready in zoom: one main room for each group plus additional side breakout rooms for task completion. Join the main breakout room for your group and start discussing!
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Group 1: Reported
Task1: Check if the code matches the methods as described in the corresponding article, metadata, and/or documentation. If not, edit
Task2: Add comments to code, if necessary
Task3: Consistency in naming of variables
glm1 <- glmer(Event ~ (MismTreat1 + MismTreat2)*PhotoTreat + (1|TubeID), family=binomial, data=d_surv, na.action="na.fail", control=glmerControl(calc.derivs=F))
uses TubeID instead of MotherID, despite the paper saying that "mother ID was included as a random effect"Group 2: Run
Task1: Does the code run in its entirety and without issue? If not, edit
rmisc
was used in line 77, but not loaded beforehand. Caused error if user didn't have package installed.Task2: Add a R project file to repo
Task3: Discuss/research and implement an easy way for a user to recreate the analysis R environment
if
statements for installing packages with the right versions; or find out if there is an automatic way to replicate the environment when e.g. usingrenv
package lock filesrenv
is currently one of the best approaches to allow other to reproduce the analyses using the same R environment and requires no additional manual steps, unless necessary system dependencies are missing. Therefore we implemented this approach.Task4:
Add dataAlternative: write script to download the data ==>- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Task 5: Keep all objects in the environment
rm
in the same script, it can be confusing for users - it makes it hard to go back and look at objects from a previous step. Created objects should be preserved within a single script.rm
calls and made sure those variables weren't reused in a way that might cause any issues.Group 3: Reliable
Task1: Check if the columns of the data are correctly selected. If not, edit
selected_data <- data[, c("size", "color")]
selected_data <- data[, c(3, 7)]
Task2: Avoid overwriting columns/data objects
mutate(Treatment=factor(Treatment, levels=c("ChangDay-4", "ChangDay-3", "ChangDay-2", "ChangDay-1", "ChangDay0", "ChangDay+1", "ChangDay+2", "ChangDay+3", "ChangDay+4", "ChangDay+5", "ConstDay-4", "ConstDay-2", "ConstDay0", "ConstDay+2", "ConstDay+4")), ...
could use Treatment2 instead -> more descriptive name needed! e.g. Treatment_relevelledTask3: Check that main decisions are clear to find. If not, add
Task4: Does the code include "unit tests" or other checks that verify the code is working as intended? If not, add
Check if the variables have the right structure:
validation <- validate::validator( is.characted(id), is.integer(X), is.factor(group) ) data_check<- validate::confront(data, rules, raise = 'all) validation_summary <- summary(data_check) if (any(validation_summary$fails >0 | validation_summary$error>0)) { warning("Error message") }
Task5: Add comments on what the desired output is of the code
Task6: Implement html report?
Task7: Add comments about what values etc to check for statistical analysis
[ ]
Group 4: Reproducible
Task 1: Test and fine-tune
renv
implementationConsiderations:
renv
installs the correct package versions!How-to: Install packages with right version (code does not need to be included in repo?) and reinitialise
renv
/ updaterenv.lock
fileThe package versions used in the original analysis are in the
_scr
folder- 2. Check that all necessary files have been included in the repo to easily recreate the analysis environment withrenv
after repo cloning (and make sure all not necessaryrenv
files are in.gitignore
file )How-to: Clone repo and run the code
Question: how to work in another R version than the one installed on your machine?
answer: using newer versions should not be a problem with renv, it might be a problem when using older version than the one use to produce the code.
Task2: Are the results and conclusions reproducible from the code as provided?
Task3: Does the code include clear documentation that detail the rationale behind it? If not, add
Task4: Is the whole workflow code/script-based? If not, write code for the manual manipulation parts
Task5: Use of multiple R versions:
Task6: Check the need set seed
Task7: Check the possibility for use Docker
Group 5: Organisation & Structure
Task1: Edit Repository structure
Task2: Should the script be split into multiple scripts, one per main task?
01_data_prep.R
), modeling (02_modeling.R
) and summarizing results (03_summarizing_results.R
) seperatelyTask3: Add a consistent code style
Task4: Improve code readability
Task5: Does the code use informative names for objects/variables? If not, edit
Task5: [description]
Group 6: Other (opinionated) considerations for public code sharing
Task1: Rewrite the code to increase efficiency
Task2: Edit the code so that when calling functions, it explicitly calls the package namespace (i.e.,
package::function()
)Task3: Make sure the code contains no hard-coding (i.e. the code includes no sections that assign fixed values or data directly rather than using variables)
Task4: Make sure documentation (metadata, README) includes clear citations to related materials like data and the article
Task5: [description]
Useful links
Add here any links to resources you think could be useful for the Hackathon.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Other TO-DOs
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Are you interested in Open Science practices related to code and code review? Would you like to learn more? We are looking for you to lead Code Club in 2025!
No prior experience needed, just a willingness to learn and invest some of your time.
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →The SORTEE Library of Code Mistakes is open for editing!
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Add your details to the Find an ORTEE Code Reviewer list
Give feedback
Any feedback on this Hackathon or Code Club in general is welcome! Things you liked, things that could be improved, topics you would like to see in upcoming Code Clubs etc.
Feedback Session #1:
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Feedback Session #2: