Created
May 22, 2013 11:15
-
-
Save pjbriggs/5626830 to your computer and use it in GitHub Desktop.
Hacky script for converting fasta files munged by some other program into RTF files back to fasta format (used for frog data). Probably output file will need some additional corrections by hand.
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/sh | |
# | |
if [ -z "$1" ] || [ -z "$2" ] ; then | |
echo "Usage: $0 IN.rtf OUT.fasta" | |
exit 1 | |
fi | |
if [ ! -e "$1" ] ; then | |
echo "Input file $1 not found" | |
exit 1 | |
fi | |
sed 's/.*>/>/g' "$1" | sed 's/^\\f[0-9]/>/g' | sed 's/^\\//g' | sed 's/\\$//g' | sed 's/\t$//g' | sed 's/^> />/g' | sed 's/^>$//g' | sed 's/\t//g' | sed 's/^[^ACGT>]*//g' | grep -v "^$" > $2 | |
## | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment