Previous changeset 0:8ad77a9dc91d (2023-02-14) Next changeset 2:bd56ac4cca16 (2023-02-17) |
Commit message:
planemo upload commit 32f035f6404452fc8a1cf01d71be3c0b46548338 |
modified:
data_manager/plasmidfinder_fetch_database.py data_manager/plasmidfinder_fetch_database.xml test-data/plasmidfinder.loc.test |
added:
test-data/plasmidfinder_test_data_manager_latest.json |
b |
diff -r 8ad77a9dc91d -r 9ef108e34063 data_manager/plasmidfinder_fetch_database.py --- a/data_manager/plasmidfinder_fetch_database.py Tue Feb 14 14:25:43 2023 +0000 +++ b/data_manager/plasmidfinder_fetch_database.py Wed Feb 15 10:35:15 2023 +0000 |
[ |
@@ -143,22 +143,21 @@ with open(output_tar_path_file, 'wb') as output_dir: output_dir.write(request_info.content) untar_output = self.untar_files(file_path=output_tar_path_file, extracted_path_output=output_tar_path.joinpath(self._db_name)) - - self.moove_download_files(older_path=untar_output, new_path=output_path) + self.moove_download_files(source=untar_output, destination=output_path) except requests.exceptions.HTTPError as http_error: print(f"Requests Error: {http_error}") print(f"Fail to import Plasmidfinder database from {self._plasmidfinder_url}") - def moove_download_files(self, older_path, new_path, expression_search="*fsa"): + def moove_download_files(self, source, destination, expression_search="*"): """ Clean downloaded data by mooving fasta files in the final folder @older_path: previous path where the files are located @new_path: final path where files will be mooved @expression_search: keep only file with this expression """ - fasta_files = Path(older_path).rglob(expression_search) + fasta_files = Path(source).rglob(expression_search) file_list_paths = [file for file in fasta_files if file.is_file()] - [self.keep_filename(pathname=path, output_path=new_path) for path in file_list_paths] + [self.keep_filename(pathname=path, output_path=destination) for path in file_list_paths] def keep_filename(self, pathname, output_path): """ |
b |
diff -r 8ad77a9dc91d -r 9ef108e34063 data_manager/plasmidfinder_fetch_database.xml --- a/data_manager/plasmidfinder_fetch_database.xml Tue Feb 14 14:25:43 2023 +0000 +++ b/data_manager/plasmidfinder_fetch_database.xml Wed Feb 15 10:35:15 2023 +0000 |
[ |
@@ -1,3 +1,4 @@ + <tool id="data_manager_fetch_plasmidfinder" name="plasmidfinder_datamanager" tool_type="manage_data" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> <description>plasmidfinder database builder</description> <macros> @@ -25,7 +26,7 @@ <param name="database_select" value="latest"/> <output name="output_file" value="plasmidfinder_test_data_manager_latest.json"> <assert_contents> - <has_text_matching expression='{"data_tables": {"plasmidfinder_database": [{"date": "\d\d\d\d-\d\d-\d\d", "name": "b1c9ddac0e61_\d\d\d\d-\d\d-\d\d", "path": "plasmidfinder-db", "value": "plasmidfinder_b1c9ddac0e61_\d\d\d\d-\d\d-\d\d"' /> + <has_text_matching expression='\{"data_tables":\ \{\"plasmidfinder_database\"\:\ \[\{\"date\"\:\ \"\d\d\d\d\w\d\d\w\d\d\", \"name\"\: \"\w\w\w\w\w\w\w\w\w\w\w\w\d\d\d\d-\d\d-\d\d\",\ \"path\"\:\ \"plasmidfinder-db\",\ \"value\"\:\ \"plasmidfinder_\w\w\w\w\w\w\w\w\w\w\w_\d\d\d\d-\d\d-\d\d\"' /> </assert_contents> </output> </test> @@ -34,7 +35,7 @@ <param name="database_select" value="2.1"/> <output name="output_file" value="plasmidfinder_test_data_manager_2.1.json"> <assert_contents> - <has_text_matching expression='"data_tables": \{"plasmidfinder_database": \[\{"date": "\d\d\d\\d-\d\d-\d\d", "name": "2\.1_\d\d\d\d-\d\d-\d\d", "path": "plasmidfinder-db", "value": "plasmidfinder_1307168b1ce7_\d\d\d\d-\d\d-\d\d"' /> + <has_text_matching expression='"data_tables": \{"plasmidfinder_database": \[\{"date": "\d\d\d\\d-\d\d-\d\d", "name": "2\.1_\d\d\d\d-\d\d-\d\d", "path": "plasmidfinder-db", "value": "plasmidfinder_\w\w\w\w\w\w\w\w\w\w\w\w_\d\d\d\d-\d\d-\d\d"' /> </assert_contents> </output> </test> |
b |
diff -r 8ad77a9dc91d -r 9ef108e34063 test-data/plasmidfinder.loc.test --- a/test-data/plasmidfinder.loc.test Tue Feb 14 14:25:43 2023 +0000 +++ b/test-data/plasmidfinder.loc.test Wed Feb 15 10:35:15 2023 +0000 |
b |
@@ -1,12 +1,12 @@ plasmidfinder_9002e7282dd0_2022-12-20 9002e7282dd0_2022-12-20 2022-12-20 plasmidfinder-db plasmidfinder_1307168b1ce7_2022-12-20 2.1_2022-12-20 2022-12-20 plasmidfinder-db -plasmidfinder_c18e08c17a59_2023-01-27 c18e08c17a59_2023-01-27 2023-01-27 /tmp/tmp9g7s9mjt/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-01-27 -plasmidfinder_1307168b1ce7_2023-01-27 2.1_2023-01-27 2023-01-27 /tmp/tmp9g7s9mjt/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-01-27 -plasmidfinder_c18e08c17a59_2023-01-27 c18e08c17a59_2023-01-27 2023-01-27 /tmp/tmpdy82xyjr/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-01-27 -plasmidfinder_1307168b1ce7_2023-01-27 2.1_2023-01-27 2023-01-27 /tmp/tmpdy82xyjr/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-01-27 -plasmidfinder_c18e08c17a59_2023-01-27 c18e08c17a59_2023-01-27 2023-01-27 /tmp/tmp6_mld4pi/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-01-27 -plasmidfinder_1307168b1ce7_2023-01-27 2.1_2023-01-27 2023-01-27 /tmp/tmp6_mld4pi/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-01-27 -plasmidfinder_c18e08c17a59_2023-02-07 c18e08c17a59_2023-02-07 2023-02-07 /tmp/tmp70ecz0oo/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-02-07 -plasmidfinder_1307168b1ce7_2023-02-07 2.1_2023-02-07 2023-02-07 /tmp/tmp70ecz0oo/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-02-07 -plasmidfinder_c18e08c17a59_2023-02-14 c18e08c17a59_2023-02-14 2023-02-14 /tmp/tmpvbz0fwsy/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-02-14 -plasmidfinder_1307168b1ce7_2023-02-14 2.1_2023-02-14 2023-02-14 /tmp/tmpvbz0fwsy/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-02-14 +plasmidfinder_c18e08c17a59_2023-02-14 c18e08c17a59_2023-02-14 2023-02-14 /tmp/tmpuox8103m/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-02-14 +plasmidfinder_1307168b1ce7_2023-02-14 2.1_2023-02-14 2023-02-14 /tmp/tmpuox8103m/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-02-14 +plasmidfinder_c18e08c17a59_2023-02-14 c18e08c17a59_2023-02-14 2023-02-14 /tmp/tmpn3vh0q7x/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-02-14 +plasmidfinder_1307168b1ce7_2023-02-14 2.1_2023-02-14 2023-02-14 /tmp/tmpn3vh0q7x/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-02-14 +plasmidfinder_c18e08c17a59_2023-02-14 c18e08c17a59_2023-02-14 2023-02-14 /tmp/tmp2rmtj19j/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-02-14 +plasmidfinder_1307168b1ce7_2023-02-14 2.1_2023-02-14 2023-02-14 /tmp/tmp2rmtj19j/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-02-14 +plasmidfinder_c18e08c17a59_2023-02-14 c18e08c17a59_2023-02-14 2023-02-14 /tmp/tmp1py50qws/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-02-14 +plasmidfinder_1307168b1ce7_2023-02-14 2.1_2023-02-14 2023-02-14 /tmp/tmp1py50qws/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-02-14 +plasmidfinder_c18e08c17a59_2023-02-14 c18e08c17a59_2023-02-14 2023-02-14 /tmp/tmpyavtigve/galaxy-dev/tool-data/plasmidfinder-db/c18e08c17a59_2023-02-14 +plasmidfinder_1307168b1ce7_2023-02-14 2.1_2023-02-14 2023-02-14 /tmp/tmpyavtigve/galaxy-dev/tool-data/plasmidfinder-db/2.1_2023-02-14 |
b |
diff -r 8ad77a9dc91d -r 9ef108e34063 test-data/plasmidfinder_test_data_manager_latest.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/plasmidfinder_test_data_manager_latest.json Wed Feb 15 10:35:15 2023 +0000 |
[ |
@@ -0,0 +1,1 @@ +{"data_tables": {"plasmidfinder_database": [{"date": "2022-12-19", "name": "9002e7282dd0_2022-12-19", "path": "plasmidfinder-db", "value": "plasmidfinder_9002e7282dd0_2022-12-19"}]}} \ No newline at end of file |