python 使用所需列输出来自两个实验的数据,按其内容过滤区域。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 使用所需列输出来自两个实验的数据,按其内容过滤区域。相关的知识,希望对你有一定的参考价值。

import xmlrpclib
import time

url = "http://deepblue.mpi-inf.mpg.de/xmlrpc"
user_key = "anonymous_key"

server = xmlrpclib.Server(url, allow_none=True)

# Selecting the data from 2 experiments: BL-2_c01.ERX297416.H3K27ac.bwa.GRCh38.20150527.bed and S008SGH1.ERX406923.H3K27ac.bwa.GRCh38.20150728.bed
# As we already know the experiments names, we keep all others fields empty.
# We are selecting the are in the chromosome 1, position 0 to 50.000.000.
(status, query_id) = server.select_experiments (["BL-2_c01.ERX297416.H3K27ac.bwa.GRCh38.20150527.bed", "S008SGH1.ERX406923.H3K27ac.bwa.GRCh38.20150728.bed"], "chr1", 0, 50000000, user_key )

# Filter the regions by where the SIGNAL_VALUE is higher than 10
(status, query_id_filter_signal) = server.filter_regions (query_id, "SIGNAL_VALUE", ">", "10", "number", user_key )

# Filter the regions by where the PEAK is higher than 1000
(status, query_id_filters) = server.filter_regions (query_id_filter_signal, "PEAK", ">", "1000", "number", user_key )


# Retrieve the experiments data (The @NAME meta-column is used to include the experiment name and @BIOSOURCE for experiment's biosource
(status, request_id) = server.get_regions(query_id_filters, "CHROMOSOME,START,END,SIGNAL_VALUE,PEAK,@NAME,@BIOSOURCE", user_key)

# Wait for the server processing
(status, info) = server.info(request_id, user_key)
request_status = info[0]["state"]
while request_status != "done" and request_status != "failed":
  time.sleep(1)
  (status, info) = server.info(request_id, user_key)
  request_status = info[0]["state"]

(status, regions) = server.get_request_data(request_id, user_key)

print regions

以上是关于python 使用所需列输出来自两个实验的数据,按其内容过滤区域。的主要内容,如果未能解决你的问题,请参考以下文章

如何将批处理命令输出放在 csv 文件的所需列中

删除列或使用所需列重新创建表:哪个更好?

在不选择所需列的情况下加入表或加入表中列的子选择是不是更有效

提高链接来自两个数据帧的数据的效率

python练习1

如何使用psql中表中的列列表检索数据