Nucleotide statistics for fasta sequences
2
0
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?

sequences • 4.9k views
ADD COMMENT
0
Entering edit mode

I edited the title to be consistent with the question.

ADD REPLY
1
Entering edit mode
7.3 years ago
awk '/^>/ {N++;next;} {B+=length($0);} END {printf("%f\n",B/N);}' input.fasta
ADD COMMENT
0
Entering edit mode

Thank you, Pierre Lindenbaum!

ADD REPLY
4
Entering edit mode
7.3 years ago
seqkit stats input.fasta

Look at avg.len field and link to seqkit: http://bioinf.shenwei.me/seqkit/download/

ADD COMMENT

Login before adding your answer.

Traffic: 2201 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6