This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Bioblend - upload_file does not work from command line ?

Hi all,

I have been trying to run Galaxy from command line via BioBlend by following an example given in Running Galaxy From Command Line With Bioblend.

I have not managed to upload a file from my local computer.

More specifically, I am trying to upload a simple flat file that contains one column of integer numbers. The exact content of this file is copy-pasted in the end of this message.

I am using the following commands for uploading.

from bioblend.galaxy import GalaxyInstance
from bioblend.galaxy.histories import HistoryClient
from bioblend.galaxy.tools import ToolClient
galaxyInstance = GalaxyInstance(url = GALAXY_URL, key=API_KEY)
historyClient = HistoryClient(galaxyInstance)
toolClient = ToolClient(galaxyInstance)
history = historyClient.create_history('tmp')
inputFile = toolClient.upload_file(LOCAL_FILE_PATH, history['id'], type='txt')

Then the content of inputFile is the following.

>>> inputFile
{u'outputs': [{u'visible': True, u'file_size': 0, u'file_ext': u'auto', u'id': u
'6b7e7ce7e274628f', u'misc_info': None, u'hda_ldda': u'hda', u'state': u'queued'
, u'metadata_dbkey': u'?', u'misc_blurb': None, u'peek': u'<table cellspacing="0
" cellpadding="3"></table>', u'update_time': u'2014-10-02T08:20:48.026438', u'da
ta_type': u'auto', u'tags': [], u'deleted': False, u'history_id': u'2d9035b3fc15
2403', u'genome_build': u'?', u'hid': 1, u'metadata_data_lines': None, u'uuid':
None, u'name': u'BigFile_test.txt', u'model_class': u'HistoryDatasetAssociation'
, u'output_name': u'output0', u'purged': False}]}

From what I understand u'file_size': 0 means that the size of uploaded file is zero. In practice, I think it means the uploading operation failed to upload any content to the inputFile variable.

Does anybody have any idea why this happens?

With best regards, Erno Lindfors

<FileContent>
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
2
3
4
5
1
</FileContent>
galaxy bioblend software-error

0 answers

No answers yet.

Log in to answer this question.