CW-1167: error if conditionsheet and sample sheet dont match
This commit is contained in:
parent
248ecdb55b
commit
a111cae834
@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Added
|
### Added
|
||||||
- Demo differential expression data in repository.
|
- Demo differential expression data in repository.
|
||||||
- Improved DE explanation in docs
|
- Improved DE explanation in docs
|
||||||
|
### Fixed
|
||||||
|
- Error if condition sheet and sample sheet don't match.
|
||||||
|
|
||||||
## [v0.1.5]
|
## [v0.1.5]
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@ -206,14 +206,14 @@ Differential Expression requires at least 2 replicates of each sample to compare
|
|||||||
|
|
||||||
#### Condition sheet
|
#### Condition sheet
|
||||||
The condition sheet should be a .tsv with two columns.
|
The condition sheet should be a .tsv with two columns.
|
||||||
- The sample column will need to match the 6 directories in the input fastq directory.
|
- The sample_id column will need to match the 6 directories in the input fastq directory, if you are additionally using a sample_sheet they will need to correspond to the sample_ids in that.
|
||||||
- The condition column will need to contain one of two keys to indicate the two samples being compared.
|
- The condition column will need to contain one of two keys to indicate the two samples being compared.
|
||||||
|
|
||||||
In the default `condition_sheet.tsv` available in the test_data directory we have used the following.
|
In the default `condition_sheet.tsv` available in the test_data directory we have used the following.
|
||||||
|
|
||||||
eg. condition_sheet.tsv
|
eg. condition_sheet.tsv
|
||||||
```
|
```
|
||||||
sample,condition
|
sample_id,condition
|
||||||
barcode01,untreated
|
barcode01,untreated
|
||||||
barcode02,untreated
|
barcode02,untreated
|
||||||
barcode03,untreated
|
barcode03,untreated
|
||||||
|
|||||||
@ -7,7 +7,8 @@ cat("Loading counts, conditions and parameters.\n")
|
|||||||
cts <- as.matrix(read.csv("merged/all_counts.tsv", sep="\t", row.names="Reference", stringsAsFactors=FALSE))
|
cts <- as.matrix(read.csv("merged/all_counts.tsv", sep="\t", row.names="Reference", stringsAsFactors=FALSE))
|
||||||
|
|
||||||
# Set up sample data frame:
|
# Set up sample data frame:
|
||||||
coldata <- read.csv("de_analysis/coldata.tsv", row.names="sample", sep=",", stringsAsFactors=TRUE)
|
#changed this to sample_id
|
||||||
|
coldata <- read.csv("de_analysis/coldata.tsv", row.names="sample_id", sep=",", stringsAsFactors=TRUE)
|
||||||
|
|
||||||
coldata$sample_id <- rownames(coldata)
|
coldata$sample_id <- rownames(coldata)
|
||||||
coldata$condition <- factor(coldata$condition, levels=rev(levels(coldata$condition)))
|
coldata$condition <- factor(coldata$condition, levels=rev(levels(coldata$condition)))
|
||||||
|
|||||||
@ -5,7 +5,7 @@ suppressMessages(library(ggplot2))
|
|||||||
suppressMessages(library(tidyr))
|
suppressMessages(library(tidyr))
|
||||||
|
|
||||||
# Set up sample data frame:
|
# Set up sample data frame:
|
||||||
coldata <- read.csv("de_analysis/coldata.tsv", row.names="sample", sep=",")
|
coldata <- read.csv("de_analysis/coldata.tsv", row.names="sample_id", sep=",")
|
||||||
coldata$sample_id <- rownames(coldata)
|
coldata$sample_id <- rownames(coldata)
|
||||||
coldata$condition <- factor(coldata$condition, levels=rev(levels(coldata$condition)))
|
coldata$condition <- factor(coldata$condition, levels=rev(levels(coldata$condition)))
|
||||||
coldata$type <-NULL
|
coldata$type <-NULL
|
||||||
|
|||||||
@ -124,14 +124,14 @@ Differential Expression requires at least 2 replicates of each sample to compare
|
|||||||
|
|
||||||
#### Condition sheet
|
#### Condition sheet
|
||||||
The condition sheet should be a .tsv with two columns.
|
The condition sheet should be a .tsv with two columns.
|
||||||
- The sample column will need to match the 6 directories in the input fastq directory.
|
- The sample_id column will need to match the 6 directories in the input fastq directory, if you are additionally using a sample_sheet they will need to correspond to the sample_ids in that.
|
||||||
- The condition column will need to contain one of two keys to indicate the two samples being compared.
|
- The condition column will need to contain one of two keys to indicate the two samples being compared.
|
||||||
|
|
||||||
In the default `condition_sheet.tsv` available in the test_data directory we have used the following.
|
In the default `condition_sheet.tsv` available in the test_data directory we have used the following.
|
||||||
|
|
||||||
eg. condition_sheet.tsv
|
eg. condition_sheet.tsv
|
||||||
```
|
```
|
||||||
sample,condition
|
sample_id,condition
|
||||||
barcode01,untreated
|
barcode01,untreated
|
||||||
barcode02,untreated
|
barcode02,untreated
|
||||||
barcode03,untreated
|
barcode03,untreated
|
||||||
|
|||||||
5
main.nf
5
main.nf
@ -471,6 +471,11 @@ workflow pipeline {
|
|||||||
transcriptome = ref_transcriptome
|
transcriptome = ref_transcriptome
|
||||||
gtf = Channel.fromPath(ref_annotation)
|
gtf = Channel.fromPath(ref_annotation)
|
||||||
}
|
}
|
||||||
|
check_match = Channel.fromPath(params.condition_sheet)
|
||||||
|
check_condition_sheet = check_match.splitCsv(header: true).map{ row -> tuple(
|
||||||
|
row.sample_id)
|
||||||
|
}
|
||||||
|
check_condition_sheet.join(summariseConcatReads.out.input_reads, failOnMismatch: true)
|
||||||
de = differential_expression(transcriptome, summariseConcatReads.out.input_reads, condition_sheet, gtf)
|
de = differential_expression(transcriptome, summariseConcatReads.out.input_reads, condition_sheet, gtf)
|
||||||
de_report = de.all_de
|
de_report = de.all_de
|
||||||
count_transcripts_file = de.count_transcripts
|
count_transcripts_file = de.count_transcripts
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
sample,condition
|
sample_id,condition
|
||||||
barcode01,untreated
|
barcode01,untreated
|
||||||
barcode02,untreated
|
barcode02,untreated
|
||||||
|
barcode03,untreated
|
||||||
barcode04,treated
|
barcode04,treated
|
||||||
barcode05,treated
|
barcode05,treated
|
||||||
barcode06,treated
|
barcode06,treated
|
||||||
|
|||||||
|
Loading…
Reference in New Issue
Block a user