This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Obtain N50 stats from NCBI for all Hymenoptera genome assemblies

Hello,

I would like to obtain scaffold N50 from all Hymenoptera genome assemblies found in NCBI page under Global statistics (e.g https://www.ncbi.nlm.nih.gov/assembly/GCF_000214255.1). Is there a way to quicky have access to these stats? I am looking for a dump-like command line.

Thanks in advance!

n50 ncbi

I always find convinient to start with NCBI Taxonomy. One approach can be -

1 answer

You can use Entrez Direct for this as shown below:

esearch -db assembly -query 'txid7399[organism:exp]' \
  | esummary \
  | xtract -pattern DocumentSummary -element AssemblyAccession,AssemblyName,SpeciesTaxid,Organism,ContigN50,ScaffoldN50
GCA_000184785.2  Aflo_1.1                  7463     Apis florea (little honeybee)                        24915    2863240
GCA_009650705.1  Solenopsis_invicta_SB1.0  13686    Solenopsis invicta (red fire ant)                    945877   13114153
GCA_009602685.1  ASM960268v1               63436    Leptopilina heterotoma (wasps, ants, and bees)       9278     11848
GCA_009299975.1  ASM929997v1               13686    Solenopsis invicta (red fire ant)                    874937   16736736
GCA_009299965.1  ASM929996v1               13686    Solenopsis invicta (red fire ant)                    278331   11613644

Really liked this solution!

I used this and it was perfect for my needs. Now I also want the date of the assembly. I tried the following but the resulting file was the same as your result (ie no column for the date). Do you know how I could do this?

esearch -db assembly -query 'txid7399[organism:exp]' \
  | esummary \
  | xtract -pattern DocumentSummary -element AssemblyAccession,Date,AssemblyName,SpeciesTaxid,Organism,ContigN50,ScaffoldN50

You need to provide the complete element name, for example AsmReleaseDate_RefSeq, as shown below:

esearch -db assembly -query 'txid7399[organism:exp]' \
  | esummary \
  | xtract -pattern DocumentSummary -element AssemblyAccession,AsmReleaseDate_RefSeq,AssemblyName,SpeciesTaxid,Organism,ContigN50,ScaffoldN50
GCA_010883055.1 1/01/01 00:00   B_treatae_v1    1159321 Belonocnema treatae (wasps, ants, and bees)     19588   150973230
GCA_010645185.1 1/01/01 00:00   Tetragonula_hockingsi_1.1       270528  Tetragonula hockingsi (bees)    10501   10501
GCA_010645165.1 1/01/01 00:00   Tetragonula_davenporti_1.1      597209  Tetragonula davenporti (bees)   18510   18510
GCA_010645135.1 1/01/01 00:00   Tetragonula_clypearis_1.1       270525  Tetragonula clypearis (bees)    14852   14852

Log in to answer this question.