find-in-gene
CLI tool from the bioconda package entrez-direct for filtering GENE XML on strand and interval overlap.
Quick Start
- Command:
cat genes.xml | PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH /home/vimalinx/miniforge3/envs/bio/bin/find-in-gene plus 1200 1800 - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/find-in-gene - Reference: See
references/help.mdfor full usage details
When To Use This Tool
- Select gene names whose
Min/Maxspan overlaps a query interval inGENEXML. - Restrict matches to a specific strand value such as
plusorminus. - Use as a tiny
xtractwrapper in larger EDirect XML pipelines.
Common Patterns
# 1) Find plus-strand genes overlapping a region
cat genes.xml | \
PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH \
/home/vimalinx/miniforge3/envs/bio/bin/find-in-gene plus 1200 1800
# 2) Query minus-strand overlaps from an EDirect pipeline
upstream_gene_xml_command | \
PATH=/home/vimalinx/miniforge3/envs/bio/bin:$PATH \
/home/vimalinx/miniforge3/envs/bio/bin/find-in-gene minus 50000 52000
Recommended Workflow
- Start from XML records that actually use the
GENEpattern withName,Strand,Min, andMaxelements. - Pass strand first, then the lower and upper coordinate bounds.
- Capture stdout as a simple list of matching gene names.
- If the interval bounds are reversed, let the script swap them, but still verify the query window before automating it.
Guardrails
- Despite the error text mentioning only start and stop positions, the script practically needs three arguments:
strand min max. Supplying only two causesxtractto fail with empty numeric constraints. - A fourth argument is accepted by the shell wrapper but is not used anywhere in the filter.
- This wrapper is stdin-driven and emits only
Name; it does not fetch gene records on its own. - Like other EDirect helpers, it requires companion binaries such as
xtractto be onPATH; absolute-path invocation alone is not sufficient in a bare shell.