Skip to content

Commit 496cf82

Browse files
Merge branch 'develop'
2 parents 60f7265 + 7c1e0af commit 496cf82

30 files changed

Lines changed: 786 additions & 350 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ slurm*.out
44
report.html
55
samples.tsv
66
config.yaml
7+
seq2science.*.log
78
build/
89
*.egg*
910
.idea/

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,32 @@ All changed fall under either one of these types: `Added`, `Changed`, `Deprecate
88

99
## [Unreleased]
1010

11+
### Added
12+
13+
- added CLI functionality to the deseq2.R script (try it with `Rscript /path/to/deseq2.R --help`!)
14+
- --force flag to seq2science init to automatically overwrite existing samples.tsv and config.yaml
15+
- local fastqs with Illumina's '_100' are now recognized
16+
- added the workflow explanation to the multiqc report
17+
18+
### Changed
19+
20+
- config checks: all keys converted to lower case & duplicate keys throw an exception
21+
- MultiQC updated to v1.10
22+
- Link to seq2science log instead of snakemake log in final message
23+
24+
### Fixed
25+
26+
- Issue when filtering a combination of single-end and paired-end reads on template length
27+
- explain functionality testing
28+
- scATAC can properly use SE fastqs
29+
- scRNA can use fqexts other than R1/R2
30+
- fastq renaming works again
31+
- added missing schemas to extended docs
32+
33+
### Fixed
34+
35+
- Bug with edgeR.upperquartile normalization. Now makes everything NaN, so pipeline finishes succesfully.
36+
1137
## [0.5.0] - 2021-03-03
1238

1339
Version 0.5.0 brings many quality of life improvements, such as seq2science automatically inferring what needs to be re-run when changing the samples.tsv and/or the config.yaml, differential peak analysis for chip/atac workflows and tab-completion!

docs/content/DESeq2.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,21 @@
22
Seq2science outputs counts matrices for each assembly in any bulk-sequencing workflow, which can optionally can be used for differential gene/peak analysis with [DESeq2](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-014-0550-8).
33
To do so, add one or more contrast design(s) in the `config.yaml` file, with matching identifiers in the `samples.tsv` file.
44

5+
After completing the workflow, rerunning Seq2science with new contrasts will only perform the new analyses.
6+
Alternatively, you can call the DESeq2 script from the command line.
7+
To get started with the command line script, try out `Rscript /path/to/seq2science/scripts/deseq2.R --help`.
8+
59
This section details how the contrast designs are created.
610
Examples are given [below](./DESeq2.html#deseq2-contrast-designs), and each `config.yaml` contains a commented-out example contrast design at the bottom.
711

8-
Note: (additional) design contrasts can be added at any time.
9-
After completing the workflow, rerunning Seq2science with new contrasts will only perform the new analyses.
10-
1112
##### Overview of the DESeq2 method
1213
DESeq2 automatically performs library bias correction when loading your data, and batch correction is performed if it is included in the contrast design.
1314
After calculating differentially expressed genes/peaks, a multiple testing procedure is applied, which is either the Benjamini-Hochberg procedure (the default) or Independent Hypothesis Weighing.
1415
The False Discovery Rate cutoff is set by alpha, which is 0.1 by default.
1516
Finally, count values are log transformed and shrunk (by default using the apeglm method).
1617
These defaults can be changed in the [config.yaml](./schemas.html#deseq2), under the `deseq2` variables using the `multiple_testing_procedure`, `alpha_value` and `shrinkage_estimator` options respectively.
1718

18-
For more information, check out the steps in this [vignette](www.bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html), which Seq2science follows.
19+
For more information, check out the steps in this [vignette](https://www.bioconductor.org/packages/release/bioc/vignettes/DESeq2/inst/doc/DESeq2.html), which Seq2science follows.
1920

2021
##### Output
2122
For each contrast design, the list of *all* genes/peaks is saved to file, with analysis results for expressed genes. Briefly, these include:

docs/content/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,4 @@ There are differences between these methods however, and caution is advised with
5252
Additionally, Seq2science employs strict quality checks by default.
5353
You could try reducing the `min_mapping_quality` (for HTSeq and FeatureCounts) or change the parameters to the quantifier.
5454

55-
The biggest difference in expressed genes found is in switching to or from Salmon.
55+
The biggest differences in expressed genes can be found by switching gene annotation, followed by switching quantifier (to or from Salmon).

docs/content/workflows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ These workflows generally overlap a lot, so once you understand the logic of one
1111
Downloading fastqs <workflows/download_fastq.md>
1212
Alignment <workflows/alignment.md>
1313
ATAC-seq <workflows/atac_seq.md>
14-
RNA-seq <workflows/rna_seq.md>
1514
ChIP-seq <workflows/chip_seq.md>
15+
RNA-seq <workflows/rna_seq.md>
1616
scATAC-seq <workflows/scatac_seq.md>
1717
scRNA-seq <workflows/scrna_seq.md>

docs/content/workflows/alignment.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,28 @@ Aligning samples has never been easier!
88

99
#### Downloading of sample(s)
1010
Depending on whether the samples you start seq2science with is your own data, public data, or a mix, the pipeline might start with downloading samples.
11-
Take a look at the [downloading_fastq](./download_fastq.html) workflow for extensive documentation about downloading of public samples.
11+
You control which samples are used in the [samples.tsv](#filling-out-the-samples-tsv).
12+
Background on public data can be found [here](./download_fastq.html#download-sra-file).
1213

1314
#### Read trimming
14-
The pipeline starts by trimming the reads with Trim galore or Fastp.
15-
The trimmer will automatically trims the low quality 3' ends of reads, and removes short reads.
16-
After the quality trimming it automatically detects which adapter was used, and trims it.
15+
The pipeline starts by trimming the reads with Trim Galore! or Fastp (the default).
16+
The trimmer will automatically trim the low quality 3' ends of reads, and removes short reads.
17+
During the quality trimming it automatically detects which adapter was used, and trims this as well.
1718
Trimming parameters for the pipeline can be set in the configuration.
1819

1920
#### Alignment & Sorting
2021
After trimming the reads are aligned against an assembly. Currently we support *bowtie2*, *bwa*, *bwa-mem2*, *hisat2* and *STAR* as aligners. Choosing which aligner is as easy as setting the *aligner* variable in the `config.yaml`, for example: `aligner: bwa`. Sensible defaults have been set for every aligner, but can be overwritten for either (or both) the indexing and alignment by specifying them in the `config.yaml`:
2122
```
2223
aligner:
23-
star:
24-
index: '--limitGenomeGenerateRAM 55000000000` # give STAR 55 GB RAM during indexing (default is 31 GB)
25-
align: '--readFilesCommand gunzip -c' # unzips fastqs before aligning
24+
bwa-mem:
25+
index: '-a bwtsw'
26+
align: '-M'
2627
```
2728

28-
The pipeline will check if the assembly you specified is present in the *genome_dir*, and otherwise will download it for you through [genomepy](https://github.com/vanheeringen-lab/genomepy). All these aligners require an index to be formed first for each assembly, but don't worry, the pipeline does this for you.
29+
The pipeline will check if the assembly you specified is present in the *genome_dir*, and otherwise will download it for you through [genomepy](https://github.com/vanheeringen-lab/genomepy).
30+
All these aligners require an index to be formed first for each assembly, but don't worry, the pipeline does this for you.
2931

30-
The outputted alignment.bam is immediately sorted by either samtools or sambamba (*bam_sorter*) either in *queryname* or *coordinate* (default) order. Take a look at our [Choosing an aligner](https://github.com/vanheeringen-lab/snakemake-workflows/wiki/3.-Alignment#choosing-an-appropriate-aligner) section for tips which aligner to use.
32+
The outputted alignment.bam is immediately sorted by either samtools or sambamba (*bam_sorter*) either in *queryname* or *coordinate* (default) order.
3133

3234
#### Custom assembly extensions
3335
The genome and/or gene annotation can be extended with custom files, such as ERCC spike-ins for scRNA-seq. To do so, add `custom_genome_extension: path/to/spike_in.fa` and `custom_annotation_extension: path/to/spike_in.gtf` to the config.
@@ -47,7 +49,9 @@ A UCSC compatible trackhub can be generated for this workflow.
4749
See the [trackhub page](../results.html#trackhub)<!-- @IGNORE PREVIOUS: link --> for more information!
4850

4951
### Filling out the samples.tsv
50-
Before running a workflow you will have to specify which samples you want to run the workflow on. Each workflow starts with a `samples.tsv` as an example, and you should adapt it to your specific needs. As an example, the `samples.tsv` could look something like this:
52+
Before running a workflow you will have to specify which samples you want to run the workflow on.
53+
Each workflow starts with a `samples.tsv` as an example, and you should adapt it to your specific needs.
54+
As an example, the `samples.tsv` could look something like this:
5155
```
5256
sample assembly technical_replicate descriptive_name
5357
GSM123 GRCh38 heart_1 heart_merged
@@ -58,13 +62,30 @@ GSM890 danRer11 stage_9 stage_9
5862
```
5963

6064
#### Sample column
61-
This column is necessary for all workflows, not just the atac-seq workflow. If you use the pipeline on public data this should be the name of the accession (e.g. GSM2837484). If you use the pipeline on local data this should be the *basename* of the file without the *extension(s)*. For instance, `/home/user/myfastqs/sample1.fastq.gz` would be `sample1` (for single-ended data). For paired-ended data `/home/user/myfastqs/sample2_R1.fastq.gz` and `/home/user/myfastqs/sample2_R2.fastq.gz` would be `sample2`.
65+
If you use the pipeline on **public data** this should be the name of the accession (e.g. GSM2837484).
66+
Accepted formats start with "GSM", "SRR", "SRX", "DRR", "DRX", "ERR" or "ERX".
67+
68+
If you use the pipeline on **local data** this should be the *basename* of the file without the *extension(s)*.
69+
For example:
70+
- `/home/user/myfastqs/sample1.fastq.gz` -------> `sample1` for single-ended data
71+
- `/home/user/myfastqs/sample2_R1.fastq.gz` ┬> `sample2` for paired-ended data <br> `/home/user/myfastqs/sample2_R2.fastq.gz`
72+
73+
For **local data**, some fastq files may have slightly different naming formats.
74+
For instance, Illumina may produce a sample named `sample3_S1_L001_R1_001.fastq.gz` (and the `R2` fastq).
75+
Seq2science will attempt to recognize these files based on the sample name `sample3`.
76+
77+
For **both local and public data**, identifiers used to recognize fastq files are the fastq read extensions (`R1` and `R2` by default) and the fastq suffix (`fastq` by default).
78+
The directory where seq2science will store (or look for) fastqs is determined by the `fastq_dir` config option.
79+
In the example above, the `fastq_dir` should be set to `/home/user/myfastqs`.
80+
These setting can be changed in the `config.yaml`.
6281

6382
#### Assembly column
64-
This column is necessary for all workflows, except the *downloading samples* workflow. Here you simply add the name of the assembly you want your samples aligned against and the workflow will download it for you.
83+
Here you simply add the name of the assembly you want your samples aligned against and the workflow will download it for you.
6584

6685
#### Descriptive_name column
67-
The descriptive_name column is used for the trackhub and multiqc report. In the trackhub your tracks will be called after the descriptive name, and in the multiqc report there will be a button to rename your samples after this column. The descriptive name can not contain '-' characters, but underscores '_' are allowed.
86+
The descriptive\_name column is used for the trackhub and multiqc report.
87+
In the trackhub your tracks will be called after the descriptive name, and in the multiqc report there will be a button to rename your samples after this column.
88+
The descriptive name can not contain '-' characters, but underscores '\_' are allowed.
6889

6990
#### Technical_replicate column
7091
Technical replicates, or any fastq file you may wish to merge, are set using the `technical_replicate` column in the samples.tsv file.

docs/content/workflows/atac_seq.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ Running an ATAC-seq analysis has never been easier!
88

99
#### Downloading of sample(s)
1010
Depending on whether the samples you start seq2science with is your own data, public data, or a mix, the pipeline might start with downloading samples.
11-
Take a look at the [downloading_fastq](./download_fastq.html) workflow for extensive documentation about downloading of public samples.
11+
You control which samples are used in the [samples.tsv](#filling-out-the-samples-tsv).
12+
Background on public data can be found [here](./download_fastq.html#download-sra-file).
1213

1314
#### Downloading and indexing of assembly(s)
1415
Depending on whether the assembly and its index you align your samples against already exist seq2science will start with downloading of the assembly through [genomepy](https://github.com/vanheeringen-lab/genomepy).
1516

1617
#### Read trimming
17-
The pipeline starts by trimming the reads with Trim galore or Fastp.
18-
The trimmer will automatically trims the low quality 3' ends of reads, and removes short reads.
19-
After the quality trimming it automatically detects which adapter was used, and trims it.
18+
The pipeline starts by trimming the reads with Trim Galore! or Fastp (the default).
19+
The trimmer will automatically trim the low quality 3' ends of reads, and removes short reads.
20+
During the quality trimming it automatically detects which adapter was used, and trims this as well.
2021
Trimming parameters for the pipeline can be set in the configuration.
2122

2223
#### Alignment
@@ -87,16 +88,33 @@ GSM890 danRer11 stage_9 stage_9 GSM234
8788
```
8889

8990
#### Sample column
90-
This column is necessary for all workflows, not just the ATAC-seq workflow. If you use the pipeline on public data this should be the name of the accession (e.g. GSM2837484), if you use the pipeline on local data this should be the *basename* of the file without the *extension*. For instance `/home/user/myfastqs/sample1.fastq.gz` would be `sample1`.
91+
If you use the pipeline on **public data** this should be the name of the accession (e.g. GSM2837484).
92+
Accepted formats start with "GSM", "SRR", "SRX", "DRR", "DRX", "ERR" or "ERX".
93+
94+
If you use the pipeline on **local data** this should be the *basename* of the file without the *extension(s)*.
95+
For example:
96+
- `/home/user/myfastqs/sample1.fastq.gz` -------> `sample1` for single-ended data
97+
- `/home/user/myfastqs/sample2_R1.fastq.gz` ┬> `sample2` for paired-ended data <br> `/home/user/myfastqs/sample2_R2.fastq.gz`
98+
99+
For **local data**, some fastq files may have slightly different naming formats.
100+
For instance, Illumina may produce a sample named `sample3_S1_L001_R1_001.fastq.gz` (and the `R2` fastq).
101+
Seq2science will attempt to recognize these files based on the sample name `sample3`.
102+
103+
For **both local and public data**, identifiers used to recognize fastq files are the fastq read extensions (`R1` and `R2` by default) and the fastq suffix (`fastq` by default).
104+
The directory where seq2science will store (or look for) fastqs is determined by the `fastq_dir` config option.
105+
In the example above, the `fastq_dir` should be set to `/home/user/myfastqs`.
106+
These setting can be changed in the `config.yaml`.
91107

92108
#### Assembly column
93-
This column is necessary for all workflows, except the *downloading samples* workflow. Here you simply add the name of the assembly you want your samples aligned against and the workflow will download it for you.
109+
Here you simply add the name of the assembly you want your samples aligned against and the workflow will download it for you.
94110

95111
#### Control column
96112
In the `control` column you can (optionally) add the "sample name" of the input control, although it is not common to generate this for ATAC-seq.
97113

98114
#### Descriptive_name column
99-
The descriptive_name column is used for the trackhub and multiqc report. In the trackhub your tracks will be called after the descriptive name, and in the multiqc report there will be a button to rename your samples after this column. The descriptive name can not contain '-' characters, but underscores '_' are allowed.
115+
The descriptive\_name column is used for the trackhub and multiqc report.
116+
In the trackhub your tracks will be called after the descriptive name, and in the multiqc report there will be a button to rename your samples after this column.
117+
The descriptive name can not contain '-' characters, but underscores '\_' are allowed.
100118

101119
#### Technical_replicate column
102120
Technical replicates, or any fastq file you may wish to merge, are set using the `technical_replicate` column in the samples.tsv file.

0 commit comments

Comments
 (0)