From 7065e22ab30c6cfaa96481c685b3272d452f4cb7 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Wed, 17 Mar 2021 21:54:38 -0600 Subject: [PATCH] Convert a ClearLabs fasta tarball on Linux --- convert-fastas.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 convert-fastas.sh diff --git a/convert-fastas.sh b/convert-fastas.sh new file mode 100755 index 0000000..2cea868 --- /dev/null +++ b/convert-fastas.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Untars the ClearLabs bulk download and converts it to a single FASTA suitable +# for online sequence analyzers + +# Pull in the tarball name +FASTAFILE=${1} + +# Determine what the nasty name is +FASTANAME=$(basename -s .fastas.tar "$FASTAFILE") + +# Make a new folder to put everything in +mkdir "$FASTANAME" + +# Untar the tarball +tar -xf "$FASTAFILE" -C "$FASTANAME" + +# Smash all of the FASTAs together into a single file +cat "$FASTANAME"/*.fasta > "$FASTANAME"/"$FASTANAME".fasta