Skip to content

Commit

Permalink
making loose end cluster numbers build from existing
Browse files Browse the repository at this point in the history
  • Loading branch information
DOH-JDJ0303 committed Apr 27, 2024
1 parent fa05f11 commit d6067d9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/local/bind-clusters.nf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ process BIND_CLUSTERS {
prefix = "${taxa}-${segment}"
"""
header="seq,taxa,segment,cluster"
if [ -f "${prefix}-looseends.csv " ]
then
max_n=\$(cat *main.csv | cut -f 4 -d ',' | sort -rn)
mv ${prefix}-looseends.csv tmp && cat tmp | grep -v "\$header" | tr ',' '\t' | awk -v max=\${max_n} -v OFS=',' '{print $1,$2,$3,$4+max}' > ${prefix}-looseends.csv
rm tmp
fi
echo \$header > ${prefix}-clusters.csv
cat ${clusters} | grep -v "\$header" >> ${prefix}-clusters.csv
"""
Expand Down

0 comments on commit d6067d9

Please sign in to comment.