Hi all,
I have 6 sequences in a fasta file as shown below,
>seq1
ATGAT
>gen1
TAGTA
>org2
TATAA
>seq7
ATGCA
I would like to extract a sequence based on its position, for example, I need to extract 3rd position fasta sequence,
>org2
TATAA
I can use samtools faidx command for fasta header/id based sequence extraction. But, here I need to extract based on its position. Please help me to do the same.
Thanks in advance
with sed and grep (assuming that fasta is linearized) with OP fasta: