宏基因流程python后台部署
-
宏基因流程python后台部署
代码仓库地址
- git@192.168.0.156:/home/git/python/docker_build.git
- git@192.168.0.156:/home/git/python/GS_PY3.git
初始环境部署
# 安装conda(略) # 创建相应的环境 -c bioconda conda create -n lefse -y lefse=1.0.8.post1 conda create -n metaphlan2 -y metaphlan2=2.7.7 conda create -n krona -y krona=2.7.1 conda create -n GS_PY3 -y python=3.8 r=4.0.3部署过程命令
export WS="/home/bioinfo/workspace" export CONDA="/home/bioinfo/miniconda2" # 1.clone代码 cd $WS git clone git@192.168.0.156:/home/git/python/docker_build.git git clone git@192.168.0.156:/home/git/python/GS_PY3.git# 2.安装GS_PY3 cd $WS/GS_PY3 conda activate GS_PY3 pip uninstall GS_PY3 python setup.py sdist python setup.py install cp ./bin/gs_py3_fq_stat $CONDA/envs/GS_PY3/bin/# 3.安装 docker_build 相关软件扩展 # lefse cd $WS/docker_build/lefse conda activate lefse pip uninstall easy_lefse python setup.py sdist python setup.py install# krona cd $WS/docker_build/krona conda activate krona pip uninstall easy_krona python setup.py sdist python setup.py install# metaphlan2 cd $WS/docker_build/metaphlan conda activate metaphlan2 pip uninstall easy_mpa python setup.py sdist python setup.py install -
metaphlan 2.7.7 报错
# 170 metaphlan_hclust_heatmap.py --in /home/bioinfo/software/cromwell/cromwell-executions/demo_2020_12_15_20_22_35_copy/60edd0a5-84ba-4328-bee7-2df493f29ae3/call-easyMpa_8/inputs/273451736/mpa_merge_table.txt --out hm_a.png --tax_lev a -c bbcry -s log --top 25 --in /home/bioinfo/software/cromwell/cromwell-executions/demo_2020_12_15_20_22_35_copy/60edd0a5-84ba-4328-bee7-2df493f29ae3/call-easyMpa_8/inputs/273451736/mpa_merge_table.txt --minv 0.1 # 报错 : AttributeError: Unknown property axisbg修改:
def heatmap_panel( fig, D, minv, maxv, idx1, idx2, cm_name, scale, cols, rows, label_font_size, cb_offset, cb_l, flabelson, slabelson, cm_ticks, gridon, bar_offset ): cm = pylab.get_cmap(cm_name) bottom_col = [ cm._segmentdata['red'][0][1], cm._segmentdata['green'][0][1], cm._segmentdata['blue'][0][1] ] axmatrix = fig.add_axes( [0.0,0.0,1.0,1.0]) # 去除axisbg # axmatrix = fig.add_axes( [0.0,0.0,1.0,1.0], axisbg=bottom_col) ... -
lefse 1.0.8.post1 报错
# 170 lefse-plot_cladogram.py all_add_groups.res all_add_groups_cladogram.png --format png --clade_sep 0.05 --abrv_stop_lev 7 --dpi 500 # 报错: AttributeError: Unknown property axis_bgcolor修改:~/miniconda2/envs/lefse/bin/lefse-plot_cladogram.py
def draw_tree(out_file,tree,params): plt_size = 7 nlev = tree['nlev'] pt_scale = (params['min_point_size'],max(1.0,((tree['max_abs']-tree['min_abs']))/(params['max_point_size']-params['min_point_size']))) depth = len(nlev) sep = (2.0*np.pi)/float(nlev[-1]) seps = [params['clade_sep']*sep/float(depth-i+1) for i in range(1,len(tree['nlev'])+1)] totseps = sum([s*nlev[i] for i,s in enumerate(seps[:-1])]) clade_sep_err = True if totseps > np.pi else False while totseps > np.pi: params['clade_sep'] *= 0.75 seps = [params['clade_sep']*sep/(float(depth-i+1)*0.25) for i in range(1,len(tree['nlev'])+1)] totseps = sum([s*nlev[i] for i,s in enumerate(seps[:-1])]) if clade_sep_err: print 'clade_sep parameter too large, lowered to',params['clade_sep'] fig = plt.figure(edgecolor=params['back_color'],facecolor=params['back_color']) ax = fig.add_subplot(111, polar=True, frame_on=False,facecolor=params['back_color'] ) # axis_bgcolor 修改为 facecolor #ax = fig.add_subplot(111, polar=True, frame_on=False, axis_bgcolor=params['back_color'] )