Skip to content

Commit

Permalink
Update ass_reorder.tera.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-q committed Jun 2, 2023
1 parent 2f361bf commit 10fbde5
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions templates/ass_reorder.tera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,22 @@ find . -maxdepth 3 -mindepth 2 -type f -name "*_genomic.fna.gz" |

cat misplaced.tsv |
parallel --colsep '\t' --no-run-if-empty --linebuffer -k -j 1 '
TARGET=$(
SPECIES=$(
tsv-filter url.tsv --str-in-fld "1:{2}" |
tsv-select -f 3,1 |
tr "\t" "/"
tsv-select -f 3
)
if [ -e ${TARGET} ]; then
echo >&2 "${TARGET} exiests"
else
echo >&2 "Moving ${TARGET}"
mv {1} "${TARGET}"
NAME=$(
tsv-filter url.tsv --str-in-fld "1:{2}" |
tsv-select -f 1
)
if [ ! -z "${NAME}" ]; then
if [ -e "${SPECIES}/${NAME}" ]; then
echo >&2 "${SPECIES}/${NAME} exists"
else
echo >&2 "Moving {1} to ${SPECIES}/${NAME}"
mkdir -p "${SPECIES}"
mv {1} "${SPECIES}/${NAME}"
fi
fi
'

Expand Down

0 comments on commit 10fbde5

Please sign in to comment.