#!/usr/bin/awk -f # Tue Oct 21 10:22:36 CEST 2008 # This program receives a file in fasta format and prepares it to be used with RNAfold, i.e. with the whole sequence in a single line #Use: >./fasta2vienna.awk file BEGIN{ RS=">" FS="\n" } # Breaks each sequence by newline characters. It prints all 80mers together { if(NR>=2){ # NR has to start at 2, otherwise it prints useless lines. seq=$0 split(seq, a, "\n"); i=2 printf ">%s\n", a[1] while(a[i]!=""){ printf "%s", a[i] i++ } printf "%s\n", "" } }