Skip to content

Commit 66ef531

Browse files
committed
update output docs
1 parent 7326af5 commit 66ef531

2 files changed

Lines changed: 41 additions & 3 deletions

File tree

bin/compare_performance.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ get_stats <- function(i_exp,i_obs,df,sample) {
3636

3737
# save
3838
types <- c(
39-
"detected",
39+
"observed",
4040
"expected",
4141
"TP",
4242
"FN",
@@ -131,7 +131,7 @@ for (sample in SAMPLES) {
131131
s_exp <- subset(exp, select = keep_cols)
132132
s_obs <- subset(observed, select = keep_cols)
133133

134-
# keep only detected (abundance > 0)
134+
# keep only observed (abundance > 0)
135135
s_exp = s_exp[s_exp[,2] > 0,]
136136
s_obs = s_obs[s_obs[,2] > 0,]
137137

docs/output.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,21 +662,59 @@ On request (`--ancombc2`), ANCOM-BC2 is applied to each suitable or specified me
662662

663663
Comparison evaluates observed results against expected outcomes, typically for samples with known composition such as mock communities, to assess the data and analysis. Steps to evaluate the produced ASVs are implemented in the pipeline.
664664

665+
When expected sequences are supplied, the following files will be produced:
666+
665667
<details markdown="1">
666668
<summary>Output files</summary>
667669

668670
- `comparison/<parameter md5sum>_<pipeline version>`
669671
- `vsearch_usearchglobal.tsv`: VSEARCH --usearch_global output for ASV to sequence comparisons.
670672
- `md5sum_version.txt`: Contains parameter md5sum and pipeline version that is also the folder name, additionally the time stamp used in files in `pipeline_info/`.
671673
- `nucleotide-differences.log`: Log file for comparing matches of ASVs to expected sequences.
672-
- `nucleotide-differences.tsv`: Tabl-separated table based on VSEARCH results comparing matches of ASVs to expected sequences.
674+
- `nucleotide-differences.tsv`: Tab-separated table based on VSEARCH results comparing matches of ASVs to expected sequences.
673675
- `comparison/<parameter md5sum>_<pipeline version>/per-sample`
674676
- `<sample>_nucleotide-differences_per-sample.tsv`: Number of sequences and mismatches to expected sequences.
675677
- `<sample>_nucleotide-distance_barplot.png`: Barplot of number of sequences versus number of mismatches in png format.
676678
- `<sample>_nucleotide-distance_barplot.svg`: Barplot of number of sequences versus number of mismatches in svg format.
677679

678680
</details>
679681

682+
When additionally expected abundances are available, additional performance metrics will be generated:
683+
684+
- `observed`: Number of observed sequences
685+
- `expected`: Number of expected sequences
686+
- `TP`: Number of true positive sequences (observed and expected)
687+
- `FN`: Number of false negative sequences (not observed but expected)
688+
- `FP`: Number of false positive sequences (observed but not expected)
689+
- `recall`: Recall of expected sequences = TP/(TP+FN)
690+
- `precision`: Precision = TP/(TP+FP)
691+
- `F1`: F1 score, the harmonic mean of the precision and recall = 2TP/(2TP+FP+FN)
692+
- `Fbeta`: Fbeta score, the weighted F1 score. By default beta=2, i.e. weighs recall twice higher than precision
693+
- `fdr`: False discovery rate = FP/(TP+FP)
694+
- `jaccard`: Jaccard index = TP/(TP+FP+FN)
695+
- `TPs_exp`: TP IDs (max 100) corresponding to expected sequences
696+
- `FNs_exp`: FN IDs (max 100) corresponding to expected sequences
697+
- `FPs_obs`: FP IDs (max 100) corresponding to observed sequences
698+
699+
> [!NOTE]
700+
> The F1 score is unreliable with strongly unbalanced data.
701+
702+
The following additional files will be produced:
703+
704+
<details markdown="1">
705+
<summary>Output files</summary>
706+
707+
- `comparison/<parameter md5sum>_<pipeline version>`
708+
- `performance_summary.tsv`: Tab-separated table with aggregated performance metrics.
709+
- `performance.log`: Log file, complementary to `nucleotide-differences.log`.
710+
- `performance_boxplot.png`: Boxplot of number of aggregated performance metrics in png format.
711+
- `performance_boxplot.svg`: Boxplot of number of aggregated performance metrics in svg format.
712+
- `comparison/<parameter md5sum>_<pipeline version>/per-sample`
713+
- `performance_per-sample.tsv`: Tab-separated table with performance metrics per sample, in long format.
714+
715+
716+
</details>
717+
680718
### PICRUSt2
681719

682720
PICRUSt2 (Phylogenetic Investigation of Communities by Reconstruction of Unobserved States) is a software for predicting functional abundances based only on marker gene sequences. On demand (`--picrust`), Enzyme Classification numbers (EC), KEGG orthologs (KO) and MetaCyc ontology predictions will be made for each sample.

0 commit comments

Comments
 (0)