尝试在 lua 文件中替换参数时出现问题

我之前从未用过 lua 编程,但我必须运行一段用 lua 语言编写的程序包。这个包是一个命令行 linux 接口,我不需要了解 lua 编程。在这个包中,我只需要用自己的地址和数据集或文件名替换 lua 文件中的一些地址,就能运行程序。但我在运行 lua 文件方面遇到了问题。在这个文件中,我用以下代码替换了代码段:

dofile 'Csv.lua'

local proteinFile = Csv(opt.dataset..".node","r")
local proteinString = proteinFile:readall()

ppFeature = {}
pNumber = {}

for i=1, #proteinString do

local fileName = opt.dataset..'/'..proteinString[i][1]

if file_exists( fileName ) then

local proFile = Csv( fileName, 'r', '\t')
local profile = proFile:readall()

使用以下代码替换了上面的代码段:

dofile 'Csv.lua'

local proteinFile = Csv("/storage/users/ssalmanian/DPPI/myTrain.node","r")
local proteinString = proteinFile:readall()

ppFeature = {}
pNumber = {}

for i=1, #proteinString do

local fileName = '/storage/users/ssalmanian/DPPI/myTrain/proteinString[i][1]'

if file_exists( fileName ) then

local proFile = Csv( fileName, 'r', '\t')
local profile = proFile:readall()

然后我得到了错误。 在运行命令之前必须有一个文件和一个名称与数据集相同的文件夹:

A)文件的后缀名是‘.node’(myTrain.node)。此文件有一列,其中包含所有蛋白质的名称。

B) 具有与 -dataset 相同名称的 Profile 文件夹(myTrain)。此文件夹包含所有蛋白质的概要文件。

此文件夹中概要文件的名称与‘.node’文件中的蛋白质名称相同。

我想知道哪里出错了,哪段代码必须用以下代码替换:

local fileName = opt.dataset..'/'..proteinString[i][1]

谢谢。

编辑:

该程序包是DPPI包,我尝试通过以下命令在 CUDA 服务器上运行 creat_crop.lua 代码,以创建两个文件 myTrain_profile_crop_512.t7 和 myTrain_number_crop_512.t7 :

th creat_crop.lua -dataset myTrain

creat_crop.lua 代码依赖于调用 Csv.lua 代码,并需要 myTrain.node 文件和 myTrain 文件夹。这里我添加了我的 WinSCP 页面 WinSCP page 和我得到的错误 Error message

点赞