Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

267 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lung microbiome visium

Tool to design probes under various constraints (primarily for use with Visium Spatial Gene Expression).

Installation

After cloning the repo, set up your environment using Conda or Python venv:

Conda

conda env create -f environment.yml
conda activate probe_design

Python venv

Requires Python 3.11+

You will also need to install BLAST+.

python -m venv venv
source venv/bin/activate
pip install --upgrade setuptools wheel pip
pip install -r requirements.txt

Usage

usage: visium_prototype.py [-h] --target_gene_file TARGET_GENE_FILE --on_target_genome_file ON_TARGET_GENOME_FILE --db_path DB_PATH (--snp_file SNP_FILE | --msa_file MSA_FILE) [--ref_id REF_ID]
                           [--kmer_size KMER_SIZE] [--position POSITION] [--base BASE] [--gc_min GC_MIN] [--gc_max GC_MAX] [--red_zone_start RED_ZONE_START] [--red_zone_end RED_ZONE_END]
                           [--red_zone_threshold RED_ZONE_THRESHOLD] [--green_zone_threshold GREEN_ZONE_THRESHOLD] [--blacklist_taxon BLACKLIST_TAXON] [--blacklist_accession BLACKLIST_ACCESSION]
                           [--taxon_table TAXON_TABLE] [--blastdb [BLASTDB ...]] [--blast_output BLAST_OUTPUT] [--blast_config BLAST_CONFIG] [--threads THREADS] [--results_file RESULTS_FILE]
                           [--log_file LOG_FILE] [--verbose_log] [--ncbi_help_email NCBI_HELP_EMAIL]

Probe design tool

options:
  -h, --help            show this help message and exit

Required arguments:
  --target_gene_file TARGET_GENE_FILE
                        A file containing a set of target genes in multi fasta format. (default: None)
  --on_target_genome_file ON_TARGET_GENOME_FILE
                        A reference genome (fasta) for your target organism (default: None)
  --db_path DB_PATH     Path to a directory containing off-target jellyfish databases (default: None)

SNP file arguments:
  Please provide either --snp_file or --msa_file

  --snp_file SNP_FILE   File containing 1-based SNP locations in provided genome (default: None)
  --msa_file MSA_FILE   Multiple sequence alignment from pangenome analysis pipeline (default: None)
  --ref_id REF_ID       Reference ID in MSA file (default: None)

Kmer arguments:
  --kmer_size KMER_SIZE
                        Specified length of kmer (default: 50)
  --position POSITION   0-based position for targeted base (usually the halfway point of the probe) (default: 24)
  --base BASE           Base used as target in chosen position in probe (default: T)
  --gc_min GC_MIN       Minimum allowed GC % on either side of the chosen base (default: 44)
  --gc_max GC_MAX       Maximum allowed GC % on either side of the chosen base (default: 72)

SNP zone arguments:
  --red_zone_start RED_ZONE_START
                        Start (inclusive, 1-based) of the zone where red_zone_threshold SNPs are allowed (default: None)
  --red_zone_end RED_ZONE_END
                        End (inclusive, 1-based) of the zone where red_zone_threshold SNPs are allowed (default: None)
  --red_zone_threshold RED_ZONE_THRESHOLD
                        Number of SNPs allowed in red zone (red_zone_start, red_zone_end) (default: 0)
  --green_zone_threshold GREEN_ZONE_THRESHOLD
                        Number of SNPs allowed on each side of the red zone (default: 5)

Taxonomy arguments:
  --blacklist_taxon BLACKLIST_TAXON
                        File containing GTDB taxonomies to exclude from off-target search, use with --taxon_table (default: None)
  --blacklist_accession BLACKLIST_ACCESSION
                        File containing accessions to exclude from off-target search (default: None)
  --taxon_table TAXON_TABLE
                        Translation table linking accession to taxonomy, required if using --blacklist_taxon (default: None)

BLAST arguments:
  --blastdb [BLASTDB ...]
                        One or more paths to (nucleotide) BLAST databases to search for kmers (default: None)
  --blast_output BLAST_OUTPUT
                        File to output BLAST results (default: blast_results)
  --blast_config BLAST_CONFIG
                        JSON file of parameters to be used with blastn (default: /home/ubuntu/git_repos/lung-microbiome-visium/config/blast_params.json)

General arguments:
  --threads THREADS     How many parallel processes to use to query jellyfish k-mer databases (default: 16)
  --results_file RESULTS_FILE
                        File to output results (default: kmer_results.fasta)
  --log_file LOG_FILE   File to output kmer comparison log (default: run.log)
  --verbose_log         Include filtering result for every kmer in log in addition to summary (default: False)
  --ncbi_help_email NCBI_HELP_EMAIL
                        Email required by NCBI to assist or contact user based on issues with DB searches (default: pathdevg@sanger.ac.uk)

Notes about arguments

Target gene file

Probes are created directly from the sequences in the target gene file. In the case of Visium, this means the gene sequences should correspond to the reverse complement of the mRNA the probes will bind to. Example: MAB_genes.fa

DB path

The directory tree of the parent path should have a predictable structure, related to INDSC accessions of assemblies, e.g. the jf file for assembly with accession GCF_016456235.1, could be found under subdirectories GCF/016/456. Such a database can be created using the jellyfish generator.

SNP file

SNP locations are used to assess if there are more than a given threshold of SNPs in different zones of the probe. Example:

105
162
201
Red & green zones

The red zone start and end define a relative region of the probe that is typically allowed less SNPs (e.g. the area surrounding the target base), with the limit specified by the red_zone_threshold argument. The green zone is the rest of the probe, with SNP threshold specified by the green_zone_threshold argument. If a red zone is not specified, it will cover the whole probe and there will not be a green zone.

Blacklist taxon

Taxonomy hierarchy paths can be generated from GTDB by searching on multiple fields. A line in the file may look like this:

d__Bacteria;p__Pseudomonadota;c__Gammaproteobacteria;o__Enterobacterales;f__Enterobacteriaceae;g__Escherichia;s__Escherichia coli
Blacklist accession

A line in the file may look like this:

GCF_016456235
Taxon table

Can be downloaded from the GTDB repository and is the same as the species_table used with jellyfish generator. A line in the file may look like this:

RS_GCF_016456235.1      d__Bacteria;p__Pseudomonadota;c__Gammaproteobacteria;o__Enterobacterales;f__Enterobacteriaceae;g__Escherichia;s__Escherichia coli
BLAST config

Only arguments included in the default config are supported. See BLAST documentation for argument descriptions.

About

Tool to design probes under various constraints (primarily for use with 10X Genomics Visium Spatial Gene Expression).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages