A Python tool for fetching metadata for bacterial genomes.
Project description
FetchM: Metadata Fetching and Analysis Tool
Overview
FetchM is a Python-based tool for fetching and analyzing genomic metadata from NCBI BioSample records. When you download ncbi_dataset.tsv from the NCBI genome database, the metadata fields such as 'Collection Date', 'Host', 'Geographic Location', and 'Isolation Source' are missing. This tool helps fetch the associated metadata for each BioSample ID. FetchM requires an input file (ncbi_dataset.tsv) from the NCBI genome database, retrieves additional annotations from NCBI, filters the data based on quality thresholds, and generates visualizations to help interpret the results. You can also download the filtered sequences.
Features
- Fetch metadata from NCBI BioSample API.
- Filter genomes based on CheckM completeness and ANI check status.
- Generate metadata summaries and annotation statistics.
- Create various visualizations for geographic distribution, collection dates, gene counts, continent, and subcontinent.
- Download genome sequences (optional).
- Download sequences after filtering by host species, year, country, continent, and subcontinent.
Installation
Option 1: Install via Conda (Recommended)
conda install -c conda-forge fetchM
Option 2: Install in a New Conda Environment (Isolated)
conda create -n fetchM_env -c conda-forge fetchM
conda activate fetchM_env
Option 3: Install via pip
pip install fetchM
Usage
Run FetchM with the following command:
fetchM --input input.tsv --outdir results/
Additional Options:
--checkm CHECKM(Minimum CheckM completeness threshold, default: 95)--sleep(Time to wait between requests, default: 0.5s)--seq(Enable sequence download mode)
Downloading sequences based on different criteria
--host HOST [HOST ...](Filter by host species, e.g.,"Homo sapiens" "Bos taurus")--year YEAR [YEAR ...](Filter by year or year range, e.g.,"2015" "2018-2025")--country COUNTRY [COUNTRY ...](Filter by country, e.g.,"Bangladesh" "United States")--cont CONT [CONT ...](Filter by continent, e.g.,"Asia" "Africa")--subcont SUBCONT [SUBCONT ...](Filter by subcontinent, e.g.,"Southern Asia" "Western Africa")
Input
Download the ncbi_dataset.tsv from NCBI genome database for your target organism -ncbi_dataset.tsv
Output
FetchM creates a subdirectory in /results/ based on the organism name provided in the input file. Inside this subdirectory, the following folders are created:
- Metadata summaries in
metadata_output/annotation_summary.csvassembly_summary.csvmetadata_summary.csvncbi_clean.csvncbi_filtered.csvncbi_dataset_updated.tsv
- Figures in
figures/Annotation Count Gene Protein-coding_distribution.tiffAnnotation Count Gene Pseudogene_distribution.tiffAnnotation Count Gene Total_distribution.tiffAssembly Stats Total Sequence Length_distribution.tiffCollection Date_bar_plots.tiffContinent_bar_plots.tiffGeographic Location_bar_plots.tiffHost_bar_plots.tiffscatter_plot_gene_protein_coding_vs_collection_date.tiffscatter_plot_gene_total_vs_collection_date.tiffscatter_plot_total_sequence_length_vs_collection_date.tiffSubcontinent_bar_plots.tiff
- Sequences in
sequences/(if--seqis enabled, it will contain the downloaded genome sequences).
Visualizations
Annotation Distributions
Assembly Statistics
Metadata Summaries
Scatter Plots
License
This project is licensed under the MIT License.
Author
Developed by Tasnimul Arabi Anik.
Contributions
Contributions and improvements are welcome! Feel free to submit a pull request or report issues.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fetchm-0.1.2.tar.gz.
File metadata
- Download URL: fetchm-0.1.2.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d80455912cf25c5a585e1ddb49ea09f006380c34c049579341ce81985addee9b
|
|
| MD5 |
46e8d3003baca179ffe817b80df43727
|
|
| BLAKE2b-256 |
573de72f577b13b6b8ef3d37fd06c0e0c420c5c102f37c5e78451212e7872dc3
|
File details
Details for the file fetchm-0.1.2-py3-none-any.whl.
File metadata
- Download URL: fetchm-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5cffb78d77a417ae8314791b11a6022aaeacea4c5bdd6e7a2590d7a4a73b3331
|
|
| MD5 |
83bf414392ef36f1c45d3b0daccf893e
|
|
| BLAKE2b-256 |
d033441afa453307ec81e8ab3c3eb8454e4caf3a4b38addb8932c87415991215
|