diff --git a/.github/workflows/ci_test.yml b/.github/workflows/ci_test.yml index 2f0b4c6..d57886c 100644 --- a/.github/workflows/ci_test.yml +++ b/.github/workflows/ci_test.yml @@ -1,4 +1,4 @@ -name: AMDirT-CI +name: amdirt-CI on: [push, pull_request] diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index b586266..98880f7 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -13,8 +13,8 @@ jobs: - name: Setup Python uses: actions/setup-python@v3 with: - python-version: "3.9" - - name: Build AMDirT + python-version: "3.12" + - name: Build amdirt run: | pip install wheel python setup.py sdist bdist_wheel diff --git a/AMDirT/__init__.py b/AMDirT/__init__.py index 31e744e..dc79f8f 100644 --- a/AMDirT/__init__.py +++ b/AMDirT/__init__.py @@ -1 +1 @@ -__version__ = "1.6.3" +__version__ = "1.6.4" diff --git a/AMDirT/assets/tables.json b/AMDirT/assets/tables.json index 23319bb..27bdd99 100644 --- a/AMDirT/assets/tables.json +++ b/AMDirT/assets/tables.json @@ -3,24 +3,24 @@ "ancientmetagenome-environmental": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-environmental/samples/ancientmetagenome-environmental_samples.tsv", "ancientmetagenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-hostassociated/samples/ancientmetagenome-hostassociated_samples.tsv", "ancientsinglegenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientsinglegenome-hostassociated/samples/ancientsinglegenome-hostassociated_samples.tsv", - "test": "https://raw.githubusercontent.com/SPAAM-community/AMDirT/dev/tests/data/valid.tsv" + "test": "https://raw.githubusercontent.com/SPAAM-community/amdirt/dev/tests/data/valid.tsv" }, "samples_schema": { "ancientmetagenome-environmental": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-environmental/samples/ancientmetagenome-environmental_samples_schema.json", "ancientmetagenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-hostassociated/samples/ancientmetagenome-hostassociated_samples_schema.json", "ancientsinglegenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientsinglegenome-hostassociated/samples/ancientsinglegenome-hostassociated_samples_schema.json", - "test": "https://raw.githubusercontent.com/SPAAM-community/AMDirT/dev/tests/data/schema.json" + "test": "https://raw.githubusercontent.com/SPAAM-community/amdirt/dev/tests/data/schema.json" }, "libraries": { "ancientmetagenome-environmental": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-environmental/libraries/ancientmetagenome-environmental_libraries.tsv", "ancientmetagenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-hostassociated/libraries/ancientmetagenome-hostassociated_libraries.tsv", "ancientsinglegenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientsinglegenome-hostassociated/libraries/ancientsinglegenome-hostassociated_libraries.tsv", - "test": "https://raw.githubusercontent.com/SPAAM-community/AMDirT/dev/tests/data/valid_libaries.tsv" + "test": "https://raw.githubusercontent.com/SPAAM-community/amdirt/dev/tests/data/valid_libaries.tsv" }, "libraries_schema": { "ancientmetagenome-environmental": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-environmental/libraries/ancientmetagenome-environmental_libraries_schema.json", "ancientmetagenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientmetagenome-hostassociated/libraries/ancientmetagenome-hostassociated_libraries_schema.json", "ancientsinglegenome-hostassociated": "https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/ancientsinglegenome-hostassociated/libraries/ancientsinglegenome-hostassociated_libraries_schema.json", - "test": "https://raw.githubusercontent.com/SPAAM-community/AMDirT/dev/tests/data/libraries_schema.json" + "test": "https://raw.githubusercontent.com/SPAAM-community/amdirt/dev/tests/data/libraries_schema.json" } } \ No newline at end of file diff --git a/AMDirT/autofill/__init__.py b/AMDirT/autofill/__init__.py index 12479d5..64aefcc 100644 --- a/AMDirT/autofill/__init__.py +++ b/AMDirT/autofill/__init__.py @@ -1,7 +1,7 @@ -from AMDirT.validate.domain import DatasetValidator -from AMDirT.core import get_json_path, logger -from AMDirT.core.ena import ENAPortalAPI -from AMDirT.validate.exceptions import NetworkError +from amdirt.validate.domain import DatasetValidator +from amdirt.core import get_json_path, logger +from amdirt.core.ena import ENAPortalAPI +from amdirt.validate.exceptions import NetworkError import json import sys diff --git a/AMDirT/cli.py b/AMDirT/cli.py index d6374fd..9a161a6 100644 --- a/AMDirT/cli.py +++ b/AMDirT/cli.py @@ -1,13 +1,13 @@ import click -from AMDirT import __version__ - -from AMDirT.validate import run_validation -from AMDirT.viewer import run_app -from AMDirT.convert import run_convert -from AMDirT.core import get_json_path, get_amdir_tags, get_latest_tag -from AMDirT.autofill import run_autofill -from AMDirT.merge import merge_new_df -from AMDirT.download import download as download_amdir +from amdirt import __version__ + +from amdirt.validate import run_validation +from amdirt.viewer import run_app +from amdirt.convert import run_convert +from amdirt.core import get_json_path, get_amdir_tags, get_latest_tag +from amdirt.autofill import run_autofill +from amdirt.merge import merge_new_df +from amdirt.download import download as download_amdir from json import load @@ -49,9 +49,9 @@ def get_table_list(): @click.option("--verbose", is_flag=True, help="Verbose mode") def cli(ctx, verbose, no_args_is_help=True, **kwargs): """\b - AMDirT: Performs validity check of AncientMetagenomeDir datasets - Authors: AMDirT development team and the SPAAM community - Homepage & Documentation: https://github.com/SPAAM-community/AMDirT + amdirt: Performs validity check of AncientMetagenomeDir datasets + Authors: amdirt development team and the SPAAM community + Homepage & Documentation: https://github.com/SPAAM-community/amdirt \b """ ctx.ensure_object(dict) @@ -330,7 +330,7 @@ def merge(ctx, no_args_is_help=True, **kwargs): ) def download(no_args_is_help=True, **kwargs): """\b - Download a table from the AMDirT repository + Download a table from the amdirt repository """ download_amdir(**kwargs) diff --git a/AMDirT/convert/__init__.py b/AMDirT/convert/__init__.py index bab68df..80fb0ec 100644 --- a/AMDirT/convert/__init__.py +++ b/AMDirT/convert/__init__.py @@ -1,6 +1,6 @@ from sys import path import os -from AMDirT.core import ( +from amdirt.core import ( prepare_accession_table, prepare_bibtex_file, prepare_eager_table, @@ -12,10 +12,10 @@ get_remote_resources, get_json_path, ) -from AMDirT.validate import AMDirValidator -from AMDirT.validate.exceptions import DatasetValidationError +from amdirt.validate import AMDirValidator +from amdirt.validate.exceptions import DatasetValidationError from json import load -from AMDirT.core import logger +from amdirt.core import logger import pandas as pd import warnings @@ -38,7 +38,7 @@ def run_convert( mag=False, verbose=False, ): - """Run the AMDirT conversion application to input samplesheet tables for different pipelines + """Run the amdirt conversion application to input samplesheet tables for different pipelines Args: samples (str): Path to AncientMetagenomeDir filtered samples tsv file diff --git a/AMDirT/core/__init__.py b/AMDirT/core/__init__.py index f636f95..634bbc9 100644 --- a/AMDirT/core/__init__.py +++ b/AMDirT/core/__init__.py @@ -22,7 +22,7 @@ colorlog.ColoredFormatter("%(log_color)s%(name)s [%(levelname)s]: %(message)s") ) -logger = colorlog.getLogger("AMDirT") +logger = colorlog.getLogger("amdirt") logger.addHandler(handler) logger.propagate = False @@ -44,7 +44,7 @@ def monkeypatch_get_storage_manager(): def get_json_path(): - path = get_module_dir("AMDirT.assets").joinpath("tables.json") + path = get_module_dir("amdirt.assets").joinpath("tables.json") return path diff --git a/AMDirT/core/ena.py b/AMDirT/core/ena.py index 17f2d25..02175e2 100644 --- a/AMDirT/core/ena.py +++ b/AMDirT/core/ena.py @@ -1,5 +1,5 @@ import requests -from AMDirT.core import logger +from amdirt.core import logger import os from typing import List, Dict diff --git a/AMDirT/download/__init__.py b/AMDirT/download/__init__.py index 22623ef..0c1b58f 100644 --- a/AMDirT/download/__init__.py +++ b/AMDirT/download/__init__.py @@ -1,4 +1,4 @@ -from AMDirT.core import ( +from amdirt.core import ( logger, get_amdir_tags, get_remote_resources, @@ -9,7 +9,7 @@ def download(table: str, table_type: str, release: str, output: str = ".") -> str: """ - Download a table from the AMDirT repository. + Download a table from the amdirt repository. Parameters ---------- diff --git a/AMDirT/merge/__init__.py b/AMDirT/merge/__init__.py index 5302ece..d1b4251 100644 --- a/AMDirT/merge/__init__.py +++ b/AMDirT/merge/__init__.py @@ -1,8 +1,8 @@ -from AMDirT.validate.application import AMDirValidator -from AMDirT.validate.exceptions import DatasetValidationError +from amdirt.validate.application import AMDirValidator +from amdirt.validate.exceptions import DatasetValidationError import warnings import pandas as pd -from AMDirT.core import logger, get_remote_resources +from amdirt.core import logger, get_remote_resources from os.path import join diff --git a/AMDirT/validate/__init__.py b/AMDirT/validate/__init__.py index 6a3ea6c..1139351 100644 --- a/AMDirT/validate/__init__.py +++ b/AMDirT/validate/__init__.py @@ -1,4 +1,4 @@ -from AMDirT.validate.application import AMDirValidator +from amdirt.validate.application import AMDirValidator import warnings def run_validation( diff --git a/AMDirT/validate/application/__init__.py b/AMDirT/validate/application/__init__.py index d2dc5a1..e1956b5 100644 --- a/AMDirT/validate/application/__init__.py +++ b/AMDirT/validate/application/__init__.py @@ -1,8 +1,8 @@ from typing import Iterable, AnyStr, Union -from AMDirT.validate.domain import DatasetValidator, DFError -from AMDirT.core import get_json_path -from AMDirT.core.diff import get_sample_diff -from AMDirT.core.ena import ENAPortalAPI +from amdirt.validate.domain import DatasetValidator, DFError +from amdirt.core import get_json_path +from amdirt.core.diff import get_sample_diff +from amdirt.core.ena import ENAPortalAPI from rich.progress import track from pathlib import Path import pandas as pd diff --git a/AMDirT/validate/domain/__init__.py b/AMDirT/validate/domain/__init__.py index 63dcf60..0c53304 100644 --- a/AMDirT/validate/domain/__init__.py +++ b/AMDirT/validate/domain/__init__.py @@ -1,7 +1,7 @@ import json import pandas as pd -from AMDirT.validate import exceptions -from AMDirT.core import logger +from amdirt.validate import exceptions +from amdirt.core import logger from io import StringIO from pathlib import Path from rich.table import Table @@ -291,7 +291,7 @@ def to_rich(self): """ table = Table( - title=f"AMDirT Validation Report of {self.dataset_name} against {self.schema_name}" + title=f"amdirt Validation Report of {self.dataset_name} against {self.schema_name}" ) columns = ["Error", "Source", "Column", "Row", "Message"] for column in columns: diff --git a/AMDirT/viewer/__init__.py b/AMDirT/viewer/__init__.py index 7732c89..f9e2066 100644 --- a/AMDirT/viewer/__init__.py +++ b/AMDirT/viewer/__init__.py @@ -1,15 +1,15 @@ -# from AMDirT import logger +# from amdirt import logger from distutils.log import warn import sys from streamlit.web import cli as stcli from pathlib import Path -from AMDirT.core import get_json_path, logger +from amdirt.core import get_json_path, logger import warnings def run_app(tables=None, verbose=False): """ - Run the AMDirT interactive filtering application + Run the amdirt interactive filtering application Args: tables (str): path to JSON file listing AncientMetagenomeDir tables @@ -32,5 +32,5 @@ def run_app(tables=None, verbose=False): "--config", config_path ] - logger.info("\n[AMDirT] To close app, press on your keyboard: ctrl+c\n") + logger.info("\n[amdirt] To close app, press on your keyboard: ctrl+c\n") sys.exit(stcli.main()) diff --git a/AMDirT/viewer/streamlit.py b/AMDirT/viewer/streamlit.py index cc27691..a94afaf 100644 --- a/AMDirT/viewer/streamlit.py +++ b/AMDirT/viewer/streamlit.py @@ -6,8 +6,8 @@ import zipfile import json import os -from AMDirT import __version__ -from AMDirT.core import ( +from amdirt import __version__ +from amdirt.core import ( prepare_bibtex_file, prepare_eager_table, prepare_mag_table, @@ -22,7 +22,7 @@ st.set_page_config( - page_title="AMDirT viewer", + page_title="amdirt viewer", page_icon="https://raw.githubusercontent.com/SPAAM-community/AncientMetagenomeDir/master/assets/images/logos/spaam-AncientMetagenomeDir_logo_mini.png", layout="wide", ) @@ -68,7 +68,7 @@ def parse_args(): """, unsafe_allow_html=True, ) - st.write(f"# [AMDirT](https://github.com/SPAAM-community/AMDirT) viewer tool") + st.write(f"# [amdirt](https://github.com/SPAAM-community/amdirt) viewer tool") st.write(f"\n Version: {__version__}") st.session_state.tag_name = st.selectbox( label="Select an AncientMetagenomeDir release", options=tags diff --git a/README.md b/README.md index f389844..ca43c97 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4003825.svg)](https://doi.org/10.5281/zenodo.4003825) [![PyPI version](https://badge.fury.io/py/AMDirT.svg)](https://pypi.org/project/AMDirT) [![Documentation Status](https://readthedocs.org/projects/amdirt/badge/?version=dev)](https://amdirt.readthedocs.io/en/dev/?badge=dev) [![AMDirT-CI](https://github.com/SPAAM-community/AMDirT/actions/workflows/ci_test.yml/badge.svg)](https://github.com/SPAAM-community/AMDirT/actions/workflows/ci_test.yml) +[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.4003825.svg)](https://doi.org/10.5281/zenodo.4003825) [![PyPI version](https://badge.fury.io/py/amdirt.svg)](https://pypi.org/project/amdirt) [![Documentation Status](https://readthedocs.org/projects/amdirt/badge/?version=dev)](https://amdirt.readthedocs.io/en/dev/?badge=dev) [![amdirt-CI](https://github.com/SPAAM-community/amdirt/actions/workflows/ci_test.yml/badge.svg)](https://github.com/SPAAM-community/amdirt/actions/workflows/ci_test.yml) - AMDirT Logo + amdirt Logo -**AMDirT**: [**A**ncient**M**etagenome**Dir**](https://github.com/SPAAM-community/ancientmetagenomedir) **T**oolkit +**amdirt**: [**A**ncient**M**etagenome**Dir**](https://github.com/SPAAM-community/ancientmetagenomedir) **T**oolkit -AMDirT is a toolkit for interacting with the AncientMetagenomeDir metadata repository of ancient metagenomic samples and ancient microbial genomes. +amdirt is a toolkit for interacting with the AncientMetagenomeDir metadata repository of ancient metagenomic samples and ancient microbial genomes. This tool provides ways to explore and download sequencing data for ancient microbial and environmental (meta)genomes, automatically prepare input samplesheets for a range of bioinformatic processing pipelines, and to validate AncientMetagenomeDir submissions. @@ -14,7 +14,7 @@ For documentation on using the tool, please see [How Tos](https://amdirt.readthe ## Install -AMDirT has been tested on different Unix systems (macOS and Ubuntu) using Intel and AMD chips. If you suspect that AMDirT isn't working properly because you use a different hardware/OS, please open an [issue on GitHub](https://github.com/SPAAM-community/AMDirT/issues). +amdirt has been tested on different Unix systems (macOS and Ubuntu) using Intel and AMD chips. If you suspect that amdirt isn't working properly because you use a different hardware/OS, please open an [issue on GitHub](https://github.com/SPAAM-community/amdirt/issues). ### 1. With [pip](https://pip.pypa.io/en/stable/getting-started/) @@ -24,7 +24,7 @@ pip install amdirt ### 2. With conda -Installing AMDirT in a dedicated [conda](https://docs.conda.io/projects/miniconda/en/latest/index.html) environment +Installing amdirt in a dedicated [conda](https://docs.conda.io/projects/miniconda/en/latest/index.html) environment ```bash conda create -n amdirt -c bioconda amdirt #install amdirt in a dedicated conda environment @@ -36,13 +36,13 @@ conda deactivate amdirt # deactivate the conda environment ### The latest development version, directly from GitHub ```bash -pip install --upgrade --force-reinstall git+https://github.com/SPAAM-community/AMDirT.git@dev +pip install --upgrade --force-reinstall git+https://github.com/SPAAM-community/amdirt.git@dev ``` ### The latest development version, with local changes -- Fork AMDirT on GitHub -- Clone your fork `git clone [your-AMDirT-fork]` +- Fork amdirt on GitHub +- Clone your fork `git clone [your-amdirt-fork]` - Checkout the `dev` branch `git switch dev` - Create the conda environment `conda env create -f environment.yml` - Activate the environment `conda activate amdirt` @@ -58,12 +58,12 @@ To locally render documentation: ## Cite -AMDirT has been published in F1000 with the following _DOI_: [10.12688/f1000research.134798.2](https://doi.org/10.12688/f1000research.134798.2). +amdirt has been published in F1000 with the following _DOI_: [10.12688/f1000research.134798.2](https://doi.org/10.12688/f1000research.134798.2). -You can cite AMDirT like so: +You can cite amdirt like so: ``` -Borry M, Forsythe A, Andrades Valtueña A et al. Facilitating accessible, rapid, and appropriate processing of ancient metagenomic data with AMDirT. F1000Research 2024, 12:926 +Borry M, Forsythe A, Andrades Valtueña A et al. Facilitating accessible, rapid, and appropriate processing of ancient metagenomic data with amdirt. F1000Research 2024, 12:926 ``` A bibtex file is also available here: [amdirt.bib](amdirt.bib) @@ -71,7 +71,7 @@ A bibtex file is also available here: [amdirt.bib](amdirt.bib) ## More information -For more information, please see the AMDirT Documentation +For more information, please see the amdirt Documentation - Stable: [amdirt.readthedocs.io/en/latest/](https://amdirt.readthedocs.io/en/latest/) - Development version: [amdirt.readthedocs.io/en/dev/](https://amdirt.readthedocs.io/en/dev/) diff --git a/assets/logo_rectangular.svg b/assets/logo_rectangular.svg index 65b71db..7a23fa8 100644 --- a/assets/logo_rectangular.svg +++ b/assets/logo_rectangular.svg @@ -136,7 +136,7 @@ id="tspan325" style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:38.8056px;font-family:'Varela Round';-inkscape-font-specification:'Varela Round';stroke-width:0.264583" x="105.97205" - y="112.82295">AMDirT + y="112.82295">amdirt AMDirT + y="112.82295">amdirt AMDirT + y="112.82295">amdirt ⚠️ _The header, and present columns etc. should match exactly that on AncientMetagenomeDir, only rows may be removed._ -To generate sample sheets of the support pipelines: open a terminal (activating software environments if necessary, see [AMDirT Installation Page](https://github.com/SPAAM-community/AMDirT/)), and there you can run the following command (an example being a filtered `ancientmetagenome-hostassociated_samples_warinnersamplesonly.tsv` table): +To generate sample sheets of the support pipelines: open a terminal (activating software environments if necessary, see [amdirt Installation Page](https://github.com/SPAAM-community/amdirt/)), and there you can run the following command (an example being a filtered `ancientmetagenome-hostassociated_samples_warinnersamplesonly.tsv` table): ```bash mkdir samplesheets/ -AMDirT convert ancientmetagenome-hostassociated_samples_warinnersamplesonly.tsv ancientmetagenome-hostassociated -o samplesheets/ -- +amdirt convert ancientmetagenome-hostassociated_samples_warinnersamplesonly.tsv ancientmetagenome-hostassociated -o samplesheets/ -- ``` where you provide the filtered TSV, which AncientMetagenomeDir samples table the filtered table is derived from,then the output directory where the samplesheets should be saved into, and which tool to generate a samplesheet from. @@ -32,7 +32,7 @@ Alternatively, if you only want specific libraries, and already have pre-filtere ```bash mkdir -p samplesheets/ -AMDirT convert --libraries ancientmetagenome-hostassociated_libraries_warinnerlibrariesonly.tsv ancientmetagenome-hostassociated_samples_warinnersamplesonly.tsv ancientmetagenome-hostassociated -o samplesheets/ -- +amdirt convert --libraries ancientmetagenome-hostassociated_libraries_warinnerlibrariesonly.tsv ancientmetagenome-hostassociated_samples_warinnersamplesonly.tsv ancientmetagenome-hostassociated -o samplesheets/ -- ``` See [Output](#output) for descriptions of all output files. diff --git a/docs/source/how_to/download.md b/docs/source/how_to/download.md index 68e16c2..3b72129 100644 --- a/docs/source/how_to/download.md +++ b/docs/source/how_to/download.md @@ -13,7 +13,7 @@ You typically do this if you're planning to use the `convert` command later. ## How ```bash -AMDirT download --table ancientsinglegenome-hostassociated --table_type samples -r v23.12.0 -o . +amdirt download --table ancientsinglegenome-hostassociated --table_type samples -r v23.12.0 -o . ``` ## Output diff --git a/docs/source/how_to/index.rst b/docs/source/how_to/index.rst index f8f73d3..33b8013 100644 --- a/docs/source/how_to/index.rst +++ b/docs/source/how_to/index.rst @@ -3,7 +3,7 @@ How Tos You can see more information about each sub-command below. -All 'How Tos' assume you have already installed AMDirT following the installation instructions (:doc:`/README`). +All 'How Tos' assume you have already installed amdirt following the installation instructions (:doc:`/README`). .. toctree:: :maxdepth: 1 diff --git a/docs/source/how_to/merge.md b/docs/source/how_to/merge.md index 8ce4fec..aefd0c0 100644 --- a/docs/source/how_to/merge.md +++ b/docs/source/how_to/merge.md @@ -19,7 +19,7 @@ The following description assumes you have already prepared an AncientMetagenome Given a new samples table `samples_for_new_pr.tsv` to be added to the single genome samples table `ancientsinglegenome-hostassociated`, you can run the following command: ```bash -AMDirT merge -n ancientsinglegenome-hostassociated -t samples samples_for_new_pr.tsv +amdirt merge -n ancientsinglegenome-hostassociated -t samples samples_for_new_pr.tsv ``` Note that during merge `merge` will also perform schema validation to ensure the contents of the new rows are valid against the AncientMetagenomeDir schema. diff --git a/docs/source/how_to/miscellaneous.md b/docs/source/how_to/miscellaneous.md index 9c8b0a7..bd35b32 100644 --- a/docs/source/how_to/miscellaneous.md +++ b/docs/source/how_to/miscellaneous.md @@ -1,12 +1,12 @@ # miscellaneous -This page provides additional documentation in regards to AMDirT that is not directly related to the functioning of AMDirT commands themselves. +This page provides additional documentation in regards to amdirt that is not directly related to the functioning of amdirt commands themselves. ## viewer ### Downloading the sequencing data of selected libraries -AMDirT provides three different methods to download the sequencing data of selected libraries from public archives: +amdirt provides three different methods to download the sequencing data of selected libraries from public archives: - direct download from the FTP server using curl - direct download via the FASP protocol using ASPERA @@ -14,7 +14,7 @@ AMDirT provides three different methods to download the sequencing data of selec #### Downloading via curl -[cURL](https://curl.se/) is a well established and popular tool curl for command line or script based data transfer. It is found on most modern operating UNIX based systems, and therefore it is the default downloading tool in AMDirT. However, it is the slowest of the three options as it runs over a standard HTTP/FTP connection, and is not parallelised (each file is downloaded sequentially). +[cURL](https://curl.se/) is a well established and popular tool curl for command line or script based data transfer. It is found on most modern operating UNIX based systems, and therefore it is the default downloading tool in amdirt. However, it is the slowest of the three options as it runs over a standard HTTP/FTP connection, and is not parallelised (each file is downloaded sequentially). In most cases you can assume it is already installed on your machine, however you can check you have cURL installed by running: @@ -24,7 +24,7 @@ which curl the output of which, should be something like `/usr/bin/curl`. If you get no output, you will need to look into installing the tool. -If you select `curl` in `AMDirT viewer` or `AMDirT convert`, you will recieve a bash script that contains curl command(s). +If you select `curl` in `amdirt viewer` or `amdirt convert`, you will recieve a bash script that contains curl command(s). It will look like this: @@ -38,17 +38,17 @@ By running `bash ancientMetagenomeDir_curl_download_script.sh`, the script will #### Downloading via the FASP protocol using ASPERA -[FASP](https://en.wikipedia.org/wiki/Fast_and_Secure_Protocol) is a specific protocol that allows the download of large data files at a speed that is usually much higher than when downloading from the FTP server. It is particularly suitable when downloading very large data files. While much faster than `curl`, the `aspera` bash script generated by AMDirT still runs sequentially. +[FASP](https://en.wikipedia.org/wiki/Fast_and_Secure_Protocol) is a specific protocol that allows the download of large data files at a speed that is usually much higher than when downloading from the FTP server. It is particularly suitable when downloading very large data files. While much faster than `curl`, the `aspera` bash script generated by amdirt still runs sequentially. Prior to be able to download via this method, make sure that you have the ASPERA connect installed on your system (using `which ascp`). If this is not the case, please refer to this [installation guide](https://www.ibm.com/docs/en/aspera-connect/4.1?topic=suc-installation#installation__section_zfj_wpq_ghb) and download the binary from [here](https://www.ibm.com/aspera/connect/). You can also install this via conda (`conda create -n aspera -c HCC aspera-cli`) -`AMDirT viewer`/`convert` will return a script that for each sequencing file looks like this following the recommendation from [ENA](https://ena-docs.readthedocs.io/en/latest/retrieval/file-download.html#using-aspera): +`amdirt viewer`/`convert` will return a script that for each sequencing file looks like this following the recommendation from [ENA](https://ena-docs.readthedocs.io/en/latest/retrieval/file-download.html#using-aspera): ````bash ascp -QT -l 300m -P 33001 -i path/to/aspera/installation/etc/asperaweb_id_dsa.openssh era-fasp@fasp.sra.ebi.ac.uk:path/to/sequencing/file local/target/directory ``` -AMDirT will automatically replace `path/to/sequencing/file` to match the paths for the libraries that were selected. It will also set the `local/target/directory` to the current directory. +amdirt will automatically replace `path/to/sequencing/file` to match the paths for the libraries that were selected. It will also set the `local/target/directory` to the current directory. However, you will need to set the `path/to/aspera/installation` prior to running this. To make it more convenient, we opted for using the environment variable `ASPERA_PATH` that has to be set in the shell prior to running the script. Therefore, run: @@ -65,7 +65,7 @@ ASPERA_PATH="$HOME/.aspera/cli" You will need to install [Nextflow](https:/nextflow.io) and have it configured for your machine or cluster, as well as a software environment system such as conda, docker, or singularity. -The output from `AMDirT viewer`/`convert` will contain a list of accessions in a format compatible with the nf-core/fetchngs input file. +The output from `amdirt viewer`/`convert` will contain a list of accessions in a format compatible with the nf-core/fetchngs input file. ```bash nextflow pull nf-core/fetchngs diff --git a/docs/source/how_to/validate.md b/docs/source/how_to/validate.md index 071621f..a59f604 100644 --- a/docs/source/how_to/validate.md +++ b/docs/source/how_to/validate.md @@ -17,7 +17,7 @@ Before you run `validate`, you normally need a local copy of AncientMetagenomeDi To run, execute the following command: ```bash -AMDirT validate ancientmetagenome-hostassociated_samples.tsv ancientmetagenome-hostassociated_samples_schema.json +amdirt validate ancientmetagenome-hostassociated_samples.tsv ancientmetagenome-hostassociated_samples_schema.json ``` With the `.tsv` file in the first positional argument, and the `.json` schema in the second position. @@ -40,19 +40,19 @@ You can also change the output console formatting from a python-rich format (def For example, to check all columns are present, there are no duplicate lines, and the table matches the schema you can run ```bash -AMDirT validate -s -d ancientmetagenome-hostassociated_samples.tsv ancientmetagenome-hostassociated_samples_schema.json +amdirt validate -s -d ancientmetagenome-hostassociated_samples.tsv ancientmetagenome-hostassociated_samples_schema.json ``` If the table is valid you will get a corresponding message as follows: ```bash -2022-12-16 11:15:41.109 INFO AMDirT: ancientmetagenome-hostassociated_samples.tsv is valid +2022-12-16 11:15:41.109 INFO amdirt: ancientmetagenome-hostassociated_samples.tsv is valid ``` If the table is invalid, you will get a table containing a list of the found errors: ```text - AMDirT Validation Report of ancientmetagenome-hostassociated_samples.tsv against ancientmetagenome-hostassociated_samples_schema.json + amdirt Validation Report of ancientmetagenome-hostassociated_samples.tsv against ancientmetagenome-hostassociated_samples_schema.json ┏━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Error ┃ Source ┃ Column ┃ Row ┃ Message ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ diff --git a/docs/source/how_to/viewer.md b/docs/source/how_to/viewer.md index 35a119a..67773c4 100644 --- a/docs/source/how_to/viewer.md +++ b/docs/source/how_to/viewer.md @@ -22,12 +22,12 @@ You should use this tool when you wish to find particular types of ancient metag ### Loading the interface -Before using `AMDirT viewer` make sure you have modern web-browser (Chrome, Firefox, Edge, Safari etc.) available on your machine. This will in most cases be your own laptop or desktop - not a server. +Before using `amdirt viewer` make sure you have modern web-browser (Chrome, Firefox, Edge, Safari etc.) available on your machine. This will in most cases be your own laptop or desktop - not a server. -To open the graphical user interface, open a terminal (activating software environments if necessary, see [AMDirT Installation Page](/README)) and run: +To open the graphical user interface, open a terminal (activating software environments if necessary, see [amdirt Installation Page](/README)) and run: ```bash -AMDirT viewer +amdirt viewer ``` Your web-browser should automatically open a new tab and have the `viewer` interface open for you. If your browser does not automatically open, just copy and paste one of the URLs present in the console in your web browsers URL bar. @@ -39,15 +39,15 @@ Your web-browser should automatically open a new tab and have the `viewer` inter > ⚠️ _The first time you run the command, you first may get some prompts in your terminal. You can just say 'no' to all - this will not affect the usage of the tool._ -![AMDirT welcome page with sidebar](images/amdirt-filter-welcome.png) +![amdirt welcome page with sidebar](images/amdirt-filter-welcome.png) Once opened you should see a side bar and a empty pane. You can use the side bar to select various aspects of the displayed data from the AncientMetagenomeDir tables, such as the release, which table you view (e.g., environmental or host-associated metagenomics) and the number of rows to display. The data download option controls which tool the resulting download script will use to get the data. -![AMDirT side bar with version dropdown menu](images/amdirt-filter-version-select.png) +![amdirt side bar with version dropdown menu](images/amdirt-filter-version-select.png) -![AMDirT side bar with table dropdown menu](images/amdirt-filter-table-select.png) +![amdirt side bar with table dropdown menu](images/amdirt-filter-table-select.png) -![AMDirT side bar with download method menu](images/amdirt-filter-downloadmethod-select.png) +![amdirt side bar with download method menu](images/amdirt-filter-downloadmethod-select.png) Once you have selected a version and a table, the table itself should open in the empty pane. @@ -60,11 +60,11 @@ To navigate the tables you can scroll up and down with your mouse. To side scrol To filter the tables, hover your cursor over the column of interest and you should see a 'hamburger' icon, press this to open the filter and table formatting options. -![AMDirT column configuration with row ordering options](images/amdirt-filter-column-order.png) +![amdirt column configuration with row ordering options](images/amdirt-filter-column-order.png) -![AMDirT column configuration with row filtering options](images/amdirt-filter-column-filter.png) +![amdirt column configuration with row filtering options](images/amdirt-filter-column-filter.png) -![AMDirT column configuration with column selection options](images/amdirt-filter-column-select.png) +![amdirt column configuration with column selection options](images/amdirt-filter-column-select.png) With this pane and tabs you can: @@ -80,9 +80,9 @@ Now, select all the samples you wish to download and/or analyse. You can select all samples currently displayed by clicking the empty box on the project_name column, or you can select individual samples by clicking the empty boxes on these rows in the project_name column. -![AMDirT Selecting all samples currently in table](images/amdirt-filter-select-all.png) +![amdirt Selecting all samples currently in table](images/amdirt-filter-select-all.png) -![AMDirT Selecting individual samples from the current table](images/amdirt-filter-select-single-samples.png) +![amdirt Selecting individual samples from the current table](images/amdirt-filter-select-single-samples.png) Now validate your selection! Press the 'Validate selection' button at the bottom of the table. @@ -90,13 +90,13 @@ Now validate your selection! Press the 'Validate selection' button at the bottom Once the selection is validated, the library filtering table will appear below -![AMDirT libraries filtering table](images/amdirt-filter-libraries-table.png) +![amdirt libraries filtering table](images/amdirt-filter-libraries-table.png) You can proceed to select your libraries of choice (or all of them) in the same way as the samples table. Once happy, you can then click on 'Validate library selection' Your different download options will finally appear: -![AMDirT output download options](images/amdirt-filter-download-buttons.png) +![amdirt output download options](images/amdirt-filter-download-buttons.png) In this case we suggest you press: diff --git a/docs/source/index.rst b/docs/source/index.rst index 7e9194a..599d10a 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,17 +1,17 @@ -.. AMDirT documentation master file +.. amdirt documentation master file You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to AMDirT's documentation! +Welcome to amdirt's documentation! ==================================== -.. image:: https://github.com/SPAAM-community/AMDirT/raw/master/assets/logo_rectangular_web.png +.. image:: https://github.com/SPAAM-community/amdirt/raw/master/assets/logo_rectangular_web.png :width: 400 :alt: AncientMetagenomeDir Logo -🛠️ **AMDirT**: `AncientMetagenomeDir `_ Toolkit 🛠️ +🛠️ **amdirt**: `AncientMetagenomeDir `_ Toolkit 🛠️ -AMDirT is a toolkit for interacting with the AncientMetagenomeDir metadata repository of ancient metagenomic samples and ancient microbial genomes. +amdirt is a toolkit for interacting with the AncientMetagenomeDir metadata repository of ancient metagenomic samples and ancient microbial genomes. This tool provides ways to explore and download sequencing data for ancient microbial and environmental (meta)genomes, automatically prepare input samplesheets for a range of bioinformatic processing pipelines, and to validate AncientMetagenomeDir submissions. diff --git a/docs/source/reference.rst b/docs/source/reference.rst index 10194cf..013e479 100644 --- a/docs/source/reference.rst +++ b/docs/source/reference.rst @@ -6,10 +6,10 @@ To access the help menu: .. code-block:: bash - $ AMDirT --help + $ amdirt --help The list of arguments of options is detailed below -.. click:: AMDirT.cli:cli - :prog: AMDirT +.. click:: amdirt.cli:cli + :prog: amdirt :nested: full diff --git a/docs/source/tutorials/convert.md b/docs/source/tutorials/convert.md index 78b8fe7..a3e83af 100644 --- a/docs/source/tutorials/convert.md +++ b/docs/source/tutorials/convert.md @@ -1,8 +1,8 @@ # convert -On this page we provide a brief tutorial on how you can use the AMDirT command-line-interface (CLI) of the `convert` command. +On this page we provide a brief tutorial on how you can use the amdirt command-line-interface (CLI) of the `convert` command. -This tutorial assumes you are on a UNIX based operating system and has internet access. It also assumes you have already installed `AMDirT`. +This tutorial assumes you are on a UNIX based operating system and has internet access. It also assumes you have already installed `amdirt`. We will show how given a pre-filtered samples or libraries table (e.g. via command line tools or in an R session), in much the same way as the graphical-based `GUI` command, you can use the command-line interface to convert the table to various formats such as download scripts or prepared input sample sheets for ancient metagenomic pipelines. @@ -15,7 +15,7 @@ We will take use one of the previous releases of AncientMetagenomeDir as an exam ```bash mkdir amdirt-convert-tutorial cd amdirt-convert-tutorial -AMDirT download --table ancientmetagenome-hostassociated --table_type samples -r v23.09.0 +amdirt download --table ancientmetagenome-hostassociated --table_type samples -r v23.09.0 ``` ## Filter a sample metadata table @@ -31,7 +31,7 @@ cat ancientmetagenome-hostassociated_samples_v23.09.0.tsv | grep -e '^project_na Now we can use the `convert` command to provide a download script, a nf-core/eager samplesheet, the AncientMetagenomeDir library metadata, and a citations file. ```bash -AMDirT convert --curl --eager --librarymetadata --bibliography germany_dentalcalculus.tsv ancientmetagenome-hostassociated +amdirt convert --curl --eager --librarymetadata --bibliography germany_dentalcalculus.tsv ancientmetagenome-hostassociated ``` This will create the following files: @@ -63,7 +63,7 @@ Let's say of the samples we just downloaded, you realised you only wanted to use We can then again use the `convert` command to provide an updated download script, nf-core/eager samplesheet, and an citations file. ```bash -AMDirT convert --curl --eager --bibliography --libraries germany_dentalcalculus_libraries_pe.tsv germany_dentalcalculus.tsv ancientmetagenome-hostassociated +amdirt convert --curl --eager --bibliography --libraries germany_dentalcalculus_libraries_pe.tsv germany_dentalcalculus.tsv ancientmetagenome-hostassociated ``` > ℹ _It's important to note that you still need a (full or filtered) AncientMetagenomeDir samples sheet even when supplying `--libraries`_. diff --git a/docs/source/tutorials/index.rst b/docs/source/tutorials/index.rst index 8dc5326..3e960ad 100644 --- a/docs/source/tutorials/index.rst +++ b/docs/source/tutorials/index.rst @@ -5,7 +5,7 @@ Introductory tutorials for sub-commands can be found below in text and/or video All videos can be also found on the `SPAAM Community Youtube channel `_. -All tutorials assume you have already installed AMDirT following the installation instructions (:doc:`/README`). +All tutorials assume you have already installed amdirt following the installation instructions (:doc:`/README`). Note that tutorials currently exist for user-facing commands, sub-commands such as `validate` and `autofill` are generally executed by users. For these please see the respective (:doc:`/how_to/index`) page. diff --git a/docs/source/tutorials/viewer.md b/docs/source/tutorials/viewer.md index 06c05a1..4eed2c0 100644 --- a/docs/source/tutorials/viewer.md +++ b/docs/source/tutorials/viewer.md @@ -1,6 +1,6 @@ # viewer -On this page we provide a step-by-step video tutorial on how to use the AMDirT graphical-user-interface (GUI) of the `viewer` command. +On this page we provide a step-by-step video tutorial on how to use the amdirt graphical-user-interface (GUI) of the `viewer` command. For more detail about all possible output files, please see the corresponding pages on [How To](/how_to/index). diff --git a/setup.py b/setup.py index 1653f52..0b3952c 100644 --- a/setup.py +++ b/setup.py @@ -19,11 +19,11 @@ def get_version(rel_path): setup( - name="AMDirT", - version=get_version("AMDirT/__init__.py"), - description="AMDirT: AncientMetagenomeDir Toolkit", + name="amdirt", + version=get_version("amdirt/__init__.py"), + description="amdirt: AncientMetagenomeDir Toolkit", long_description=open("README.md").read(), - url="https://github.com/SPAAM-community/AMDirT", + url="https://github.com/SPAAM-community/amdirt", long_description_content_type="text/markdown", license="GNU-GPLv3", python_requires=">=3.9", @@ -40,7 +40,7 @@ def get_version(rel_path): "colorlog" ], packages=find_packages(exclude="test"), - entry_points={"console_scripts": ["AMDirT = AMDirT.cli:cli"]}, - package_dir={"AMDirT": "AMDirT"}, - package_data={"AMDirT.assets": ["tables.json"]}, + entry_points={"console_scripts": ["amdirt = amdirt.cli:cli"]}, + package_dir={"amdirt": "amdirt"}, + package_data={"amdirt.assets": ["tables.json"]}, ) diff --git a/tests/test_application.py b/tests/test_application.py index b639ca1..50690b5 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -1,5 +1,5 @@ import os -from AMDirT.validate import AMDirValidator +from amdirt.validate import AMDirValidator def test_project_multiple_doi(test_data_dir): diff --git a/tests/test_convert.py b/tests/test_convert.py index 8fa93f7..0c9f8f5 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -3,7 +3,7 @@ import shutil import os -from AMDirT.convert import run_convert +from amdirt.convert import run_convert def test_convert_only_sample_df(test_data_dir): diff --git a/tests/test_core.py b/tests/test_core.py index 34c71ab..648c742 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -1,6 +1,6 @@ import pytest -from AMDirT.core import ( +from amdirt.core import ( get_colour_chemistry, doi2bib, ena, diff --git a/tests/test_domain.py b/tests/test_domain.py index 5f29c18..3e006f8 100644 --- a/tests/test_domain.py +++ b/tests/test_domain.py @@ -1,6 +1,6 @@ import pytest import os -from AMDirT.validate.domain import DatasetValidator, DFError +from amdirt.validate.domain import DatasetValidator, DFError from jsonschema import validate from jsonschema.exceptions import ValidationError as JSONValidationError diff --git a/tests/test_download.py b/tests/test_download.py index 5923212..9e7dc2d 100644 --- a/tests/test_download.py +++ b/tests/test_download.py @@ -1,4 +1,4 @@ -from AMDirT.download import download +from amdirt.download import download def test_download():