Skip to content

Commit

Permalink
Merge branch 'CW-3590' into 'dev'
Browse files Browse the repository at this point in the history
rename newly added 'run_ids' column to 'run_id' [CW-3590]

Closes CW-3590

See merge request epi2melabs/workflows/wf-cas9!55
  • Loading branch information
julibeg committed Feb 21, 2024
2 parents baf8246 + 954dc2f commit 7811221
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.1.1]
### Changed
- The name of the column with run IDs from `run_ids` to `run_id`.

## [v1.1.0]
### Added
- A column with sequencing run IDs to the output summary CSV files.
Expand Down
12 changes: 6 additions & 6 deletions bin/workflow_glue/build_tables.py
Expand Up @@ -47,7 +47,7 @@ def main(args):
"""Entry point."""
header = [
'chr', 'start', 'end', 'target', 'nreads', 'nbases',
'tsize', 'coverage_frac', 'median_cov', 'p', 'n', 'sample_id', 'run_ids']
'tsize', 'coverage_frac', 'median_cov', 'p', 'n', 'sample_id', 'run_id']

frames = []

Expand Down Expand Up @@ -125,7 +125,7 @@ def main(args):
'mean_read_length': 1})

df_all = df_all[[
'sample', 'run_ids', 'chr', 'start', 'end', 'target', 'tsize',
'sample', 'run_id', 'chr', 'start', 'end', 'target', 'tsize',
'kbases', 'coverage_frac', 'median_cov', 'nreads',
'mean_read_length', 'strand_bias']]
df_all.sort_values(
Expand All @@ -149,16 +149,16 @@ def main(args):
sample_df['nreads'] = df['nreads'].sum()
sample_df = sample_df.round(2)
sample_df['sample_id'] = sid
# the `run_ids` column should contain the same value for all rows for this
# the `run_id` column should contain the same value for all rows for this
# sample
sample_df["run_ids"], = df["run_ids"].unique()
sample_df["run_id"], = df["run_id"].unique()
dfs.append(sample_df)

if dfs:
sample_summary = pd.concat(dfs, axis=1).T
sample_summary.set_index('sample_id', drop=True, inplace=True)
# move the `run_ids` column to the beginning of the dataframe
sample_summary.insert(0, "run_ids", sample_summary.pop("run_ids"))
# move the `run_id` column to the beginning of the dataframe
sample_summary.insert(0, "run_id", sample_summary.pop("run_id"))
else:
sample_summary = pd.DataFrame()

Expand Down
2 changes: 1 addition & 1 deletion main.nf
Expand Up @@ -210,7 +210,7 @@ process target_summary {
# Add sample_id column
sed -i "s/\$/\t${meta.alias}/" ${meta.alias}_target_summary.bed
# Add run_ids column
# Add run_id column
sed -i "s/\$/\t${meta.run_ids.join(',')}/" ${meta.alias}_target_summary.bed
rm median_coverage.bed pos.bed neg.bed
Expand Down
2 changes: 1 addition & 1 deletion nextflow.config
Expand Up @@ -53,7 +53,7 @@ manifest {
description = 'Summarise the results of Cas9 enrichment sequencing.'
mainScript = 'main.nf'
nextflowVersion = '>=23.04.2'
version = 'v1.1.0'
version = 'v1.1.1'

}

Expand Down

0 comments on commit 7811221

Please sign in to comment.