### Get detailed help for a specific datasets command Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use `datasets --help` to get detailed usage information for a specific subcommand, such as `datasets summary genome taxon formicidae --help`. ```bash datasets summary genome taxon formicidae --help ``` -------------------------------- ### Get Help for Datasets Summary Genome Taxon Command Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Access specific help for subcommands like `datasets summary genome taxon` to understand their options and usage. ```bash datasets summary genome taxon --help ``` -------------------------------- ### Verify Datasets CLI installation Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Checks if the Datasets command-line tool is installed and accessible. ```bash # Now let's make sure the datasets command-line tool is working datasets ``` -------------------------------- ### Get Help for Datasets Command Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Use the `--help` flag to view available commands at different levels of the `datasets` CLI. This is useful for exploring the tool's capabilities. ```bash datasets --help ``` -------------------------------- ### Get help for virus genome subcommand Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md This command displays detailed help information for the `datasets download virus genome taxon` subcommand, outlining available options and usage. ```bash datasets download virus genome taxon --help ``` -------------------------------- ### Rehydrate Genome Sequence (Exercise) Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Placeholder for using the 'rehydrate' option to get a genome sequence generated using Oxford Nanopore. ```bash # Use rehydrate to get genome sequence generated using Oxford Nanopore ``` -------------------------------- ### Launch Jupyter Lab Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/README.md Start the Jupyter Lab server from your activated conda environment. This will open the Jupyter interface in your web browser. ```bash jupyter lab ``` -------------------------------- ### Get assembly level breakdown for an organism Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Combine `datasets summary` with `dataformat` and `sort | uniq -c` to get a breakdown of assembly levels for a specific organism. ```bash # Assembly level breakdown ``` -------------------------------- ### Get help for dataformat tsv genome Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Displays the help menu for the `dataformat tsv genome` command, listing available metadata fields for genome data. ```bash # Read the dataformat help menu. This is a great way to get a list of the available metadata fields. dataformat tsv genome --help ``` -------------------------------- ### Install NCBI Datasets CLI with Conda Source: https://github.com/ncbi/datasets/blob/master/README.md Installs the latest version of the NCBI Datasets CLI tools using conda. Ensure you have conda installed and configured. ```bash conda install -c conda-forge ncbi-datasets-cli ``` -------------------------------- ### Run a Python print statement Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb This is an example of a basic code cell in a Jupyter Notebook. To run it, click on the cell and press the 'Run' button. ```python #This is a code cell print('You ran the code cell!') ``` -------------------------------- ### Filter and Format Datasets Report with jq Source: https://github.com/ncbi/datasets/blob/master/training/NIH_Research_Festival.md This example shows how to use jq to filter the JSON-Lines output from datasets based on a condition (annotation release date) before formatting it into a TSV table with dataformat. ```bash datasets summary gene symbol brca1 --taxon dog --ortholog vertebrates --as-json-lines | \ jq -c 'select(.annotations[].annotation_release_date>"2024-09-01")' | \ dataformat tsv gene --fields gene-id,ensembl-geneids,tax-name,symbol,annotation-release-date | \ column -t -s$' ' ``` -------------------------------- ### Summarize genomes by accession Source: https://github.com/ncbi/datasets/blob/master/training/VGP_12062024.md Use the 'summary' command to get a count of genomes for a given accession. This is useful for previewing results before downloading. ```bash datasets summary genome accession PRJNA489243 ``` -------------------------------- ### Download a List of Genes from a File Source: https://github.com/ncbi/datasets/blob/master/training/NIH_Research_Festival.md Use the `--inputfile` flag to download data for multiple genes listed in a text file, with one identifier per line. The example shows downloading genes by locus tag. ```bash cat locus-tag.txt MoV-3mpc04sS1_gp1 MoV-3mpc04sL2_gp1 MoV-3mpc04sS1_gp2 MoV-3mpc04sM1_gp1 MoV-3mpc04sM2_gp1 MoV-3mpc04sS2_gp1 MoV-3mpc04sM3_gp1 MoV-3mpc04sL1_gp1 MoV-3mpc04sL3_gp1 MoV-3mpc04sS3_gp1 MoV-3mpc04sS4_gp1 ``` ```bash datasets download gene locus-tag --inputfile locus-tag.txt Collecting 11 gene records [================================================] 100% 11/11 Downloading: ncbi_dataset.zip 7.88kB valid data package Validating package files [================================================] 100% 5/5 unzip ncbi_dataset.zip -d locus-tag-list Archive: ncbi_dataset.zip inflating: locus-tag-list/README.md inflating: locus-tag-list/ncbi_dataset/data/protein.faa inflating: locus-tag-list/ncbi_dataset/data/data_report.jsonl inflating: locus-tag-list/ncbi_dataset/data/dataset_catalog.json inflating: locus-tag-list/md5sum.txt ``` -------------------------------- ### Download Ortholog Set (All Taxa) Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Downloads an ortholog set for a given gene identifier. Use --ortholog all to retrieve the complete set. Examples show downloading by accession, gene ID, and symbol with a specified taxon. ```bash datasets download gene accession NM_176180.2 --ortholog all ``` ```bash datasets download gene gene-id 36744 --ortholog all ``` ```bash datasets download gene symbol cglr1 --taxon 'drosophila melanogaster' --ortholog all ``` -------------------------------- ### Count Genomes with NCBI (RefSeq) Annotations Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This exercise guides users to count genomes with NCBI (RefSeq) annotations by utilizing the `--assembly-source` flag within the `datasets summary genome taxon` command. Familiarity with the command's help options is beneficial. ```bash # How many genomes have NCBI (RefSeq) annotations? (hint: --assembly-source) ``` -------------------------------- ### Download Coronaviridae genome from specific host Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Example command to download a virus genome data package for the Coronaviridae family, limited to genomes isolated from a specific host species. ```bash datasets download virus genome taxon coronaviridae --host "manis javanica" ``` -------------------------------- ### Download Gene Data for a Specific Taxon Source: https://github.com/ncbi/datasets/blob/master/training/NIH_Research_Festival.md Specify a taxon using the `--taxon` flag when downloading gene data by symbol to avoid ambiguity. The example downloads BRCA1 data for a dog. ```bash datasets download gene symbol brca1 --taxon dog --filename dog-brca1.zip nzip dog-brca1.zip -d dog-brca1 Archive: dog-brca1.zip inflating: dog-brca1/README.md inflating: dog-brca1/ncbi_dataset/data/rna.fna inflating: dog-brca1/ncbi_dataset/data/protein.faa inflating: dog-brca1/ncbi_dataset/data/data_report.jsonl inflating: dog-brca1/ncbi_dataset/data/dataset_catalog.json inflating: dog-brca1/md5sum.txt ``` -------------------------------- ### Download SARS-CoV-2 genome with protein data Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Example command to download a virus genome data package for SARS-CoV-2, including protein sequences. The --include protein flag specifies the desired data type. ```bash datasets download virus genome taxon sars-cov-2 --host dog --include protein ``` -------------------------------- ### Count Genomes with Contig N50 Above 15Mb Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This exercise guides users to count genomes that meet a specific contig N50 threshold (above 15Mb). This likely involves using the `datasets summary genome taxon` command with a flag related to N50 values, discoverable via the `--help` option. ```bash # How many genomes have a contig N50 value above 15Mb? ``` -------------------------------- ### Get Protein Sequences for Genome with Highest ContigN50 Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This command uses the datasets CLI to find the genome with the highest contigN50 value and then downloads its protein sequences. It first queries for genomes, sorts them by contigN50 in descending order, takes the top one, and then downloads the protein FASTA files. ```bash datasets summary genome taxon "Homo sapiens" --assembly-level "Complete Genome" | \ datasets select genome --contig-n50 --order desc | \ datasets download protein FASTA --include-unplaced --include-alt --output-dir ./homo_sapiens_protein ``` -------------------------------- ### Generate Table with Sequencing Technology (Exercise) Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Placeholder for using 'dataformat' to generate a table including sequencing technology. ```bash # Use dataformat to generate a table that includes sequencing technology ``` -------------------------------- ### View Downloaded Protein File Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Display the first few lines of a downloaded protein FASTA file using 'cat' and 'head'. ```bash # Take a peek at the downloaded protein file cat acromyrmex/ncbi_dataset/data/GCA_000204515.1/protein.faa | head ``` -------------------------------- ### Build Datasets Client with Bazel Source: https://github.com/ncbi/datasets/blob/master/client/README.md Use this command to build the Datasets client. Ensure Bazel and workspace_status.sh are available in your PATH. ```bash bazel build apps/public/Datasets/... ``` -------------------------------- ### Navigate to Home Directory Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use `pwd` to check the current working directory and `%cd ..` to navigate one level up in the directory structure. ```bash pwd ``` ```bash %cd .. ``` -------------------------------- ### Get Current Directory Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb The '!pwd' command is used to print the current working directory. ```bash !pwd ``` -------------------------------- ### Set up NCBI Taxonomy Database for BLAST Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb This sequence of commands creates a 'blastdb' directory, changes into it, downloads the NCBI taxonomy database ('taxdb'), and then extracts its contents. This prepares the environment for creating BLAST databases with taxonomy information. ```bash # Create a folder called blastdb !mkdir blastdb # change directory to the folder blastdb %cd blastdb # download the NCBI Taxonomy Database (taxdb) !update_blastdb.pl taxdb #Now let's extract the taxdb to the blastdb folder !tar xfz taxdb.tar.gz ``` -------------------------------- ### View Downloaded Protein File Header Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb Use `cat` and `head` to display the first few lines of a downloaded protein FASTA file. This allows for a quick inspection of the file's content and format. ```bash cat acromyrmex/ncbi_dataset/data/GCA_000204515.1/protein.faa | head ``` -------------------------------- ### Unzip Data Package (Exercise) Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Placeholder for unzipping a downloaded data package. ```bash # Unzip the data package ``` -------------------------------- ### Get Gene Metadata by Symbol Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Retrieves and displays metadata for a specific gene symbol in Drosophila melanogaster. The output is formatted using jq for readability. ```bash # Get metadata for a gene by symbol in Drosophila melanogaster datasets summary gene symbol cglr1 --taxon 'drosophila melanogaster' | jq -C . ``` -------------------------------- ### View Contents of fetch.txt Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md The `fetch.txt` file contains URLs for retrieving the actual data files. Use the `head` command to view the initial lines of this file. ```bash head 59204/ncbi_dataset/fetch.txt https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DcyN9M3tzQF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1kvLS9RLrzJgtGAEAIMhH_A 0 data/GCF_001276795.1/GCF_001276795.1_ASM127679v1_genomic.fna https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DcyN9M3tzQF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1ktPS9NLrzJgtGAEAIMLH-4 0 data/GCF_001276795.1/genomic.gff https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DcyN9O3MDcF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1kvLS9RLrzJgtGAEAIIvH-s 0 data/GCF_001276875.1/GCF_001276875.1_ASM127687v1_genomic.fna https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DcyN9O3MDcF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1ktPS9NLrzJgtGAEAIIZH-k 0 data/GCF_001276875.1/genomic.gff https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DczstA3NzUF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1kvLS9RLrzJgtGAEAIBWH-E 0 data/GCF_001628755.1/GCF_001628755.1_ASM162875v1_genomic.fna https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DczstA3NzUF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1ktPS9NLrzJgtGAEAIIH-4 0 data/GCF_001628755.1/genomic.gff https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DczstQ3NzUF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1kvLS9RLrzJgtGAEAIFYH-Y 0 data/GCF_001629755.1/GCF_001629755.1_ASM162975v1_genomic.fna https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DczstQ3NzUF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1ktPS9NLrzJgtGAEAIFCH-Q 0 data/GCF_001629755.1/genomic.gff https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DczstQ3NzcF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1kvLS9RLrzJgtGAEAINGH_A 0 data/GCF_001629775.1/GCF_001629775.1_ASM162977v1_genomic.fna https://api.ncbi.nlm.nih.gov/datasets/fetch_h/R2V0UmVtb3RlRGF0YWZpbGU/eNqTyufKzUtOytROKymw0tdPT83Lz00t1k_MydF3d3bTNzAw1DczstQ3NzcF8eOBfCAXyNMzjHcM9oVwygzxycWDzcxM1ktPS9NLrzJgtGAEAIMwH-4 0 data/GCF_001629775.1/genomic.gff ``` -------------------------------- ### View Rehydrate Help Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Display the help information for the 'datasets rehydrate' command. ```bash # Let's look at the help file for rehydrate datasets rehydrate -h ``` -------------------------------- ### Generate Table with Sequencing Technology Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb Utilize the `dataformat` command to create a table that includes sequencing technology information for the downloaded genomes. This is useful for comparative analysis of different sequencing methods. ```bash %%bash # Use dataformat to generate a table that includes sequencing technology ``` -------------------------------- ### Get Genome Summary Count Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use `datasets summary` to retrieve the total count of genomes for a given taxon. Pipe the output to `jq` to extract the `total_count` field. ```bash datasets summary genome taxon formicidae | jq '.total_count' ``` -------------------------------- ### Explore Data Package Structure Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use the 'tree' command to visualize the directory structure of the extracted data package, showing the organization of downloaded files. ```bash #Explore the data package structure using tree tree gene ``` -------------------------------- ### Displaying `datasets rehydrate` Help Menu Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md View the help menu for the `datasets rehydrate` subcommand to understand its available flags and usage. ```bash datasets rehydrate --help ``` -------------------------------- ### Get Gene and Ortholog Metadata Source: https://github.com/ncbi/datasets/blob/master/training/NCBI_Datasets_Orthologs.ipynb Use the datasets summary command to retrieve gene symbol and ortholog information for specified species. The output is saved in JSON lines format. ```bash datasets summary gene symbol adamts8 \ --ortholog 'homo sapiens,cetacea' \ --report product --as-json-lines > adamts8_products.jsonl ``` -------------------------------- ### View JSON Lines Metadata with jq and Head Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Display the first 20 lines of a JSON Lines file with colored output using `jq -C` and `head`. This helps in quickly inspecting the metadata. ```bash jq -C . drosophila.jsonl | head -n 20 ``` -------------------------------- ### Count Drosophila Genomes with Datasets Summary Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Use `datasets summary` to get the total count of genomes for a given taxon. Pipe the output to `jq` to extract the specific count. ```bash # Get the genome count for the genus Drosophila (Taxid: 7215) datasets summary genome taxon 7215 | jq '.total_count' ``` -------------------------------- ### Explore Directory Structure Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use the 'tree' command to view the file and directory structure of the unzipped data, specifically within the 'ortholog' folder. ```bash tree ortholog/ ``` -------------------------------- ### Explore Directory Structure Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Displays the file and directory structure of the downloaded data package using the `tree` command. Useful for understanding the organization of downloaded data. ```bash tree -C all/ ``` -------------------------------- ### Summarize Gene by Symbol Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This command summarizes gene information for a given symbol. The output is typically JSON and can be further processed with tools like `jq`. This example queries for the 'IFNG' gene in humans. ```bash datasets summary gene symbol ifng | jq -C . ``` -------------------------------- ### View Genome Metadata with jq and head Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb View the first 50 lines of a JSON-Lines metadata file using `cat`, `jq -C` for colored output, and `head -n 50`. This helps in quickly inspecting the metadata content. ```bash cat formicidae_summary.jsonl | jq -C . | head -n 50 ``` -------------------------------- ### Get Gene Metadata by Symbol (Drosophila pseudoobscura) Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Attempts to retrieve metadata for a gene using its symbol in *Drosophila pseudoobscura*. This command is used to check if a gene symbol exists in the specified taxon. ```bash datasets summary gene symbol cglr1 --taxon "drosophila pseudoobscura" ``` -------------------------------- ### Get Salmonella Genome Accession Numbers with Date Filters Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Retrieve only the genome identifiers for Salmonella samples released within a specific date range. Pipe the output to `jq` for formatted display. ```bash datasets summary genome taxon salmonella --released-after 2024-10-04 --released-before 2024-10-06 --report ids_only | jq . ``` -------------------------------- ### Display Datasets Rehydrate Help Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb Displays the help information for the `datasets rehydrate` command, outlining its usage, available flags, and global options. This command is used to download data files specified in a fetch.txt file. ```bash datasets rehydrate -h ``` -------------------------------- ### View Dataformat TSV Genome Help Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Access the help menu for the 'dataformat tsv genome' command to understand available options for formatting genomic data into TSV. ```bash dataformat tsv genome --help ``` -------------------------------- ### Download Genome Data Package (GenBank) Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Downloads a genome data package for a specified species from GenBank, including chromosome-level assemblies. Use `--no-progressbar` to suppress the progress indicator. ```bash datasets download genome taxon 'drosophila pseudoobscura' --assembly-source genbank --assembly-level chromosome --filename pseudoobscura.zip --no-progressbar ``` -------------------------------- ### Count species in Formicidae family Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use `datasets summary` to get genome data for the Formicidae family, then `dataformat` to extract organism names, and finally `sort` and `uniq -c` to count unique species. ```bash datasets summary genome taxon formicidae --as-json-lines | dataformat tsv genome \ --fields organism-name --elide-header | sort | uniq -c ``` -------------------------------- ### Download Gene Orthologs for a Taxonomy Range Source: https://github.com/ncbi/datasets/blob/master/training/NIH_Research_Festival.md Use the `--ortholog` flag to download orthologs for a specified gene within a given taxonomy range. The example downloads BRCA1 orthologs within vertebrates. ```bash datasets download gene symbol brca1 --taxon dog --ortholog vertebrates --filename brca1-vertebrates.zip Collecting 1 gene record [================================================] 100% 1/1 Collecting 441 gene records [================================================] 100% 441/441 unzip brca1-vertebrates.zip -d brca1-vertebrates Archive: brca1-vertebrates.zip inflating: brca1-vertebrates/README.md inflating: brca1-vertebrates/ncbi_dataset/data/rna.fna inflating: brca1-vertebrates/ncbi_dataset/data/protein.faa inflating: brca1-vertebrates/ncbi_dataset/data/data_report.jsonl inflating: brca1-vertebrates/ncbi_dataset/data/dataset_catalog.json inflating: brca1-vertebrates/md5sum.txt ``` -------------------------------- ### Summarize Gene with Synonym Handling Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use 'datasets summary gene symbol --as-json-lines' to get gene information, handling potential synonyms. Pipe to 'dataformat tsv gene' to extract specific fields. ```bash # how datasets deals with synonyms datasets summary gene symbol IFG --as-json-lines | dataformat tsv gene \ --fields tax-name,symbol,synonyms ``` -------------------------------- ### Get Gene Metadata by Symbol (Drosophila melanogaster) Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Retrieves metadata for a gene by its symbol in *Drosophila melanogaster*. The output is piped to `jq` for pretty-printing. This command is useful for inspecting detailed gene information for a specific species. ```bash datasets summary gene symbol cglr1 --taxon 'drosophila melanogaster' | jq -C . ``` -------------------------------- ### Download all virus genomes for a taxon Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Use this command to download all available virus genomes for a given taxon ID. Specify an output filename with `--filename`. ```bash datasets download virus genome taxon 12637 --filename dengue-all.zip ``` -------------------------------- ### Get Gene Metadata by Symbol (Human) Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Retrieves metadata for a gene using its symbol in humans. The output is piped to `jq` for pretty-printing and then to `head` to display the first 20 lines. This is useful for quickly inspecting gene information. ```bash datasets summary gene symbol cgas | jq . -C | head -20 ``` -------------------------------- ### Analyze Assembly Level Breakdown Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This exercise involves analyzing the breakdown of genome assembly levels. It suggests using the `datasets summary genome taxon` command, likely with specific flags to categorize assemblies by their level. ```bash # Assembly level breakdown ``` -------------------------------- ### Unzip and organize downloaded data package Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md After downloading a data package, use the 'unzip' command to extract its contents. The -d option specifies the directory where the files should be extracted, helping to organize the downloaded data. ```bash unzip 54736.zip -d sbongori ``` -------------------------------- ### Explore folder structure with tree command Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use the `tree` command with color highlighting (`-C`) to display the folder structure of the 'genomes' directory. ```bash tree -C genomes/ ``` -------------------------------- ### Download Filtered Ortholog Set Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Downloads an ortholog set filtered by specific taxonomic groups. The --ortholog argument accepts a comma-separated list of taxa or 'all'. This example filters for the family Apidae and the species 'drosophila melanogaster'. ```bash datasets download gene symbol cglr1 --taxon 'drosophila melanogaster' --ortholog apidae,'drosophila melanogaster' --filename ortholog.zip --no-progressbar ``` -------------------------------- ### Unzip and Explore Dehydrated Package Contents Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md After downloading a dehydrated package, unzip it to inspect its contents. Note the presence of `fetch.txt` instead of the full data files. ```bash unzip 59204-dehydrated.zip -d 59204 Archive: 59204-dehydrated.zip inflating: 59204/README.md inflating: 59204/ncbi_dataset/data/assembly_data_report.jsonl inflating: 59204/ncbi_dataset/fetch.txt inflating: 59204/ncbi_dataset/data/dataset_catalog.json inflating: 59204/md5sum.txt ``` -------------------------------- ### Unzip and Inspect Genome Package Source: https://github.com/ncbi/datasets/blob/master/training/VGP_12062024.md After downloading a genome package, use unzip to extract its contents and tree to view the directory structure. The package includes the genome file, README, md5sum, and metadata. ```bash unzip ncbi_dataset.zip -d GCF_011100635 tree GCF_011100635 ``` ```bash GCF_011100635 ├── README.md ├── md5sum.txt └── ncbi_dataset └── data ├── GCF_011100635.1 │   └── GCF_011100635.1_mTriVul1.pri_genomic.fna ├── assembly_data_report.jsonl └── dataset_catalog.json ``` -------------------------------- ### Download Gene Data Package with FASTA Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Downloads a gene data package including gene, protein, and RNA FASTA files. Use --include to specify desired data types and --filename to name the output zip file. --no-progressbar suppresses the progress bar. ```bash datasets download gene gene-id 4803562 --filename gene.zip --include gene,protein,rna --no-progressbar ``` -------------------------------- ### Download reference virus genomes for a taxon Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Use this command to download only the reference genomes for a specific taxon ID. Specify an output filename with `--filename`. ```bash datasets download virus genome taxon 12637 --refseq --filename dengue-all-ref.zip ``` -------------------------------- ### Download Ortholog Sets using NCBI Datasets CLI Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use the 'datasets download gene' command to retrieve ortholog sets. Specify gene accession, gene ID, or symbol, and use '--ortholog all' to get the complete set. The '--taxon' flag can filter results by a specific taxonomic group. ```bash datasets download gene accession XR_002738142.1 --ortholog all ``` ```bash datasets download gene gene-id 101081937 --ortholog all ``` ```bash datasets download gene symbol BRCA1 --ortholog all --taxon cat ``` -------------------------------- ### Unzip Sequence Dataset Package Source: https://github.com/ncbi/datasets/blob/master/training/NCBI_Datasets_Orthologs.ipynb Unzip the downloaded sequence data package to a specified directory using the `unzip` command. ```bash # Unzip it to a folder with the same name unzip adamts8_orthologs.zip -d adamts8_orthologs ``` -------------------------------- ### Examine Gene Set Metadata with Dataformat Source: https://github.com/ncbi/datasets/blob/master/training/NCBI_Datasets_Orthologs.ipynb Use the `dataformat` command with the `data_report.jsonl` file to examine metadata for the downloaded gene set. Add columns like `protein-count` to view specific information about associated protein sequences. ```bash # Use dataformat to look at some metadata for the downloaded gene set # This time, our input for `dataformat` is the `data_report.jsonl` file that came with the sequence data package, which can be found in the following location in the unzipped directory. # We are adding a `protein-count` column to see if any of our orthologs have multiple associated protein sequences. dataformat tsv gene --input adamts8_orthologs/data_report.jsonl --fields tax-name,protein-count ``` -------------------------------- ### View dataformat TSV genome help Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Executes a bash command to display the help menu for the `dataformat tsv genome` command. This is useful for understanding available metadata fields for genome data in TSV format. ```bash dataformat tsv genome -h ``` -------------------------------- ### Download Dehydrated Genome Data Package (Exercise) Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Placeholder for downloading a dehydrated genome data package based on specific criteria. ```bash # Download a dehydrated genome data package ``` -------------------------------- ### Create Nucleotide BLAST Databases Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use `makeblastdb` to create nucleotide databases for genomic sequences. Specify the input FASTA file, database type, taxid, and output prefix. ```bash makeblastdb -dbtype nucl -in ../genomes/ncbi_dataset/data/GCA_000204515.1/GCA_000204515.1_Aech_3.9_genomic.fna -taxid 103372 -out Aechinatior ``` ```bash makeblastdb -dbtype nucl -in ../genomes/ncbi_dataset/data/GCA_017607455.1/GCA_017607455.1_ASM1760745v1_genomic.fna -taxid 230686 -out Ainsinuator ``` ```bash makeblastdb -dbtype nucl -in ../genomes/ncbi_dataset/data/GCA_017607545.1/GCA_017607545.1_ASM1760754v1_genomic.fna -taxid 2715315 -out Acharruanus ``` ```bash makeblastdb -dbtype nucl -in ../genomes/ncbi_dataset/data/GCA_017607565.1/GCA_017607565.1_ASM1760756v1_genomic.fna -taxid 230685 -out Aheyeri ``` ```bash makeblastdb -dbtype nucl -in ../genomes/ncbi_dataset/data/GCA_024713525.1/GCA_024713525.1_ASM2471352v1_genomic.fna -taxid 103372 -out Aechinatior ``` -------------------------------- ### View FASTA Headers of Downloaded Sequences Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Displays the first two lines of the FASTA headers for the downloaded gene, RNA, and protein sequences. This is useful for quickly identifying the downloaded sequences. ```bash head -2 cglr1/ncbi_dataset/data/*.f* ``` -------------------------------- ### Explore Folder Structure with Tree Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Use the `tree` command to visualize the directory structure of the extracted genome files. The `-C` flag enables colorized output. ```bash # Explore the folder structure of the folder genome with the command tree tree -C genomes/ ``` -------------------------------- ### View TSV File Header Source: https://github.com/ncbi/datasets/blob/master/training/NCBI_Datasets_Orthologs.ipynb Display the first 5 lines of the generated TSV file to inspect its structure and content. ```bash head -5 transcript_protein.tsv ``` -------------------------------- ### Download Genome by Taxon Name Source: https://github.com/ncbi/datasets/blob/master/training/VGP_12062024.md Attempt to download all genomes for a given taxonomic group using its scientific or common name. If the name is ambiguous, the CLI will provide a list of suggested TaxIDs. ```bash datasets download genome taxon frogs ``` -------------------------------- ### Inspect Full Genome Package Contents Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use the 'tree' command to view the directory structure of a standard genome data package. ```bash # Check the folder contents of genome tree genomes/ ``` -------------------------------- ### Create Conda Environment Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/readme.md Use this command to create a conda environment with all necessary packages to run the Jupyter Notebook. Ensure you have downloaded the 'datasets.yml' file first. ```bash conda env create --file datasets.yml ``` -------------------------------- ### Prepare and Rename FASTA Sequences Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Copies an ortholog FASTA file, replaces spaces in headers with underscores, and then uses `seqkit replace` with a key-value file to rename sequences based on the generated mapping. ```bash # Copy the ortholog dataset fasta from the folder ortholog to the folder datasets cp ortholog/ncbi_dataset/data/gene.fna ortholog_gene.fna # Replace spaces in the FASTA header by underscores. # Why? Because we need the FASTA headers to match the "old" in the file name_map.tsv. This is what we have: # Original: >NW_017296201.1:c2116125-2107387,LOC108758761,[organism=Trachymyrmex,cornetzi],[GeneID=108758761],[chromosome=Un] # "old": NW_017296201.1:c2116125-2107387_LOC108758761_[organism=Trachymyrmex_cornetzi]_[GeneID=108758761]_[chromosome=Un] # "new": T_cornetzi_108758761 sed 's/ /_/g' ortholog_gene.fna > ortholog_gene_nospaces.fna #Replace the names in the fasta file cat ortholog_gene_nospaces.fna | seqkit replace \ --kv-file <(cut -f 1,2 name_map.tsv) \ --pattern "^(.*)" --replacement "{kv}" > ortholog_gene_final.fna ``` -------------------------------- ### View Processed FASTA Headers Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use `grep` and `head` to display the first ten FASTA headers from the processed file, allowing verification of the name replacement. ```bash grep ">" ortholog_gene_final.fna | head ``` -------------------------------- ### View CDS Sequence Headers Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Displays the first few lines of the CDS FASTA file. Useful for verifying the downloaded coding sequences. ```bash head all/ncbi_dataset/data/cds.fna ``` -------------------------------- ### Count Reference Genomes in a Family Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This exercise demonstrates how to use the `--reference` flag with the `datasets summary genome taxon` command to count reference genomes within a specified family. It requires prior knowledge of the `--help` output for the `summary genome taxon` command. ```bash # How many reference genomes in the family Formicidae? (hint --reference) ``` -------------------------------- ### Download Genome and GFF3 Files (RefSeq) Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Downloads genome and GFF3 files for a specified species from RefSeq. The `--include` flag specifies the desired file types. Use `--no-progressbar` to suppress the progress indicator. ```bash datasets download genome taxon 'drosophila pseudoobscura' --assembly-source refseq \ --include genome,gff3 --filename pseudoobscura-rs-gff3.zip --no-progressbar unzip -l pseudoobscura-rs-gff3.zip ``` -------------------------------- ### Count Genomes for a Specific Organism Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This exercise focuses on counting the number of genomes available for a specific organism. It implies using the `datasets summary genome taxon` command with appropriate parameters, likely learned from the `--help` output. ```bash # How many genomes? ``` -------------------------------- ### Create Conda Environment for TAGC Workshop Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/README.md Use this command to create a new conda environment named 'tagc' with all necessary packages for the workshop. The '-y' flag automatically confirms prompts. ```bash conda create -n tagc -c conda-forge -c bioconda ncbi-datasets-cli jq tree clustalo jupyterlab -y ``` -------------------------------- ### Download Ortholog Set for Cetaceans Source: https://github.com/ncbi/datasets/blob/master/training/NCBI_Datasets_Orthologs.ipynb Download a dataset containing orthologs for specified taxa and the original human sequence. Use the `--filename` and `--no-progressbar` flags for controlled downloads. ```bash # download the ortholog set for cetaceans and the original human sequence datasets download gene symbol adamts8 --taxon 'human' --ortholog 'human',cetacea --filename adamts8_orthologs.zip --no-progressbar ``` -------------------------------- ### Unzip and Visualize Dehydrated Package Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb After downloading a dehydrated package, unzip it to access its contents. The `tree` command can then be used to visualize the structure of the extracted archive. `-C` enables colorized output. ```bash unzip -q pseudoobscura-dry.zip -d pseudoobscura-dry tree -C pseudoobscura-dry ``` -------------------------------- ### Summarize Orthologs by Taxon Source: https://github.com/ncbi/datasets/blob/master/training/NCBI_Datasets_Orthologs.ipynb Use the `summary` command to view metadata without downloading data. Pipe the output to `dataformat` to reformat it into a human-readable TSV file, filtering for specific fields like taxonomic names. ```bash datasets summary gene symbol adamts8 --taxon 'human' --ortholog cetacea --as-json-lines | dataformat tsv gene --fields tax-name ``` -------------------------------- ### Download Gene, RNA, and Protein Sequences Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Downloads the gene, RNA, and protein sequences for a specified gene symbol and taxon. The `--include` flag specifies which sequence types to download. The output is saved to a zip file. `--no-progressbar` suppresses the progress bar. ```bash datasets download gene symbol cglr1 --taxon 'drosophila melanogaster' --include gene,rna,protein --filename cglr1.zip --no-progressbar ``` -------------------------------- ### Examine Protein FASTA Headers Source: https://github.com/ncbi/datasets/blob/master/training/NCBI_Datasets_Orthologs.ipynb Extract and display the first few headers from a protein FASTA file to inspect their format. This helps in understanding the information contained within and identifying potential issues for downstream analysis. ```bash #Extracting just the headers to look at their format grep ">" adamts8_orthologs/ncbi_dataset/data/protein.faa | head -5 ``` -------------------------------- ### Retrieve Summary Metadata for an Organism Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This exercise prompts users to retrieve summary metadata for a chosen organism using the `datasets summary genome taxon` command. It suggests using a specific organism or its taxid if no favorite is available. ```bash # Now look at the summary metadata for your organism of interest # (if you don't have a favorite, go with red panda, Ailurus fulgens, taxid: 9649) ``` -------------------------------- ### Inspect fetch.txt File Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Read and display the contents of the 'fetch.txt' file from a dehydrated package using pandas. ```python # Inspect the file fetch.txt import pandas as pd fetch = pd.read_csv('./acromyrmex/ncbi_dataset/fetch.txt', sep='\t', header=None) fetch ``` -------------------------------- ### Unzip downloaded genome data Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Unzip the 'genomes.zip' file into a directory named 'genomes', overwriting existing files without prompting. ```bash unzip -o genomes.zip -d genomes ``` -------------------------------- ### Prepare and Align Protein Sequences Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Renames FASTA headers by replacing spaces with underscores for better compatibility with alignment tools, then runs Clustal Omega for sequence alignment. The --force flag overwrites existing output files. ```bash sed 's/ /_/g' ortholog/ncbi_dataset/data/protein.faa > renamed.proteins clustalo --infile renamed.proteins --full --outfmt=clu --force ``` -------------------------------- ### Download Gene Orthologs with Taxonomic Filter Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Downloads a gene data package containing orthologs, filtered by specified taxa. Use --ortholog 'all' for the complete set. The --filename and --no-progressbar flags control output file and progress display. ```bash # download the cglr1 ortholog set for the genus Drosophila (Taxid: 7215) datasets download gene symbol cglr1 --taxon 'drosophila melanogaster' --ortholog apidae,'drosophila melanogaster' --filename ortholog.zip --no-progressbar ``` -------------------------------- ### Unzip Data Package Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Unzip the downloaded data package file into a specified directory. The '-o' flag overwrites existing files without prompting. ```bash #Unzip the file unzip -o gene.zip -d gene ``` -------------------------------- ### Download Gene Data Package with Multiple Sequence Types Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Downloads a gene data package including CDS, RNA, and protein sequences. Progress bar is disabled. ```bash datasets download gene gene-id 4803562 --include cds,rna,protein --filename all.zip --no-progressbar ``` -------------------------------- ### Download Ortholog Data Package Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb Use this command to download the ortholog data package for a specific gene ID and target taxon. Specify the output filename and include gene data. ```bash datasets download gene gene-id 40650 --ortholog formicidae --include gene --filename ortholog.zip --no-progressbar ``` -------------------------------- ### Download Genomes and GFF3 Files Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Download specific file types (genome and gff3) for a species from NCBI RefSeq. Uses `--assembly-source refseq` and `--include genome,gff3`. ```bash # Now download the genomes and gff3 files for all *Drosophila pseudoobscura* genomes annotated by NCBI datasets download genome taxon 'drosophila pseudoobscura' --assembly-source refseq \ --include genome,gff3 --filename pseudoobscura-rs-gff3.zip --no-progressbar unzip -l pseudoobscura-rs-gff3.zip ``` -------------------------------- ### Count Annotated Reference Genomes Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb This exercise shows how to count annotated genomes using the `--annotated` flag in conjunction with the `datasets summary genome taxon` command. It builds upon understanding the command's help information. ```bash # How many reference genomes are annotated? (hint: --annotated) ``` -------------------------------- ### Unzip the Data Package Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14_with-outputs.ipynb After downloading a dehydrated data package, use the `unzip` command to extract its contents. This makes the individual files within the package accessible for inspection. ```bash %%bash # Unzip the data package ``` -------------------------------- ### Download GenBank Assemblies for Drosophila pseudoobscura Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop.ipynb Download a genome data package containing chromosome-level GenBank assemblies for a specific species. Uses `--assembly-source genbank` and `--assembly-level chromosome`. ```bash # Download a genome data package containing all chromosome-level GenBank assemblies for the species Drosophila pseudoobscura datasets download genome taxon 'drosophila pseudoobscura' --assembly-source genbank --assembly-level chromosome --filename pseudoobscura.zip --no-progressbar ``` -------------------------------- ### Rehydrating Specific Files with `datasets rehydrate` Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Download only GFF3 files from a specified directory using the `--match` flag and list the files that will be downloaded with `--list`. The output is piped to `head` to display the first ten matching files. ```bash datasets rehydrate --directory 59204 --match gff --list | head ``` -------------------------------- ### Download Gene by Symbol with Taxon Source: https://github.com/ncbi/datasets/blob/master/training/TAGC-2024/TAGC 2024 workshop with outputs.ipynb Download gene information using its symbol. It is recommended to specify the taxon as gene symbols are not always unique across species. If no taxon is specified, it defaults to human. ```bash datasets download gene symbol cglr1 --taxon 'drosophila melanogaster' ``` -------------------------------- ### Download Salmonella bongori genomes by TaxID Source: https://github.com/ncbi/datasets/blob/master/training/ASM-NGS/ASM-NGS-Datasets.md Use the 'datasets download genome taxon' command to retrieve genome data for a specific NCBI TaxID. Specify an output filename with the --filename option. This is useful for downloading data for smaller genomes or specific organisms. ```bash datasets download genome taxon 54736 --filename 54736.zip ``` -------------------------------- ### Download Gene by Gene ID Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Use the 'datasets download gene gene-id' command to download gene data using its unique gene ID. Taxon is implied. ```bash datasets download gene gene-id 101081937 ``` -------------------------------- ### Download Gene Data by Symbol Source: https://github.com/ncbi/datasets/blob/master/training/VGP_12062024.md Download gene data for a specific symbol (e.g., 'brca1') within a given taxon (e.g., 'dog'). The output is saved as 'ncbi_dataset.zip' and then unzipped. ```bash datasets download gene symbol brca1 --taxon dog unzip ncbi_dataset.zip -d dog-brca1 ``` -------------------------------- ### Download List of Genes Source: https://github.com/ncbi/datasets/blob/master/training/2023-01-03-datasets-cli14/2023-01-03-datasets-v14.ipynb Download a data package containing a list of genes specified in a file (e.g., genes.txt). The output is saved as 'gene_list.zip'. ```bash # Download a list of genes and save the data package as gene_list.zip (--filename gene_list.zip) ```