====抗性基因与物种注释的相对丰度相关性分析==== {{:个性化条目:图片7.png?400|}} {{:个性化条目:图片8.png?400|}} 脚本:/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 结果: {{:个性化条目:图片9.png?400|}} 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))