Hi Eli,

That could easily be accomplished without changing the code, by writing a simple tool.

The xml-file:

<tool id="importer" name="Import" version="0.0.1" hidden="false">
<description>Import files</description>
<parallelism method="basic"></parallelism>
<command interpreter="python">
    -$link "$infile" "$outfile"
<param type="text" name="infile" size="180" label="Enter path to file to upload" /> <param name="link" type="boolean" truevalue="--link" checked="false" falsevalue="" label="Link to file" help="Should the file be linked instead of copied into Galaxy?" />
<data format="data" name="outfile" label="Imported file" />

**What it does**

This tool is a simple file importer


The path string points to a local file, that should be imported into the current history.


And the Python script:


import argparse, os
version = '0.0.1'

def __main__():
  parser = argparse.ArgumentParser(
    description='Simple Galaxy file importer')

  parser.add_argument('--version', action='version',
    version='%(prog)s '+version,
    help='Display version information')

  parser.add_argument('infile', nargs=1,
    help='input filename mask')

  parser.add_argument('savefile', nargs=1,
    help='savefile filename')

    help='Make symbolic link to file')

    args = parser.parse_args()

    if args.link:
      os.system('ln -fs %s %s' % (args.infile[0],args.savefile[0]))
      os.system('cp %s %s' % (args.infile[0],args.savefile[0]))

  except Exception as E:
    print >> sys.stderr, E

if __name__=="__main__": __main__()

I have written a handful of Galaxy tools that implements this technique, and it works like a charm. However this specific example is copy and pasted and simplified from one of my existing tools, so I haven't actually tried it, so It might contain a few spelling mistooks.

With a minimum of coding, the opposite can also be implemented, namely exporting files from galaxy to an external local file.

Kind regards

Frank Sorensen

Den 16-04-2012 08:13, Eli Reuveni skrev:


I have a local galaxy instance in my institute and have few basic questions:

1)I need to enable galaxy to upload large files from the local galaxy server without the need to use the ftp or the file upload module, is there an easy way to do it or do I need to write a special code?

2)I need to customize galaxy Python code (i.e., under the ~/galaxy-dist/lib directory). Where can I find documentation of the galaxy Python classes (using wiki or other format)

Thanks in advanced,

Frank Sørensen, B.Sc., Programmer
Molecular Diagnostic Laboratory (MDL)
Molekylær Medicinsk Afdeling (MOMA)
Århus Universitetshospital Skejby, Brendstrupgårdsvej, 8200 Århus N
Tlf. +45 7845 5363
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:


Reply via email to