No description
Find a file
Nicolas Cellier 29290d90fa Merge branch 'celliern-master-patch-50838' into 'master'
Corriger l’adresse git

See merge request celliern/entrez_fetch!1
2021-02-05 15:46:43 +00:00
entrez_fetcher update 2021-01-29 16:55:11 +01:00
.gitignore first commit 2021-01-29 16:54:34 +01:00
README.md Corriger l’adresse git 2021-02-05 15:46:08 +00:00
setup.cfg first commit 2021-01-29 16:54:34 +01:00
setup.py first commit 2021-01-29 16:54:34 +01:00

Entrez Fetcher

Install

pip install git+https://gitlab.com/celliern/entrez_fetch

Usage

Better to provide the e-mail and ncbi token, but not mandatory (allow to retrieve more data at once).

>>> from entrez_fetcher import EntrezFetcher
>>> fetcher = EntrezFetcher(email="...", api_key="...")
>>> fetcher.accession_to_summary("NC_009615")
          Item         Id    Caption  ... ReplacedBy Comment  AccessionVersion
NC_009615   []  150006674  NC_009615  ...                          NC_009615.1

[1 rows x 15 columns]

Work for one accesion id or a sequence of accession ids.

Available:

fetcher.accession_to_fasta(accession_numbers: Union[str, Sequence[str]]) -> Sequence[Tuple[str, Bio.SeqRecord]]  # return sequence of tuple (accession_id, biopython seq_record)
fetcher.accession_to_genbank(accession_numbers: Union[str, Sequence[str]]) -> Sequence[Tuple[str, Bio.SeqRecord]]  # return sequence of tuple (accession_id, biopython seq_record)
fetcher.accession_to_summary(accession_numbers: Union[str, Sequence[str]]) -> pd.DataFrame # Entrez esummary entry as pandas dataframe
fetcher.taxid_to_taxonomy(taxids: Union[str, Sequence[str]]) -> pd.DataFrame
fetcher.accession_to_taxonomy(accession_numbers: Union[str, Sequence[str]]) -> pd.DataFrame