# HG changeset patch # User iuc # Date 1763730720 0 # Node ID a95177c4d627d777d25b75094e91f5ae59fece49 # Parent c3553950db1b01c96d2eeb19208e90d0877366e3 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/data_managers/data_manager_build_coreprofiler commit ed6d188035ac31aa2da132889141b0898aa6bc86 diff -r c3553950db1b -r a95177c4d627 README.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.rst Fri Nov 21 13:12:00 2025 +0000 @@ -0,0 +1,90 @@ +This tool downloads and builds the **CoreProfiler** scheme. +------------------------------------------------------------------------------- + +You can find the list of available schemes, as well as the reference platforms supported by CoreProfiler, in the +`CoreProfiler documentation `_. + +Please refer to this page for details on how to use the tool and which schema options are available. + +Use Galaxy's data manager framework to download and install new CoreProfiler schemes. + +If you want to use a scheme from **EnteroBase**, you do not need to provide any token or secret. + +However, if you want to use a scheme from **pubMLST** or **BigsDB**, you will need to follow a procedure before launching the data manager. + +BIGSdb and PubMLST platforms require **OAuth1 authentication** to access and download the most up-to-date schemes. +While authentication is not strictly mandatory, skipping it may result in downloading outdated schemes. + +This authentication involves two types of tokens: + +* **Consumer tokens**: permanent tokens used to initiate the authentication flow. +* **Access tokens**: tokens required to download a scheme. + +Procedure for **pubMLST schemes** (example: ``borrelia_3-cgMLST-639-pubmlst``) +------------------------------------------------------------------------------- + +1. Create an account on the `pubMLST website `_. +2. Generate a consumer token and secret from your account settings + (**My account → API keys → Enter key name → Submit**). +3. On your account page, go to **Database registrations**, check all databases, and register. +4. Download `coreprofiler `_ locally and run the following command to obtain your access token and secret: + + .. code-block:: bash + + coreprofiler db get_request_tokens --scheme \ + --consumer_key \ + --consumer_secret + + Replace the placeholders with your scheme of interest (example: ``borrelia_3``) and your actual consumer token and secret. + + This command will provide you with a URL to visit in order to authorize the client software to access your account. + After authorizing, it will give you a verification code that you need to enter in the command line prompt. + It will then return your access token and secret. + +5. Provide the consumer token, consumer secret, access token, and access secret in the data manager tool + by setting these bash variables in a ``.txt`` file: + + .. code-block:: bash + + export COREPROFILER_CONSUMER_TOKEN="" + export COREPROFILER_CONSUMER_SECRET="" + export COREPROFILER_ACCESS_TOKEN="" + export COREPROFILER_ACCESS_SECRET="" + +6. Set the path to this ``.txt`` file in your environment by making an environment variable + (example: ``export COREPROFILER_SECRETS_PATH="/path/to/your/secret_file.txt"``). + + +Procedure for **BigsDB schemes** (example: ``bordetella_1-cgMLST_genus-1415-BIGSdb``) +-------------------------------------------------------------------------------------- + +1. Create an account on the `BigsDB website `_. +2. Ask for a consumer token and secret by sending an email to ``bigsdb@pasteur.fr`` + (subject: **API client key**). +3. On your account page, go to **Database registrations**, check all databases, and register. +4. Download `coreprofiler `_ locally and run the following command to obtain your access token and secret: + + .. code-block:: bash + + coreprofiler db get_request_tokens --scheme \ + --consumer_key \ + --consumer_secret + + Replace the placeholders with your scheme of interest (example: ``bordetella_1``) and your actual consumer token and secret. + + This command will provide you with a URL to visit in order to authorize the client software to access your account. + After authorizing, it will give you a verification code that you need to enter in the command line prompt. + It will then return your access token and secret. + +5. Provide the consumer token, consumer secret, access token, and access secret in the data manager tool + by setting these bash variables in a ``.txt`` file: + + .. code-block:: bash + + export COREPROFILER_CONSUMER_TOKEN="" + export COREPROFILER_CONSUMER_SECRET="" + export COREPROFILER_ACCESS_TOKEN="" + export COREPROFILER_ACCESS_SECRET="" + +6. Set the path to this ``.txt`` file in your environment by making an environment variable + (example: ``export COREPROFILER_SECRETS_PATH="/path/to/your/secret_file.txt"``). diff -r c3553950db1b -r a95177c4d627 data_manager/data_manager_build_coreprofiler_download.xml --- a/data_manager/data_manager_build_coreprofiler_download.xml Tue Jul 22 09:00:12 2025 +0000 +++ b/data_manager/data_manager_build_coreprofiler_download.xml Fri Nov 21 13:12:00 2025 +0000 @@ -1,7 +1,7 @@ - 1.1.3 + 1.1.7 0 22.05 @@ -28,20 +28,46 @@ &2 + echo "Please set the following variables before running this tool:" >&2 + echo " COREPROFILER_CONSUMER_TOKEN" >&2 + echo " COREPROFILER_CONSUMER_SECRET" >&2 + echo " COREPROFILER_ACCESS_TOKEN" >&2 + echo " COREPROFILER_ACCESS_SECRET" >&2 + echo "Please refer to the data manager help section for more information on how to generate these tokens." >&2 + fi && +#end if + coreprofiler db download + -s $scheme_name + -o coreprofiler_${scheme_name}_${db_version}/scheme_$scheme_name + ## Used only for test + #if str($hide_test) == 'true': + -t + #end if + ## +#if $db_version == "token_version" + -k "$COREPROFILER_CONSUMER_TOKEN" + -ks "$COREPROFILER_CONSUMER_SECRET" + -a "$COREPROFILER_ACCESS_TOKEN" + -as "$COREPROFILER_ACCESS_SECRET" +#end if +&& coreprofiler db makeblastdb - -s coreprofiler_${scheme_name}/scheme_$scheme_name + -s coreprofiler_${scheme_name}_${db_version}/scheme_$scheme_name -n $scheme_name - -p coreprofiler_${scheme_name}/db_$scheme_name && + -p coreprofiler_${scheme_name}_${db_version}/db_$scheme_name && -mv coreprofiler_${scheme_name} '$out_file.extra_files_path' && +mv coreprofiler_${scheme_name}_${db_version} '$out_file.extra_files_path' && cp '$dmjson' '$out_file' ]]> @@ -54,21 +80,30 @@ #set $scheme_loci = str($coreprofiler_scheme_select).split('-')[2] #set $scheme_db = str($coreprofiler_scheme_select).split('-')[3] +#set $db_version = str($db_version) + { "data_tables":{ "coreprofiler_scheme":[ { - "value": "coreprofiler_downloaded_#echo date.today().strftime('%d%m%Y')#-${scheme_name}-${scheme_desc}-${scheme_loci}-${scheme_db}", - "name": "${scheme_name}: ${scheme_desc} [${scheme_loci} loci] (${scheme_db})", - "path": "coreprofiler_${scheme_name}", - "database": "coreprofiler_${scheme_name}/db_${scheme_name}/${scheme_name}.fasta", - "scheme": "coreprofiler_${scheme_name}/scheme_${scheme_name}" + "value": "coreprofiler_downloaded_#echo date.today().strftime('%d%m%Y')#-${scheme_name}-${scheme_desc}-${scheme_loci}-${scheme_db}-${db_version}", + "name": "${scheme_name}: ${scheme_desc} [${scheme_loci} loci] (${scheme_db}-${db_version})", + "path": "coreprofiler_${scheme_name}_${db_version}", + "database": "coreprofiler_${scheme_name}_${db_version}/db_${scheme_name}/${scheme_name}.fasta", + "scheme": "coreprofiler_${scheme_name}_${db_version}/scheme_${scheme_name}" } ] } }]]> + + + + + + + @@ -98,7 +133,7 @@ - + @@ -111,7 +146,7 @@ - + @@ -128,15 +163,47 @@ + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + @@ -147,6 +214,81 @@ You can find the list of available scheme, as well as the reference platforms supported by CoreProfiler, in the CoreProfiler documentation. Please refer to this page for details on how to use the tool and which schema options are available. + +Use Galaxy's data manager framework to download and install new CoreProfiler schemes : + +If you want to use a scheme from enterobase, you do not need to provide any token or secret. + +However, if you want to use a scheme from **pubMLST** or **BigsDB**, you will need to follow a procedure before launching the data manager. + +BIGSdb and PubMLST platforms require OAuth1 authentication to access and download the most up-to-date schemes. +While authentication is not strictly mandatory, skipping it may result in downloading outdated schemes. + +This authentication involves two types of tokens: + + * Consumer tokens : permanent tokens used to initiate the authentication flow. + + * Access tokens : tokens required to download a scheme. + +Procedure for pubMLST schemes (example with borrelia_3-cgMLST-639-pubmlst) : + +1. Create an account on the pubMLST website. +2. Generate a consumer token and secret from your account settings (My account > API keys > Enter key name > Submit). +3. On your account page, go to Database registrations, check all databases and register. +4. Download coreprofiler locally and run the following command to obtain your access token and secret + +Replace the placeholders with your scheme of interest (example : borrelia_3) your actual consumer token and secret : + +""" +coreprofiler db get_request_tokens --scheme --consumer_key --consumer_secret +""" + +This command will provide you with a URL to visit in order to authorize client software to access your account. + +After authorizing, it will give you a verification code that you need to enter in the command line prompt. + +It will then return your access token and secret. + +5. Provide the consumer token, consumer secret, access token, and access secret in the data manager tool by setting this bash variables in a txt file : + +""" +export COREPROFILER_CONSUMER_TOKEN="" +export COREPROFILER_CONSUMER_SECRET="" +export COREPROFILER_ACCESS_TOKEN="" +export COREPROFILER_ACCESS_SECRET="" +""" + +6. Set the path to this txt file in your environment by making an environment variable (example : export COREPROFILER_SECRETS_PATH="/path/to/your/secret_file.txt"). + +Procedure for BigsDB (example with bordetella_1-cgMLST_genus-1415-BIGSdb): + +1. Create an account on the BigsDB website. +2. Ask for a consumer token and secret by sending a mail to bigsdb@pasteur.fr (object "API client key"). +3. On your account page, go to Database registrations, check all databases and register. +4. Download coreprofiler locally and run the following command to obtain your access token and secret + +Replace the placeholders with your scheme of interest (example : bordetella_1) your actual consumer token and secret : + +""" +coreprofiler db get_request_tokens --scheme --consumer_key --consumer_secret +""" + +This command will provide you with a URL to visit in order to authorize client software to access your account. + +After authorizing, it will give you a verification code that you need to enter in the command line prompt. + +It will then return your access token and secret. + +5. Provide the consumer token, consumer secret, access token, and access secret in the data manager tool by setting this bash variables in a txt file : + +""" +export COREPROFILER_CONSUMER_TOKEN="" +export COREPROFILER_CONSUMER_SECRET="" +export COREPROFILER_ACCESS_TOKEN="" +export COREPROFILER_ACCESS_SECRET="" +""" + +6. Set the path to this txt file in your environment by making an environment variable (example : export COREPROFILER_SECRETS_PATH="/path/to/your/secret_file.txt"). ]]> 10.3390/microorganisms10020292 diff -r c3553950db1b -r a95177c4d627 test-data/coreprofiler_scheme.loc.test --- a/test-data/coreprofiler_scheme.loc.test Tue Jul 22 09:00:12 2025 +0000 +++ b/test-data/coreprofiler_scheme.loc.test Fri Nov 21 13:12:00 2025 +0000 @@ -8,4 +8,11 @@ # #For example #coreprofiler_downloaded_20250625_klebsiella_3_scgMLST634_632_loci_bigsdb klebsiella_3: scgMLST634 [632 loci] (BIGSdb) coreprofiler_klebsiella_3 coreprofiler_klebsiella_3/db_klebsiella_3/klebsiella_3.fasta coreprofiler_klebsiella_3/scheme_klebsiella_3 -coreprofiler_downloaded_10072025-borrelia_3-cgMLST-639-pubmlst borrelia_3: cgMLST [639 loci] (pubmlst) /tmp/tmpi2v1t1zz/galaxy-dev/tool-data/coreprofiler/coreprofiler_borrelia_3 coreprofiler_borrelia_3/db_borrelia_3/borrelia_3.fasta coreprofiler_borrelia_3/scheme_borrelia_3 +coreprofiler_downloaded_10102025-borrelia_3-cgMLST-639-pubmlst-no_token borrelia_3: cgMLST [639 loci] (pubmlst-no_token) /tmp/tmphn3k3ekk/galaxy-dev/tool-data/coreprofiler/coreprofiler_borrelia_3_no_token coreprofiler_borrelia_3_no_token/db_borrelia_3/borrelia_3.fasta coreprofiler_borrelia_3_no_token/scheme_borrelia_3 +coreprofiler_downloaded_10102025-bordetella_1-cgMLST_genus-1415-BIGSdb-no_token bordetella_1: cgMLST_genus [1415 loci] (BIGSdb-no_token) /tmp/tmphn3k3ekk/galaxy-dev/tool-data/coreprofiler/coreprofiler_bordetella_1_no_token coreprofiler_bordetella_1_no_token/db_bordetella_1/bordetella_1.fasta coreprofiler_bordetella_1_no_token/scheme_bordetella_1 +coreprofiler_downloaded_28102025-yersinia_1-Yersinia_cgMLST-500-BIGSdb-no_token yersinia_1: Yersinia_cgMLST [500 loci] (BIGSdb-no_token) /tmp/tmpomzcgw6j/galaxy-dev/tool-data/coreprofiler/coreprofiler_yersinia_1_no_token coreprofiler_yersinia_1_no_token/db_yersinia_1/yersinia_1.fasta coreprofiler_yersinia_1_no_token/scheme_yersinia_1 +coreprofiler_downloaded_17112025-yersinia_1-Yersinia_cgMLST-500-BIGSdb-no_token yersinia_1: Yersinia_cgMLST [500 loci] (BIGSdb-no_token) /tmp/tmphe1udqum/galaxy-dev/tool-data/coreprofiler/coreprofiler_yersinia_1_no_token coreprofiler_yersinia_1_no_token/db_yersinia_1/yersinia_1.fasta coreprofiler_yersinia_1_no_token/scheme_yersinia_1 +coreprofiler_downloaded_17112025-escherichia_v1-cgMLST-2513-enterobase-no_token escherichia_v1: cgMLST [2513 loci] (enterobase-no_token) /tmp/tmphe1udqum/galaxy-dev/tool-data/coreprofiler/coreprofiler_escherichia_v1_no_token coreprofiler_escherichia_v1_no_token/db_escherichia_v1/escherichia_v1.fasta coreprofiler_escherichia_v1_no_token/scheme_escherichia_v1 +coreprofiler_downloaded_17112025-borrelia_3-cgMLST-639-pubmlst-no_token borrelia_3: cgMLST [639 loci] (pubmlst-no_token) /tmp/tmp6njg6emw/galaxy-dev/tool-data/coreprofiler/coreprofiler_borrelia_3_no_token coreprofiler_borrelia_3_no_token/db_borrelia_3/borrelia_3.fasta coreprofiler_borrelia_3_no_token/scheme_borrelia_3 +coreprofiler_downloaded_17112025-yersinia_1-Yersinia_cgMLST-500-BIGSdb-no_token yersinia_1: Yersinia_cgMLST [500 loci] (BIGSdb-no_token) /tmp/tmp6njg6emw/galaxy-dev/tool-data/coreprofiler/coreprofiler_yersinia_1_no_token coreprofiler_yersinia_1_no_token/db_yersinia_1/yersinia_1.fasta coreprofiler_yersinia_1_no_token/scheme_yersinia_1 +coreprofiler_downloaded_17112025-escherichia_v1-cgMLST-2513-enterobase-no_token escherichia_v1: cgMLST [2513 loci] (enterobase-no_token) /tmp/tmp6njg6emw/galaxy-dev/tool-data/coreprofiler/coreprofiler_escherichia_v1_no_token coreprofiler_escherichia_v1_no_token/db_escherichia_v1/escherichia_v1.fasta coreprofiler_escherichia_v1_no_token/scheme_escherichia_v1