Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conda install/setup instructions #169

Merged
merged 24 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4294167
start conda docs, wip
sjspielman Mar 8, 2024
84cbcdc
IA and contributing fixes
sjspielman Mar 8, 2024
4b5334f
Merge main
sjspielman Mar 12, 2024
de570cc
WIP: conda setup
sjspielman Mar 13, 2024
f658111
Merge branch 'main' into sjspielman/122-conda-setup
sjspielman Mar 13, 2024
b938d68
consolidate docs into list for mac and pc
sjspielman Mar 13, 2024
8ff1c73
launch terminal screenshot
sjspielman Mar 13, 2024
e7c8ca2
add note about y/n prompt
sjspielman Mar 13, 2024
ef9cd0f
merge main
sjspielman Mar 13, 2024
209bef7
remove backticks
sjspielman Mar 13, 2024
2b86628
Merge branch 'main' into sjspielman/122-conda-setup
sjspielman Mar 13, 2024
25ac1ed
Merge branch 'main' into sjspielman/122-conda-setup
sjspielman Mar 14, 2024
b4358a8
Apply suggestions from code review
sjspielman Mar 14, 2024
efb06de
use superfences ftw, add some flair, use only one note, and update an…
sjspielman Mar 14, 2024
625c9d7
stub link about using terminal, but keep the screenshot in img
sjspielman Mar 14, 2024
12c8382
add success screenshot for package install (not much to see for chann…
sjspielman Mar 14, 2024
e9e7dfe
spelling
sjspielman Mar 14, 2024
32a4136
Merge branch 'main' into sjspielman/122-conda-setup
sjspielman Mar 14, 2024
89a8cd6
Update docs/technical-setup/environment-setup/setup-conda.md
sjspielman Mar 14, 2024
c8a94a4
Merge branch 'main' into sjspielman/122-conda-setup
sjspielman Mar 14, 2024
3c1c57b
add collapsible terminal note
sjspielman Mar 14, 2024
7cbf3a7
Update setup-conda.md
sjspielman Mar 14, 2024
93ced27
emphasize conda is for python modules, per #128
sjspielman Mar 15, 2024
c15013e
Merge branch 'main' into sjspielman/122-conda-setup
sjspielman Mar 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To serve the documentation during local development, run `mkdocs serve` from the
Documentation is written as a series of markdown files nested by topic in directories.

- All directories at the top-level inside `docs` will represent `navbar` sections.
- Each top-level directory should contain an `index.md` file with an overall description of what that section contains.
- Each top-level directory should contain an `index.md` file with an overview of what that section contains.
- The `index.md` should have an L1 header with the same title as the `navbar` section.
- Markdown files in each directory represent sections shown along the left sidebar.
- Nested directories within each `navbar` section should be used to add an sections along the left sidebar.
Expand Down
Binary file added docs/img/conda-success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/terminal-spotlight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/technical-setup/environment-setup/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Environment setup

_Stub for environment setup index page._
94 changes: 94 additions & 0 deletions docs/technical-setup/environment-setup/setup-conda.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Install and set up conda

## What is conda?

The OpenScPCA project uses [conda](https://docs.anaconda.com/free/miniconda/index.html) to set up your software environment.
conda is a command-line software management tool which helps you install and track specific versions of software.
It also allows you to have multiple software environments with different sets of packages on the same computer.

This page provides instructions on how to install conda and use it to install certain software you will need to contribute to OpenScPCA.


### Why use conda?

There are two main reasons we use conda for OpenScPCA:

- conda provides a "one stop shop" for installing lots of different software
- Rather than having to figure out how to install every new program and its dependencies, conda can handle it all for you.
- You'll use conda to install the software dependencies you'll need to contribute to OpenScPCA.
- conda allows you set up different software environments for different projects
- For example, you may have two projects that require different versions of the same package.
With conda, you can create separate, fully isolated software environments for each project with different package versions.
- Python-based OpenScPCA analysis modules will use different conda environments to prevent conflicts and improve reproducibility.
Therefore, installing conda is also part of setting up your computer to be able to contribute to Python-based modules.


## Install conda

We recommend installing [Miniconda](https://docs.anaconda.com/free/miniconda/index.html) to obtain conda.
Miniconda is lightweight version of the full conda platform and includes the conda tool itself, Python, and a few other commonly-used packages.

To install Miniconda, [download the installer for your operating system](https://docs.anaconda.com/free/miniconda/), and follow all instructions.

- If you are on a macOS computer, be sure to download one of the links ending in `pkg`, _not `bash`_:
- If you are on an Apple Silicon (M1-3) mac, download `Miniconda3 macOS Apple M1 64-bit pkg`
- If you are on an Intel mac, download `Miniconda3 macOS Intel x86 64-bit pkg`

If you already have conda on your system, you do not need to re-install it.

## Set up conda

Next, you will need to set certain conda settings and install a few packages that will allow you to contribute to OpenScPCA in general.

1. Open a terminal (command line prompt) to interact with conda.

??? info "New to the terminal?"

If you are new to the terminal, we recommend you start with a general introduction.
Here are a few we resources we suggest:

- macOS
- [How to Use Terminal on a Mac: A Beginner's Guide](https://www.makeuseof.com/tag/beginners-guide-mac-terminal/)
- [Video: Using the Terminal on macOS for beginners](https://www.youtube.com/watch?v=dWFMRp6KtlQ)
- Windows
- PENDING: [Getting Started with Powershell](https://learn.microsoft.com/en-us/powershell/scripting/learn/ps101/01-getting-started?view=powershell-7.4)
Comment on lines +47 to +54
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see this evolving to move these to a link to another document, but this is good for now.



1. Copy and paste the following code into the terminal, and hit enter.
These commands will set the [recommended channels](https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html) conda should use to search for software.
- If you get the error `conda: command not found`, you may need to try again in a new terminal window.
If this doesn't help, you can [get help here](STUB_LINK somewhere to get help).

```sh
conda config --add channels defaults
conda config --add channels bioconda
conda config --add channels conda-forge
conda config --set channel_priority strict
```


1. The last step is to install the packages that you will need to contribute to OpenScPCA into your `base` conda environment.
`base` is the default conda environment, the one that will be active when you first open your terminal.
Copy and paste the following command into the terminal, and hit enter.

```sh
conda install awscli jq pre-commit
```

- The [`awscli` package](https://pypi.org/project/awscli/) will allow you to interact with [data stored in the Amazon Web Services (AWS) S3 bucket](STUB_LINK)
- The [`jq` package](https://pypi.org/project/jq/) provides JSON parsing capabilities
- The [`pre-commit`](https://pypi.org/project/pre-commit/) package will allow you to use [pre-commit hooks when contributing to analysis modules](STUB_LINK)

!!! note
You may be prompted to enter **`y`** or **`n`** (yes or no) during this setup.
If/when this prompt appears, you should hit **`y`** to give conda permissions to proceed.


1. At the end of the installation, you should see these messages in the terminal which indicate successful installation:

<figure markdown="span">
![Conda completed install output.](../../img/conda-success.png){width="275"}
</figure>


All set! 🎉
12 changes: 12 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ markdown_extensions:
- admonition # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#admonition
- attr_list # https://github.com/squidfunk/mkdocs-material/blob/master/docs/setup/extensions/python-markdown.md#attribute-lists
- md_in_html # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#markdown-in-html
- pymdownx.highlight: # https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#configuration
anchor_linenums: true
line_spans: __span
pygments_lang_class: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.details # https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown-extensions/#details


# Here is the basic structure of our navigation setup.
Expand All @@ -33,6 +41,7 @@ markdown_extensions:
# - section-path/markdown-1.md <!-- left sidebar will display H1 title from the markdown file itself -->
# - section-path/markdown-2.md
# - Subsection name: <!-- This title appears as bold item in left sidebar -->
# - section-path/subsection-path/index.md <!-- summary page for this subsection -->
# - section-path/subsection-path/markdown-3.md

# Currently, we have templated out the follow navbar items (specific names TBD)
Expand All @@ -44,6 +53,9 @@ nav:
- technical-setup/install-a-github-client.md
- technical-setup/fork-the-repo.md
- technical-setup/clone-the-repo.md
- Environment setup:
- technical-setup/environment-setup/index.md
- technical-setup/environment-setup/setup-conda.md
- Tools for communication: # Slack, issues, discussions
- communications-tools/tools-for-communication.md
- Contributing to analyses: # Setting up an analysis, all the git stuff
Expand Down