Package: geo-to-hca
geo_to_hcaA tool to assist in the automatic conversion of geo metadata to hca metadata standard.Installationpip install geo-to-hcaDescriptionThe tool takes as input a single GEO accession or list of GEO accessions and a template HCA metadata excel spreadsheet. It returns as output a pre-filled HCA metadata spreadsheet for each accession. Each spreadsheet can then be used as an intermediate file for completion by manual curation. Optionally an output log file can also be generated which lists the availability of an SRA study accession and fastq file names for each GEO accession given as input.UsageTo run it as a package, after installing it via pip:$geo-to-hca-husage:geo-to-hca[-h][--accessionACCESSION][--accession_listACCESSION_LIST][--input_fileINPUT_FILE][--nthreadsNTHREADS][--templateTEMPLATE][--header_rowHEADER_ROW][--input_row1INPUT_ROW1][--output_dirOUTPUT_DIR][--output_logOUTPUT_LOG]optionalarguments:-h,--helpshowthishelpmessageandexit--accessionACCESSIONaccession(str):eitherGEOorSRAaccession--accession_listACCESSION_LISTaccessionlist(commaseparated)--input_fileINPUT_FILEoptionalpathtotab-delimitedinput.txtfile--nthreadsNTHREADSnumberofmultiprocessingprocessestouse--templateTEMPLATEpathtoanHCAspreadsheettemplate(xlsx)--header_rowHEADER_ROWheaderrowwithHCAprogrammaticnames--input_row1INPUT_ROW1HCAmetadatainputstartrow--output_dirOUTPUT_DIRpathtooutputdirectory;ifitdoesnotexist,thedirectorywillbecreated--output_logOUTPUT_LOGTrue/False:shouldtheoutputresultlogbecreatedTo run it as a python module:cd/path-to/geo_to_hca
python-mgeo_to_hca.geo_to_hca-hBasic arguments: 1 of these options is required. No more than 1 option can be given.Option (1): Get the HCA metadata for 1 GEO accessionExample command:geo-to-hca --accession GSE97168Option (2): Get the HCA metadata for a comma-separated list of GEO accessionsExample command:geo-to-hca --accession_list GSE97168,GSE124872,GSE126030Option (3): Get the HCA metadata given a file consisting of accessions N.B. should consist of an "accession" column name in the header. For example, an example input file named accessions.txt, should look likeaccession
GSE97168
GSE124872
GSE126030Example command:geo-to-hca --input_file <path>/accessions.txtOther optional arguments:(1)--template,default="template/hca_template.xlsx"The default template is an empty HCA metadata spreadsheet in excel format, with the relevant HCA metdata headers in rows 1-5. The default header row with programmatic names is row 4; the default start input row is row 6.
It is not necessary to specify this argument unless the HCA spreadsheet format changes.(2)--header_row,type=int,default=4The default header row with programmatic names is row 4. It is not necessary to specify this argument unless the HCA spreadsheet format changes.(3)--input_row1,type=int,default=6The default start input row is row 6.
It is not necessary to specify this argument unless the HCA spreadsheet format changes.(4)--output_dir,default='spreadsheets/'An output directory can be specified by it's path. If the path does not already exist, it will be created. If this argument
is not given, the default output directory is 'spreadsheets/'(5)--output_log,type=bool,default=TrueAn optional arugment to retrieve an output log file stating whether an SRA study id and fastq file names were available for each GEO accession given as input.Developer NotesRequirementsRequirements for this project are listed in 2 files:requirements.txtandrequirements-dev.txt.
Therequirements-dev.txtfile contains dependencies specific for developmentThe requirement files (requirements.txt,requirements-dev.txt) are generated usingpip-compilefrompip-toolspip-compile requirements.in
pip-compile requirements-dev.inThe direct dependencies are listed inrequirements.in,requirements-dev.ininput files.Install dependenciesby usingpip-syncfrompip-toolspip-sync requirements.txt requirements-dev.txtor by just usingpip installpip install -r requirements.txt
    pip install -r requirements-dev.txtUpgrade dependenciesTo update all packages, periodically re-runpip-compile --upgradeTo update a specific package to the latest or a specific version use the--upgrade-packageor-Pflag:pip-compile --upgrade-package requestsSee more options in the pip-compiledocumentation.Developing Code in Editable ModeUsingpip's editable mode, projects using geo_to_hca as a dependency can refer to the latest code in this repository
directly without installing it through PyPI. This can be done either by manually cloning the code
base:pip install -e path/to/geo_to_hcaor by havingpipdo it automatically by providing a reference to this repository:pip install -e \
git+https://github.com/ebi-ait/geo_to_hca.git\
#egg=geo-to-hcaPublish to PyPICreate PyPI Account through theregistration page.Take note that PyPI requires email addresses to be verified before publishing.Package the project for distribution.python setup.py sdistInstallTwinepip install twineUpload the distribution package to PyPI.twine upload dist/*Runningpython setup.py sdistwill create a package in thedistdirectory of the project
base directory.