Created
October 10, 2023 11:43
-
-
Save nylander/fc24a5ea917921852f63e310d6ac8fd7 to your computer and use it in GitHub Desktop.
Convert blast output with sseq as last column to fasta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# blast2fasta | |
# Parse output from blast where we have sseq as the last column. | |
# For example (argument to blastn): "-outfmt '6 qseqid sseq'". | |
# Reads from file, writes to stdout. | |
# By Johan Nylander | |
# 2023-Oct-10 | |
# Usage: blast2fasta.sh file | |
file=$1 | |
awk '{printf ">%s", $1; for(i=2;i<NF;i++) printf " %s", $i; printf "\n%s\n", $NF}' "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment