Extract Sequence Lengths From Formatdb Output?
2
1
Entering edit mode
12.3 years ago
Dan ▴ 540

Is it possible to get a list of sequence lengths from formatdb output? I figure one of the index files contains this information.

Else I'm stuck using BioPerl to calculate lengths per sequence...

Cheers, Dan.

fasta • 2.2k views
ADD COMMENT
0
Entering edit mode
12.3 years ago

I don't know about blast but with the blast+ utility tools you can use blastdbcmd in the following way:

$ cat test.fa
>seq1
A
>seq2
TT
>seq3
CCC
>seq4
GGGG
$
$ makeblastdb -in test.fa -dbtype nucl -parse_seqids
$
$ blastdbcmd  -db test.fa -entry all -outfmt "%i %l"
lcl|seq1 1
lcl|seq2 2
lcl|seq3 3
lcl|seq4 4
ADD COMMENT
0
Entering edit mode
12.3 years ago
Rm 8.3k

with blast formatted fasta db you can try

fastacmd -d input.fa -s seqID -l 1000000000000000000000000000 | tr "\n" "\t" | awk ' BEGIN {OFS = FS = "\t"};{  print $1, length($2) }'
ADD COMMENT

Login before adding your answer.

Traffic: 1256 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