
#+TITLE: NCBI Entrez utilities





* Download genome assemblies from taxid

** basic usage

#+BEGIN_SRC 
taxid2genomes.py -t <NCBI-taxid>
#+END_SRC

** keep only complete genomes

#+BEGIN_SRC 
taxid2genomes.py -t <NCBI-taxid> -c
#+END_SRC

* Download genome assemby from genome assembly accession

** Basic usage

#+BEGIN_SRC 
assembly_accession2genome.py -i <assembly accession>
#+END_SRC

** Download only gbff file

#+BEGIN_SRC sh
assembly_accession2genome.py -i <assembly accession> -g
#+END_SRC

* Get statistics about number number of sra entries linked to each boproject associated to a given taxid  

- under dev
- useful to search for large datasets to bechmark our pipeline

#+BEGIN_SRC 
taxid2bioprojects_sra.py
#+END_SRC

* Get table of genome assemblies linked to a given taxid

** get list of all genome assemblies of a given taxid

#+BEGIN_SRC sh
get_genomes_chlassification.py -t <NCBI-taxid> -o <output_file>
#+END_SRC

** restrict the search to refseq or genbank assemblies

- eg only assemblies available in refseq

#+BEGIN_SRC sh
get_genomes_chlassification.py -t <NCBI-taxid> -rs -o <output_file>
#+END_SRC

** keep only 1 assembly/taxonomic rank

- eg 1 genome per genus
- representative genomes are selected randomly for each genus, but priority is given to: 1) complete genomes 2) reference genomes 3) representative genomes

#+BEGIN_SRC sh
get_genomes_chlassification.py -t <NCBI-taxid> -gb -ra genus -o <output_file>
#+END_SRC
