Mercurial > repos > iuc > data_manager_snpeff
changeset 12:617d95d798fa draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/data_managers/data_manager_snpeff commit 5ed67056af2b7289fcf89e96c34afe11fa39bbdf
| author | iuc |
|---|---|
| date | Tue, 10 Mar 2026 10:12:26 +0000 |
| parents | def511e8e005 |
| children | |
| files | data_manager/data_manager_snpEff_databases.xml data_manager/data_manager_snpEff_download.py data_manager/data_manager_snpEff_download.xml |
| diffstat | 3 files changed, 33 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/data_manager/data_manager_snpEff_databases.xml Tue Nov 24 07:27:28 2020 +0000 +++ b/data_manager/data_manager_snpEff_databases.xml Tue Mar 10 10:12:26 2026 +0000 @@ -1,7 +1,7 @@ -<tool id="data_manager_snpeff_databases" name="SnpEff Databases" version="4.3.1t" tool_type="manage_data" profile="18.09"> +<tool id="data_manager_snpeff_databases" name="SnpEff Databases" version="5.4.0c" tool_type="manage_data" profile="24.2"> <description>Read the list of available SnpEff databases</description> <requirements> - <requirement type="package" version="4.3.1t">snpeff</requirement> + <requirement type="package" version="5.4.0c">snpeff</requirement> </requirements> <command detect_errors="exit_code"><![CDATA[ python '$__tool_directory__/data_manager_snpEff_databases.py' '$out_file' @@ -25,7 +25,7 @@ This tool updates the list of SnpEff databases for the SnpEff Download data manager. It should only need to be run once for a SnpEff version, since it populates the SnpEff Download data manager from the SnpEff config file. -For information about SnpEff: http://snpeff.sourceforge.net +For information about SnpEff and its databases see: https://pcingola.github.io/SnpEff/snpeff/introduction/#databases. ]]></help> <citations> <citation type="doi">10.4161/fly.19695</citation>
--- a/data_manager/data_manager_snpEff_download.py Tue Nov 24 07:27:28 2020 +0000 +++ b/data_manager/data_manager_snpEff_download.py Tue Mar 10 10:12:26 2026 +0000 @@ -1,4 +1,5 @@ #!/usr/bin/env python +import gzip import json import optparse import os @@ -61,6 +62,20 @@ return snpeff_version +def getSnpeffDbVersion(db_predictor_bin_file): + snpeff_db_version = None + try: + with gzip.open(db_predictor_bin_file, "rt") as fh: + buf = fh.read(100) + lines = buf.splitlines() + m = re.match(r"^(SnpEff)\s+(\d+\.\d+).*$", lines[0].strip()) + if m: + snpeff_db_version = m.groups()[0] + m.groups()[1] + except Exception: + pass + return snpeff_db_version + + # Download human database 'hg19' # java -jar snpEff.jar download -v hg19 # @@ -87,12 +102,18 @@ snpeff_version = getSnpeffVersion() key = snpeff_version + '_' + genome_version if os.path.isdir(genome_path): - for _, _, files in os.walk(genome_path): + for dirpath, _, files in os.walk(genome_path): for fname in files: if fname.startswith('snpEffectPredictor'): # if snpEffectPredictor.bin download succeeded name = genome_version + (' : ' + organism if organism else '') - data_table_entry = dict(key=key, version=snpeff_version, value=genome_version, name=name, path=data_dir) + data_table_entry = dict( + key=key, + version=getSnpeffDbVersion(os.path.join(dirpath, fname)) or snpeff_version, + value=genome_version, + name=name, + path=data_dir + ) _add_data_table_entry(data_manager_dict, 'snpeffv_genomedb', data_table_entry) else: m = re.match(regulation_pattern, fname)
--- a/data_manager/data_manager_snpEff_download.xml Tue Nov 24 07:27:28 2020 +0000 +++ b/data_manager/data_manager_snpEff_download.xml Tue Mar 10 10:12:26 2026 +0000 @@ -1,7 +1,7 @@ -<tool id="data_manager_snpeff_download" name="SnpEff Download" version="4.3.1t" tool_type="manage_data" profile="18.09"> +<tool id="data_manager_snpeff_download" name="SnpEff Download" version="5.4.0c" tool_type="manage_data" profile="24.2"> <description>Download a new database</description> <requirements> - <requirement type="package" version="4.3.1t">snpeff</requirement> + <requirement type="package" version="5.4.0c">snpeff</requirement> </requirements> <command detect_errors="exit_code"><![CDATA[ python '$__tool_directory__/data_manager_snpEff_download.py' @@ -9,7 +9,7 @@ '$out_file' ]]></command> <inputs> - <param name="genome_version" type="text" value="" label="Snpff Genome Version Name (e.g. GRCh38.76)" help="https://snpeff-data.galaxyproject.org/databases/"> + <param name="genome_version" type="text" value="" label="SnpEff Genome Version Name (e.g. GRCh38.76)"> <validator type="regex" message="A genome version name is required">\S+</validator> </param> </inputs> @@ -19,12 +19,12 @@ </outputs> <tests> <test> - <param name="genome_version" value="GRCh38.86"/> + <param name="genome_version" value="ebola_zaire"/> <output name="out_file"> <assert_contents> <!-- Check that a genome was added --> - <has_text text="GRCh38.86" /> - <has_text text="snpeffv_regulationdb" /> + <has_text text="ebola_zaire" /> + <has_text text="snpeffv_genomedb" /> </assert_contents> </output> </test> @@ -34,9 +34,7 @@ To see the list of available SnpEff genomes, run the "SnpEff Databases" data manager which records the available genome databases in data table: snpeffv_databases. -The SnpEff genome databases are at: http://sourceforge.net/projects/snpeff/files/databases/ - -For details about this tool, please go to http://snpeff.sourceforge.net +For details about this tool, please go to https://pcingola.github.io/SnpEff/snpeff/introduction/#databases. ]]></help> <citations> <citation type="doi">10.4161/fly.19695</citation>
