Entering edit mode
7.3 years ago
l.souza
▴
80
I have a FASTA file with 200 sequences, and I would like to know the average of nucleotides. How can I get it?
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
seqkit stats input.fasta
Look at avg.len field and link to seqkit: http://bioinf.shenwei.me/seqkit/download/
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
I edited the title to be consistent with the question.