I have multiple fasta files with 1000s of seqs in each file of varying length. I would like to keep only the first 200 (n) bases from each sequence. How can I do this in Perl?
Difficult to understand exactly what you mean without seeing an example but if you only need the first 200 characters per line just use cut
:
cut -c1-200 file