I'd like to delete a line if it does not start with "a" "c" "t" or "g", and the next line starts with '>'. In the following example, "`>seq3" is deleted.
Input:
>seq1 actgatgac >seq2 ctgacgtca >seq3 >seq4 gtagctagt >seq5 tgacatgca Expected output:
>seq1 actgatgac >seq2 ctgacgtca >seq4 gtagctagt >seq5 tgacatgca I've tried with sed (sed '/^>.*/{$!N;/^>.*/!P;D}' and sed '/^>/{$d;N;/^[aA;cC;gG;tT]/!D}') but got no success.