Skip to content

Commit

Permalink
Rmarkdown report fails: Detected 7 column names but the data has 5 co…
Browse files Browse the repository at this point in the history
…lumns

Fixes #72
  • Loading branch information
MarieLataretu committed Apr 24, 2024
1 parent 453eb8f commit bdc0ee4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bin/summary_report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ dt.president_results <- as.data.table(ldply(params$president_results, fread, sep
dt.pangolin_results <- as.data.table(ldply(params$pangolin_results, fread))
dt.nextclade_results <- as.data.table(ldply(params$nextclade_results, fread, sep='\t'))
dt.sc2rf_results <- as.data.table(ldply(params$sc2rf_results, fread, sep=','))
names(dt.sc2rf_results) <- c('sample','examples','intermissions','breakpoints','regions')
names(dt.sc2rf_results) <- c('sample','examples','intermissions','breakpoints','regions','unique_subs','alleles')
if(params$vois_results != 'none'){
dt.vois_results <- as.data.table(ldply(params$vois_results, fread))
}
Expand Down
4 changes: 2 additions & 2 deletions modules/sc2rf.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ process sc2rf {
if [[ \$(wc -l <${name}_sc2rf.csv) -eq 0 ]]
then
# add empty csv line, if no output at all (e.g. script teminates with parameter problem, but exits with 0)
echo ${name},,,, >> ${name}_sc2rf.csv
echo ${name},,,,,, >> ${name}_sc2rf.csv
elif [[ \$(wc -l <${name}_sc2rf.csv) -eq 1 ]]
then
# only header as output
# remove header because of weired newline character after header that breaks the R report
# overwrite with empty csv line
echo ${name},,,, > ${name}_sc2rf.csv
echo ${name},,,,,, > ${name}_sc2rf.csv
else
# remove header because of weired newline character after header that breaks the R report
sed -i 1d ${name}_sc2rf.csv
Expand Down

0 comments on commit bdc0ee4

Please sign in to comment.