Last active
January 22, 2016 08:23
-
-
Save genomewalker/cf4cb3f50092e398762b to your computer and use it in GitHub Desktop.
This file contains 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 | |
# We need one fasta file export with the aligned sequences and another with the SS SAI filter | |
ALIGN=${1} | |
OFILE=${1/.fasta/.stk} | |
# Creating the first part of the file | |
# we need to linearize the fasta file | |
awk ' | |
BEGIN{ | |
RS=">" | |
print "# STOCKHOLM 1.0" | |
} | |
{ | |
if ($0 ~ /HelBacte/) | |
{ | |
exit | |
} | |
} | |
{ | |
sub("\n","\t"); | |
gsub("\n",""); | |
gsub(" ",""); | |
gsub("\t"," "); | |
print $0 | |
} | |
' ${ALIGN} > ${OFILE} | |
# We linearize the SS SAI and add to the converted file | |
awk 'BEGIN{RS="HelBacte"}NR>1{sub("\n","\t"); gsub("\n",""); gsub(" ",""); gsub("\t"," "); print $0}' ${ALIGN} |awk '{print "#=GC SS_cons"$0"\n//"}' >> ${OFILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment