Skip to content

Commit

Permalink
fix(docs): update docs for new snakemake version (#174)
Browse files Browse the repository at this point in the history
* feat: updated install script

* Update FAQ and installation instructions
  • Loading branch information
alsmith151 authored Mar 29, 2024
1 parent fea89be commit f797427
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 15 deletions.
4 changes: 3 additions & 1 deletion docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

### Workflow defines configfile config_chip.yml but it is not present or accessible.

This error occurs when the pipeline is run without a config file present in the working directory. Follow the [Pipeline Setup](pipeline.md#create-a-design-file) instructions to create a config file.
This error occurs when the pipeline is run without a config file present in the working directory. Ensure that seqnado-config has been run before starting the pipeline and that you are in the new directory created by seqnado-config.

Follow the [Pipeline Setup](pipeline.md#create-a-design-file) instructions to create a config file.


## Singularity configuration
Expand Down
4 changes: 4 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ mv /path/to/design.csv /path/to/working-directory/made-by-seqnado-config/
```bash
cd /path/to/working-directory/made-by-seqnado-config/
seqnado [atac|chip|rna|snp] -c <number of cores> --preset [ss|ls] # ss = use cluster, ls = use local (not recommended)

# An actual example would be:
seqnado rna -c 8 --preset ss

```
19 changes: 18 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ bash <(curl -s https://raw.githubusercontent.com/alsmith151/SeqNado/master/insta
Create a basic conda environment (with pip to install python packages) and activate it.

```bash
mamba create -n seqnado pip
mamba create -n seqnado pip "python>=3.12"
conda activate seqnado
```

Expand All @@ -63,6 +63,23 @@ conda activate seqnado
pip install seqnado
```

#### Ensure that Environment variables are set

Ensure that the environment variables are set correctly. This can be done by adding the following to your `.bashrc` or `.bash_profile`. Run this command to add the environment variables to your `.bashrc`:

```bash
echo export APPTAINER_BINDPATH="/ceph:/ceph, /project:/project, /databank:/databank" >> ~/.bashrc
```

Reload the `.bashrc` file:

```bash
source ~/.bashrc
```

Alternatively, start a new terminal session.


#### Install from GitHub directly

To install the latest version of the pipeline from GitHub (master branch), use the following command:
Expand Down
30 changes: 20 additions & 10 deletions docs/pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ The configuration file can be edited manually if required e.g. using `nano` or t
!!! Warning
If you edit the configuration file manually, you must ensure that it is valid YAML syntax (ensure that you do not delete any colons, commas, or change the indentation). You can check that the file is valid using the following command:

```bash
nano config_chip.yml # Note to exit nano press ctrl+x and then "y" followed by "enter" to save
```
```bash
nano config_chip.yml # Note to exit nano press ctrl+x and then "y" followed by "enter" to save
```

### Create a design file (optional)

Expand Down Expand Up @@ -102,26 +102,34 @@ If the fastq files are named in a way that seqnado can infer the sample names, t

If the fastq files are not named in a way that seqnado can infer the sample names, then a design file can be generated using the `seqnado-design` command. You'll need to enter the working directory and generate a design file:


```bash
cd 2024-01-13_test/
seqnado-design chip /path/to/fastq/files/* # Note that you can use tab completion to complete the path to the fastq files
```

This will generate a design file called `design.csv` in the working directory.

!!! Warning
You need to specify the fastq files in the command line to use for the design generation e.g. in the current working directory:

```bash
seqnado-design chip *.fastq.gz
```


#### ATAC|RNA-seq design file

An ATAC-seq or RNA-seq design file should look something like this:

```bash
,r1,r2
sample,r1,r2
rna,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna_2.fastq.gz,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna_1.fastq.gz
```

!!! Note
The design file is a CSV file with the following columns:
* The first column is the sample name
* `sample` - The sample name. Altering this will change the name of the output files so can be useful for renaming samples.
* `r1` - The path to the read 1 fastq file
* `r2` - The path to the read 2 fastq file

Expand All @@ -131,13 +139,13 @@ rna,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna_2.fastq.gz,/tmp
A ChIP assay design file should look something like this:

```bash
,ip_r1,ip_r2,control_r1,control_r2,ip,control
sample,ip_r1,ip_r2,control_r1,control_r2,ip,control
CTCF,CTCF_CTCF_2.fastq.gz,CTCF_CTCF_1.fastq.gz,CTCF_input_2.fastq.gz,CTCF_input_1.fastq.gz,CTCF,input
```

!!! Note
The design file is a CSV file with the following columns:
* The first column is the sample name
* `sample` - The sample name. Altering this will change the name of the output files so can be useful for renaming samples.
* `ip_r1` - The path to the IP read 1 fastq file
* `ip_r2` - The path to the IP read 2 fastq file
* `control_r1` - The path to the control read 1 fastq file
Expand All @@ -151,14 +159,14 @@ CTCF,CTCF_CTCF_2.fastq.gz,CTCF_CTCF_1.fastq.gz,CTCF_input_2.fastq.gz,CTCF_input_
An RNA-seq design file should look something like this:

```bash
,r1,r2
sample,r1,r2
rna,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna_2.fastq.gz,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna_1.fastq.gz
```

If you want to run DeSeq2, then you will need to add an additional column to the design file to indicate which samples are in the control group:

```bash
,r1,r2,deseq2
sample,r1,r2,deseq2
rna1,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna1_2.fastq.gz,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna1_1.fastq.gz,control
rna2,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna2_2.fastq.gz,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna2_1.fastq.gz,control
rna3,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna3_2.fastq.gz,/tmp/pytest-of-asmith/pytest-7/data2/2024-01-13_rna_test/rna3_1.fastq.gz,control
Expand Down Expand Up @@ -203,11 +211,13 @@ tmux new -s NAME_OF_SESSION

screen -S NAME_OF_SESSION

# to detach from tmux session
ctrl+b d

# to exit screen session
ctrl+a d
```


### Check you have activated the conda environment

```bash
Expand Down
14 changes: 11 additions & 3 deletions install_seqnado.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,28 @@ if ! command -v mamba &> /dev/null; then
export PATH="$HOME/mambaforge/bin:$PATH"
fi


# Create a new conda environment
echo "Creating a new conda environment..."
mamba create -n seqnado "python>3.10" pip -y
mamba create -n seqnado_dev "python>=3.12" pip -y

# Activate the conda environment
echo "Activating the conda environment..."
conda activate seqnado
conda activate seqnado_dev

# Install the seqnado package using pip
echo "Installing seqnado..."
pip install seqnado

# Deactivate the conda environment
echo "Deactivating the conda environment..."
conda deactivate
conda activate base

# Set the environment variables for CCB
if [[ $(hostname) =~ "imm-" ]]; then
echo export APPTAINER_BINDPATH="/ceph:/ceph, /project:/project, /databank:/databank" >> ~/.bashrc
export APPTAINER_BINDPATH="/ceph:/ceph, /project:/project, /databank:/databank"
fi


echo "Done!"

0 comments on commit f797427

Please sign in to comment.