changeset 2:2e05a4fbcc24 draft

planemo upload for repository https://github.com/jaidevjoshi83/gaiac commit c31ef5726cd1d2659da9aeb956c22fb834b177ff
author jay
date Fri, 23 May 2025 17:56:01 +0000
parents a555581f014b
children 9de2b10ed246
files gaiac_pm_data_pulling/datapulling.py gaiac_pm_data_pulling/gaiac_data_download.py gaiac_pm_data_pulling/gaiac_pm_data_pulling.py gaiac_violin_plot/gaiac_violin_plot.xml
diffstat 4 files changed, 34 insertions(+), 72 deletions(-) [+]
line wrap: on
line diff
--- a/gaiac_pm_data_pulling/datapulling.py	Thu May 15 22:51:53 2025 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-import requests
-import sys
-
-def download_files_from_server(urls):
-    """
-    Function to download files from a FastAPI server.
-
-    Args:
-        ip (str): The IP address of the FastAPI server.
-        file_names (list): List of file names to download.
-
-    Returns:
-        None
-    """
-    for url in urls:
-        file_name = url.split('/')[len(url.split('/'))-1]
-        response = requests.get(url)
-        if response.status_code == 200:
-            with open(f"{file_name}", "wb") as f:
-                f.write(response.content)
-            print(f"File {file_name} downloaded successfully!")
-        else:
-            print(f"Failed to download {file_name}. Status code: {response.status_code}")
-
-if __name__=="__main__":
-
-    if len(sys.argv) > 1:
-        files  = sys.argv[1].split(',')
-        download_files_from_server( files)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gaiac_pm_data_pulling/gaiac_data_download.py	Fri May 23 17:56:01 2025 +0000
@@ -0,0 +1,29 @@
+import requests
+import sys
+
+def download_files_from_server(urls):
+    """
+    Function to download files from a FastAPI server.
+
+    Args:
+        ip (str): The IP address of the FastAPI server.
+        file_names (list): List of file names to download.
+
+    Returns:
+        None
+    """
+    for url in urls:
+        file_name = url.split('/')[len(url.split('/'))-1]
+        response = requests.get(url)
+        if response.status_code == 200:
+            with open(f"{file_name}", "wb") as f:
+                f.write(response.content)
+            print(f"File {file_name} downloaded successfully!")
+        else:
+            print(f"Failed to download {file_name}. Status code: {response.status_code}")
+
+if __name__=="__main__":
+
+    if len(sys.argv) > 1:
+        files  = sys.argv[1].split(',')
+        download_files_from_server( files)
\ No newline at end of file
--- a/gaiac_pm_data_pulling/gaiac_pm_data_pulling.py	Thu May 15 22:51:53 2025 +0000
+++ b/gaiac_pm_data_pulling/gaiac_pm_data_pulling.py	Fri May 23 17:56:01 2025 +0000
@@ -15,7 +15,7 @@
 
 def get_file_list(ip):
 
-    url = "%s/list-files"%(ip)
+    url = "%s/api/list-files"%(ip)
 
     with urllib.request.urlopen(url) as response:
         data = response.read()
@@ -33,9 +33,7 @@
         }}
 
         for i in get_file_list(ip):
-            # print("http://"+ip+'/download/'+i)
-            api_data[ip][i] = ip+'/download/'+i
-
+            api_data[ip][i] = ip+'/api/download/'+i
 
         ul = []
         for dataset, url in api_data[ip].items():
@@ -47,20 +45,6 @@
                 'selected': False
             })
         
-        # for urlname, genomes in api_data.items():
-        #     # URL-safe base64 encoding for the URL name
-        #     urlname_64 = urlname
-        #     ul = []
-        #     for genome, assets in genomes.items():
-        #         al = []
-
-        #         ul.append({
-        #             'name': genome,
-        #             'value': genome,
-        #             'options': [],
-        #             'selected': False
-        #         })
-
         return ul
     except Exception as e:
         # Handle any potential errors
@@ -73,26 +57,4 @@
 
 if __name__ == '__main__':
 
-    simulate_dynamic_options('http://192.168.1.202:8080')
-
-#    for i in simulate_dynamic_options('192.168.1.202:8080')[0]['options']:
-#        print(i)
-    #    print(i)
-    # parser = argparse.ArgumentParser()
-    # parser.add_argument('-n', '--names', dest='names', action='store', default=None, help='Table names to reload')
-    # parser.add_argument('-u', '--url', dest='url', action='store', default=None, help='Base url for reload')
-    # parser.add_argument('-k', '--key', dest='key', action='store', default=None, help='Galaxy API Key')
-    # parser.add_argument('-g', '--graceful', dest='graceful', action='store_true', help='Fail gracefully')
-
-    # args = parser.parse_args()
-    # try:
-    #     if not args.names:
-    #         tables = requests.get(urljoin(args.url, "api/tool_data"), params={'key': args.key}).json()
-    #         args.names = [d.get('name') for d in tables]
-    #     for name in args.names:
-    #         print(requests.get(urljoin(args.url, "api/tool_data/%s/reload" % (name)), params={'key': args.key}).json())
-    # except Exception as e:
-    #     if args.graceful:
-    #         print("Failed to reload data tables:\n%s" % (e))
-    #     else:
-    #         raise e
+    simulate_dynamic_options('http://iotprojects.ddns.net')
--- a/gaiac_violin_plot/gaiac_violin_plot.xml	Thu May 15 22:51:53 2025 +0000
+++ b/gaiac_violin_plot/gaiac_violin_plot.xml	Fri May 23 17:56:01 2025 +0000
@@ -13,7 +13,7 @@
   </stdio>
     <command detect_errors="exit_code"><![CDATA[
 
-      python '$__tool_directory__/violin_plot.py' --infile '$infile' -C '$clm_list_y' -H  '$fig_height' -W '$fig_width' -T '$plottitile' -O 'out.png' --ylab '$clm_lab_y' --xlab '$clm_lab_x'
+      python '$__tool_directory__/gaiac_violin_plot.py' --infile '$infile' -C '$clm_list_y' -H  '$fig_height' -W '$fig_width' -T '$plottitile' -O 'out.png' --ylab '$clm_lab_y' --xlab '$clm_lab_x'
 
         #if $Sel_x_tick_labels.Plot == 'advance'
             --custom_xtick_name  '$Sel_x_tick_labels.label'
@@ -49,7 +49,7 @@
   </inputs>
 
   <outputs>
-    <data name='output1' format='png' label="Output" from_work_dir="out.png"></data>
+    <data name='output1' format='png' label="${tool.name} on $on_string (png)" from_work_dir="out.png"></data>
   </outputs>
   
   <tests>