用户工具

站点工具


个性化条目:抗性基因与物种注释的相对丰度相关性分析

抗性基因与物种注释的相对丰度相关性分析

脚本:/TJPROJ6/RNA_SH/script_dir/meta_coorr/getcorr.py

示例:

/TJPROJ6/RNA_SH/script_dir/meta_coor/run.sh

python getcorr.py –tax relative.o.xls –ARO stat.ARO.relative.xls –outdir /TJPROJ7/RNA_R/shouhou/script_dir/meta/coor

结果:

import os
import argparse
import sys
dir=os.getcwd()

SRC_DIR='/TJPROJ1/RNA_R/shouhou/script_dir/meta/coor'
sys.path.insert(0,SRC_DIR)


parser = argparse.ArgumentParser(description='Prediction of RNA\'s function.\nR function "corr.test" is applied to calculate the cor.')
parser.add_argument('--ARO',required=True,help='ARO file #stat.ARO.absolute.xls')
parser.add_argument('--tax',required=True,help='absolute.o.xls')
parser.add_argument('--outdir',required=False,help='ARO_tax.cortest.xls,ARO_tax_corlist')

argv=parser.parse_args()
try:
    output_dir = argv.outdir.strip()
except:
    output_dir = dir

tax =argv.tax.strip()
ARO=argv.ARO.strip()

ARO_total=output_dir +'/ARO_tax.cortest.xls'
ARO_diff=output_dir +'/ARO_tax_corlist'
if os.path.exists(ARO_total):
	os.system("rm %s" %(ARO_total))
if os.path.exists(ARO_diff):
	os.system("rm %s" %(ARO_diff))
os.system('%s/corr.R  --tax  %s --ARO %s --out1 %s --out2 %s ' %(SRC_DIR,tax,ARO,ARO_total,ARO_diff))
os.system('sed -i \'1i tax\\tARO\\tpearson_cor\\tFDR\'  %s' %(ARO_total))
os.system('sed -i \'1i tax\\tARO\\tpearson_cor\\tFDR\'  %s' %(ARO_diff))
os.system('cp %s/readme.txt %s' %(SRC_DIR,output_dir))
个性化条目/抗性基因与物种注释的相对丰度相关性分析.txt · 最后更改: 2023/03/16 09:42 由 fengjie