python脚本在compute node和head nod中提供不同的输出

2024-05-15 07:53:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我编写了一个python包装器脚本,从命令行调用算法。称为vcftools.的算法的名称

在vcftools中,使用当前命令行,它应该创建日志文件和结果文件。你知道吗

当我在python的头部运行脚本时,它就运行良好。但是当我发送到队列系统以便在集群中运行时,它会产生一个错误

IOError: [Errno 2] No such file or directory: './final/PRAD-US/DO36253/final.9e272bea-9193-4c10-a802-f7e18b2937a3.snv_mnv_dkfz.log'

但是当我在headnode中运行这个时,就像我在没有生成错误之前所说的。但它按预期创建了结果文件。所以只有日志文件丢失了。你知道吗

为了不分散线程的注意力,我只分享了一行称为vcf工具的代码。你知道吗

vcf_isolation_bash_script=["/mnt/kufs/scratch/tmorova15/softwares/vcftools_0.1.13/bin/vcftools","--gzvcf", output_directory+ 'annotated_full.' + analysis_id+'.snv_mnv_'+analysis_method, "--bed" ,  bed_file_input , "--recode" ,"--recode-INFO-all", "--out", output_directory + "final." + analysis_id + ".snv_mnv_" + analysis_method ]
r1=subprocess.check_call(' '.join(vcf_isolation_bash_script),shell=True)

这个问题的原因是什么?为了更清楚地了解我的术语,headnode意味着我直接通过终端运行脚本,而在compute node中,我使用一个队列文件,我必须指定所有内容(python路径等)

谢谢你的帮助

最好的, Tunc公司。你知道吗

编辑:更清楚地说

output_directory = './final/%s/%s/' % (folder_prefix[folder][1],folder_prefix[folder][0])

总体结构如下

Top directory
-final/
--final.patientid.resultfile
--final.patientid.log 
-input/
--Contains all the input files 

编辑2:更新

脚本中的路径是正确的。你知道吗

-我们在headnode中运行了脚本,并按预期给出了输出

-我们使用qsub文件运行脚本(发送到计算节点)我们最终会遇到当前问题,但是如果我们登录这些计算节点并使用相同的导出行运行脚本,代码本身就会按预期工作。你知道吗

我们的系统中有sungrid排队系统,所以我认为它与文件系统有关。你知道吗


Tags: 文件命令行脚本inputoutput系统analysisfolder