Thank you, Pierre Lindenbaum!
• 0 views
•
link
I have a FASTA file with 200 sequences, and I would like to know the average of nucleotides. How can I get it?
awk '/^>/ {N++;next;} {B+=length($0);} END {printf("%f\n",B/N);}' input.fasta
Thank you, Pierre Lindenbaum!
seqkit stats input.fasta
Look at avg.len field and link to seqkit: http://bioinf.shenwei.me/seqkit/download/
Log in to answer this question.
I edited the title to be consistent with the question.