跳转到主要内容

辅助将geo元数据自动转换为hca元数据标准的工具

项目描述

geo_to_hca

辅助将geo元数据自动转换为hca元数据标准的工具。

安装

pip install geo-to-hca

描述

该工具以单个GEO访问号或GEO访问号列表以及模板HCA元数据Excel表格作为输入。它为每个访问号返回预填充的HCA元数据Excel表格。然后每个表格都可以用作手动校对的中间文件。可选地,还可以生成输出日志文件,其中列出每个输入的GEO访问号中SRA研究访问号和fastq文件名。

用法

通过pip安装后,作为包运行

$ geo-to-hca -h                                                            
usage: geo-to-hca [-h] [--accession ACCESSION]
                  [--accession_list ACCESSION_LIST] [--input_file INPUT_FILE]
                  [--nthreads NTHREADS] [--template TEMPLATE]
                  [--header_row HEADER_ROW] [--input_row1 INPUT_ROW1]
                  [--output_dir OUTPUT_DIR] [--output_log OUTPUT_LOG]

optional arguments:
  -h, --help            show this help message and exit
  --accession ACCESSION
                        accession (str): either GEO or SRA accession
  --accession_list ACCESSION_LIST
                        accession list (comma separated)
  --input_file INPUT_FILE
                        optional path to tab-delimited input .txt file
  --nthreads NTHREADS   number of multiprocessing processes to use
  --template TEMPLATE   path to an HCA spreadsheet template (xlsx)
  --header_row HEADER_ROW
                        header row with HCA programmatic names
  --input_row1 INPUT_ROW1
                        HCA metadata input start row
  --output_dir OUTPUT_DIR
                        path to output directory; if it does not exist, the
                        directory will be created
  --output_log OUTPUT_LOG
                        True/False: should the output result log be created

作为Python模块运行

cd /path-to/geo_to_hca
python -m geo_to_hca.geo_to_hca -h

基本参数:需要以下选项之一。最多只能指定1个选项。

选项(1):获取1个GEO访问号的HCA元数据

示例命令

geo-to-hca --accession GSE97168

选项(2):获取逗号分隔的GEO访问号列表的HCA元数据

示例命令

geo-to-hca --accession_list GSE97168,GSE124872,GSE126030

选项(3):给定一个由访问号组成的文件,获取HCA元数据。注意:标题中应包含“访问号”这一列名。例如,一个名为accessions.txt的示例输入文件应如下所示:

accession
GSE97168
GSE124872
GSE126030

示例命令

geo-to-hca --input_file <路径>/accessions.txt

其他可选参数

(1)

--template,default="template/hca_template.xlsx"

默认模板是一个空的Excel格式的HCA元数据工作表,其中包含1-5行相关的HCA元数据标题。默认的标题行(带程序化名称)是第4行;默认的起始输入行是第6行。除非HCA工作表格式发生变化,否则无需指定此参数。

(2)

--header_row,type=int,default=4

默认的标题行(带程序化名称)是第4行。除非HCA工作表格式发生变化,否则无需指定此参数。

(3)

--input_row1,type=int,default=6

默认的起始输入行是第6行。除非HCA工作表格式发生变化,否则无需指定此参数。

(4)

--output_dir,default='spreadsheets/'

可以通过路径指定输出目录。如果路径不存在,将会被创建。如果没有给出此参数,默认输出目录是'spreadsheets/'。

(5)

--output_log,type=bool,default=True

这是一个可选参数,用于检索一个输出日志文件,该文件表明对于输入的每个GEO访问号,是否提供了SRA研究ID和fastq文件名。

开发者说明

要求

本项目的要求列在2个文件中:`requirements.txt` 和 `requirements-dev.txt`。`requirements-dev.txt` 文件包含针对开发的具体依赖项。

需求文件(`requirements.txt`,`requirements-dev.txt`)使用 pip-compilepip-tools 生成。

pip-compile requirements.in
pip-compile requirements-dev.in

直接依赖项列在 `requirements.in`,`requirements-dev.in` 输入文件中。

安装依赖项

  • 使用来自 pip-toolspip-sync
pip-sync requirements.txt requirements-dev.txt
  • 或直接使用 pip install
    pip install -r requirements.txt
    pip install -r requirements-dev.txt

升级依赖项

为了更新所有包,定期重新运行 pip-compile --upgrade

为了更新特定包到最新版本或特定版本,使用 --upgrade-package-P 标志

pip-compile --upgrade-package requests

更多信息请参阅pip-compile的文档

在可编辑模式下开发代码

使用 pip 的可编辑模式,使用 geo_to_hca 作为依赖的项目可以直接引用此存储库中的最新代码,而无需通过 PyPI 安装。这可以通过手动克隆代码库或让 pip 自动完成来实现。

pip install -e path/to/geo_to_hca

通过提供一个对此存储库的引用,让 pip 自动完成

pip install -e \
git+https://github.com/ebi-ait/geo_to_hca.git\
#egg=geo-to-hca

发布到PyPI

  1. 通过注册页面创建PyPI账户。

    请注意,PyPI在发布前需要验证电子邮件地址。

  2. 打包项目以进行分发。

     python setup.py sdist
    
  3. 安装Twine

     pip install twine        
    
  4. 将分发包上传到PyPI。

     twine upload dist/*
    

    运行 python setup.py sdist 将在项目基础目录的 dist 目录中创建一个包。

项目详情


下载文件

下载适用于您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

geo-to-hca-1.0.21.tar.gz (94.2 kB 查看哈希值)

上传时间:

由以下提供支持