Hi,
I have fasta file containing loci of like 500 introns. I don't know how to have just the first 100 bases using awk command lines. I have the following command that I used to pick the last 100 nt of the sequences. I thought it might help: sed -Ee 's/^.*(.{100})$/\1/' file.fasta
Thanks, Farid
did you try
sed -E '/>/! s/^(.{100}).*/\1/'
? or you can use seqkit (seqkit subseq -r 1:100
). With awk:awk -v OFS="\n" '{getline seq} {print $0, substr(seq,1,100)}'