Skip to content

Commit

Permalink
catch if sc2rf has no output
Browse files Browse the repository at this point in the history
  • Loading branch information
Katherine Eaton authored and ktmeaton committed Apr 14, 2022
1 parent 6421136 commit 3088ad6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/sc2rf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ cd sc2rf;
echo "python3 sc2rf.py ${aligned} ${sc2rf_args[@]}" > ${outdir}/${prefix}.txt;
python3 sc2rf.py ${aligned} ${sc2rf_args[@]} 1>> ${outdir}/${prefix}.txt 2> ${log};

# Check if any recombinants were detected"
if [[ -s ${prefix}.csv ]]; then

# rename tabular columns
# + placeholder until breakpoints/intermissions regions are reported
csvtk rename -f "sample" -n "strain" ${outdir}/${prefix}.csv \
Expand All @@ -64,3 +67,8 @@ csvtk rename -f "sample" -n "strain" ${outdir}/${prefix}.csv \
| csvtk mutate2 -n "sc2rf_intermissions_regions" -e '""' \
| csvtk csv2tab \
> ${outdir}/${prefix}.tsv

# If not, touch an empty tabular file
else
touch ${outdir}/${prefix}.tsv
fi

0 comments on commit 3088ad6

Please sign in to comment.