# split fasta file into separate sequence files
#
if [ $# -gt 1 ]
then
seqfile="$1"
destdir="$2"
else
echo "Use: fsplit SEQFILE DESTDIR"
echo " Splits fasta file SEQFILE into separate files in DESTDIR folder"
exit
fi
mkdir $2
#names the fa files as sequence00 i.e. with padding
#csplit -f $destdir/sequence $seqfile "%^>%" "/^>/" "{*}" -s
#names the fa files as sequence0 i.e. without padding
csplit -n 1 -f $destdir/sequence $seqfile "%^>%" "/^>/" "{*}" -s
No comments:
Post a Comment