[galaxy-dev] HOW TO RETRIEVE DATA FROM HISTORY??!!
gordon at cshl.edu
Fri Aug 5 14:15:35 EDT 2011
colin molter wrote, On 08/05/2011 01:54 PM:
> Is there a way to directly move/copy data from your galaxy history to a given location in the filesystem of the same galaxy server?
> Said differently, there is a nice way to import data from the server to galaxy, is it possible to do the reverse?
> that is ok for me.
> However, if someone has a better solution, any advices are fine for me
If you feel comfortable meddling directly with your galaxy database, the following query will give you the dataset file numbers for each dataset in a given history.
dataset.id as "DatasetFileNumber",
lpad(trunc(dataset.id/1000), 3, '0') as "Directory",
'dataset_' || dataset.id || '.dat' as "Filename",
history_dataset_association.hid as "Dataset Number in History",
history_dataset_association.name as "Dataset Name"
dataset.id = history_dataset_association.dataset_id
history.id = history_dataset_association.history_id
history.user_id = galaxy_user.id
galaxy_user.email = 'gordon at cshl.edu'
history.name = 'K9981_het'
Just change the "history.name" and the "galaxy_user.email" in the query to get the correct history (assuming your histories' names are unique).
This SQL is for PostgreSQL, but MySQL should be similar.
The first column (DatasetFileNumber) is the file associated with the galaxy dataset (e.g. 2456)
The second is the directory (e.g. "002" for dataset 2456),
The third is the file name (e.g. "dataset_2456.dat").
A simple shell script should be able to construct the correct path.
Note that for datasets larger than 100,000 there's going to be an extra directory of "000/" (e.g. "000/101/dataset_101123.dat").
As always, direct database access is never recommended...
hope this helps,
More information about the galaxy-dev