Skip to content

Commit

Permalink
Merge branch 'webpage' into webpage
Browse files Browse the repository at this point in the history
  • Loading branch information
albarema authored Aug 20, 2024
2 parents c445e27 + ac4786d commit b2ff9ce
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion _quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ website:
logo-href: http://hds-sandbox.github.io/
background: primary
left:
- text: "Intro"
- text: "Home"
file: index.qmd
- text: "Course material"
file: develop/01_RDM_intro.qmd
Expand Down
16 changes: 15 additions & 1 deletion develop/examples/mkdocs_pages.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ summary: Build git pages using mkdocs
---
# Build your GitHub Page using Mkdocs

Install MkDocs and MkDocs extensions using the command line. Additional extensions are optional but can be useful if you choose this approach.

```{.bash}
pip install mkdocs # create webpages
pip install mkdocs-material # customize webpages
pip install mkdocs-video # add videos or embed videos from other sources
pip install mkdocs-minify-plugin # Minimize html code
pip install mkdocs-git-revision-date-localized-plugin # display last updated date
pip install mkdocs-jupyter # include Jupyter notebooks
pip install mkdocs-bibtex # add references in your text (`.bib`)
pip install neoteroi-mkdocs # create author cards
pip install mkdocs-table-reader-plugin # embed tabular format files (`.tsv`)
```

:::{.callout-exercise}

# Exercise 5: make a project folder and publish a data analysis webpage
Expand Down Expand Up @@ -42,4 +56,4 @@ summary: Build git pages using mkdocs
After a couple of minutes, your webpage should be ready! You should be able to see your webpage through the link provided in the Page section!

Now it is also possible to include this repository webpage in your main webpage `<organization>`.*github.io by including the link of the repo website (https://`<organization>`.*github.io/*repo-name*) in the navigation section of the `mkdocs.yml` file in the main *organization*github.io repo.
:::
:::
18 changes: 11 additions & 7 deletions develop/practical_workshop.qmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
---
title: Practical material
format:
html:
Expand Down Expand Up @@ -206,13 +206,14 @@ my_template/
|-- tests
| |-- test_{{cookiecutter.project_name}}.py
|-- README.md
|__ cookiecutter.json # created in step 2
```

In this example, `{{cookiecutter.project_name}}` is a placeholder that will be replaced with the actual project name when the template is used. This directory contains a python script ('main.py'), a subdirectory ('tests') with a second python script named after the project ('test_{{cookiecutter.project_name}}.py') and a 'README.md' file.

##### Step 2: Create `cookiecutter.json`

In the root of your template folder, create a file named `cookiecutter.json`. This file will define the variables (keywords) that users will be prompted to fill in. For our Python project template, it might look like this:
In the root of your template folder, create a file named `cookiecutter.json`. This file will define the variables (keywords) and default values that users will be prompted to fill in during the template initialization. For our Python project template, it might look like this:

```{.json .code-overflow-wrap}
{
Expand Down Expand Up @@ -460,7 +461,7 @@ It is time now to customize your Cookiecutter templates and modify the metadata.
"version": "0.1.0"
}
```
The metadata file will be filled accordingly.
The metadata file will be filled out accordingly.

2. Optional: You can customize or remove this prompt message entirely, allowing you to tailor the text to your preferences for a unique experience each time you use the template.

Expand All @@ -473,13 +474,13 @@ The metadata file will be filled accordingly.
},
```

3. Modify the `metadata.yml` file so that it includes the metadata recorded by the `cookiecutter.json` file. Hint below:
3. Modify the `metadata.yml` file so that it includes the metadata recorded by the `cookiecutter.json` file. Hint below (*short_desc*, *authors*, etc.):

```{.yml .code-overflow-wrap filename="metadata.yml"}
project: {{ cookiecutter.project_name }}
author: {{ cookiecutter.author }}
authors: {{ cookiecutter.authors }}
date: {{ cookiecutter.date }}
description: {{ cookiecutter.short_description }}
description: {{ cookiecutter.short_desc }}
```
4. Modify the `README.md` file so that it includes the short description recorded by the `cookiecutter.json` file and the metadata at the top of the markdown file (top between lines of dashed).

Expand Down Expand Up @@ -536,8 +537,10 @@ The next step is to collect all the datasets that you have created in the manner
We will make a small script in R (or you can make one with Python) that recursively goes through all the folders inside an input path (like your `Assays` folder), fetches all the `metadata.yml` files, merges them and writes a TSV file as an output.

1. Create a folder called `dataset` and change directory `cd dataset`
2. Fork [this repository](https://github.com/hds-sandbox/cc-data-template): a Cookiecutter template designed for NGS datasets.*While you are welcome to create your own template from scratch, we recommend using this one to save time.*
2. Fork [this repository](https://github.com/hds-sandbox/cc-data-template): a Cookiecutter template designed for NGS datasets.*While you are welcome to create your own template from scratch, we recommend using this one to save time.* Then, `git clone <URL to Gihub repo>`.
3. Run the `cookiecutter cc-data-template` command at least twice to create multiple datasets or projects. Use different values each time to simulate various scenarios (do this in the dataset directory that you have previously created).
*Importantly, we recommend assigning values to all entries. If an entry does not apply, use "nan." This will be better for processing metadata later on.*
*If the path to the cc-data-template is elsewhere than the datasets dir, change the command e.g.:`cookiecutter /home/myTemplates/cc-data-template`*
4. Execute the script below using R (or create your own script in Python). **Adjust the `folder_path`** variable so that it matches the path to the Assays folder. The resulting table will be saved in the same `folder_path`.
5. Open your `database_YYYYMMDD.tsv` table in a text editor from the command-line, or view it in Excel for better visualization.

Expand Down Expand Up @@ -838,6 +841,7 @@ Here are some useful links to get started with Github Pages:
```
4. Open the terminal
```{.bash filename="Terminal"}
# Add a .nojekyll file to the root of the repository not to do additional processing of your published site
touch .nojekyll #copy NUL .nojekyll for windows
Expand Down
9 changes: 8 additions & 1 deletion develop/scripts/shiny_sqlite_advanced.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
# License: MIT
# R version: 4.3.2

# Load libs
quiet <- function(x) { suppressMessages(suppressWarnings(x)) }
quiet(library(shiny))
quiet(library(DT))
quiet(library(DBI))


# Define the UI
ui <- fluidPage(
titlePanel("SQLite R Shiny App"),
Expand Down Expand Up @@ -166,4 +173,4 @@ server <- function(input, output, session) {
}

# Run the app
shinyApp(ui = ui, server = server)
shinyApp(ui = ui, server = server)
1 change: 1 addition & 0 deletions index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
format:
html:
toc: false
page-layout: full
authors:
- name: Alba Refoyo Martinez
orcid: 0000-0002-3674-4007
Expand Down

0 comments on commit b2ff9ce

Please sign in to comment.