From 873a46f0c0da6edf7b2264ff2107cb03620afc21 Mon Sep 17 00:00:00 2001 From: Chris Wright Date: Wed, 24 Feb 2021 12:49:21 +0000 Subject: [PATCH] Sort items in report --- CHANGELOG.md | 1 + main.nf | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4742f..f9f55f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [v0.0.7] ## Changed - Sample sheet is no longer required. +- Sort report items consistently by sample name. - Nextclade visual will display overlap to primer scheme selected by user. ## [v0.0.6] diff --git a/main.nf b/main.nf index 71f7f22..5e7b310 100644 --- a/main.nf +++ b/main.nf @@ -170,7 +170,7 @@ report_doc = report.HTMLReport( def read_files(pattern): dfs = list() - for fname in glob.glob(pattern): + for fname in sorted(glob.glob(pattern)): dfs.append(pd.read_csv(fname, sep="\\t")) return pd.concat(dfs) @@ -250,7 +250,7 @@ df = read_files("depths_*.txt") plots_pool = list() plots_orient = list() depth_lim = 100 -for sample in df['sample_name'].unique(): +for sample in sorted(df['sample_name'].unique()): bc = df['sample_name'] == sample depth = df[bc].groupby('pos')['depth'].sum() depth_thresh = 100*(depth >= depth_lim).sum() / len(depth) @@ -330,11 +330,11 @@ process allConsensus { label "artic" cpus 1 input: - file "sample_*.fastq" + file "*" output: file "all_consensus.fasta" """ - cat sample_*.fastq > all_consensus.fasta + ls *.consensus.fasta | xargs cat > all_consensus.fasta """ }