@@ -136,6 +136,36 @@ def get(self, efp="", view="", mode="", gene_1="", gene_2=""):
136136 return send_from_directory (directory = "../output/" , path = path , mimetype = "image/png" )
137137
138138
139+ @efp_image .route ("/get_efp_data_source/<species>" )
140+ class eFPDataSource (Resource ):
141+ @efp_image .param ("species" , _in = "path" , default = "sorghum" )
142+ def get (self , species = "" ):
143+ """
144+ Returns Data sources using eFP Directory
145+ Supported species: Sorghum
146+ """
147+
148+ species = species .lower ()
149+ results = []
150+
151+ # This will only work on the BAR
152+ if os .environ .get ("BAR" ):
153+ if species == "sorghum" :
154+ efp_base_path = "/var/www/html/efp_sorghum/data"
155+ else :
156+ return BARUtils .error_exit ("Invalid species." )
157+
158+ data_files = os .listdir (efp_base_path )
159+
160+ for file in data_files :
161+ if file .endswith (".xml" ) and file != "efp_info.xml" :
162+ results .append (file .rstrip (".xml" ))
163+
164+ return BARUtils .success_exit (results )
165+ else :
166+ return BARUtils .error_exit ("Only available on the BAR." )
167+
168+
139169@efp_image .route ("/get_efp_dir/<species>" )
140170class eFPXMLSVGList (Resource ):
141171 @efp_image .param ("species" , _in = "path" , default = "arabidopsis" )
0 commit comments