- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试运行以下 Tcl 脚本并收到错误:错误 # args: should be "set varName ?newValue?"
这是什么意思?
注意:该脚本包含特定于 VMD 程序的术语,例如 mol 和 resid。请忽略它们。
#count water molecules between chain A and chain C or between #chain B and chain C
set input_file [open ./name_3_pdb_chain_renamed.dat r]
set data [read $input_file]
set data [split $data "\n"]
close $input_file
set chain_list [lindex $data 0]
cd 7_count_water
set outfile [open count_water3.dat w]
set chain_compare ""
set pdblen [llength $chain_list]
for {set i 0} {$i<$pdblen} {incr i} {
set pid [lindex [lindex $chain_list $i] 0]
set len [llength [lindex $chain_list $i]]
mol load pdb ../2_chain_rename/${pid}_chain_revised.pdb
mol modstyle 0 top NewCartoon
if {$len==4} {
set chain_compare [lappend chain_compare $pid]
}
set 11 [atomselect top all]
set mid [$11 molid]
mol delete $mid
}
set lll [llength $chain_compare]
for {set j 0} {$j< $lll} {incr j} {
set pid [lindex $chain_compare $j]
mol load pdb ../2_chain_rename/${pid}_chain_revised.pdb
set 11 [atomselect top "chain A and name CA"]
set res_len [llength [$11 get resid]]
set res_id [$11 get resid]
#residue length for chain C
set ag [atomselect top "chain C and name CA"]
set ag_len [llength [$ag get resid]]
set ag_id [$ag get resid]
#loop water between chain A and chain C
for {set k 0} {$k<$res_len} {incr k} {
set water_around_a [atomselect top "{resname HOH and {within 5.0 of {chain A and resid [lindex $res_id $k]} and {within 5.0 of chain C}}} "]
set water_around_a_resid [$water_around_a get resid]
set water_around_a_resname [$water_around_a get resname]
#loop antigen residues around water
for {set g 0} {$g < $ag_len} {incr g} {
set ag_around_water [atomselect top "{chain C and resid [lindex $ag_id $g] and {within 5.0 of {resname HOH and {within 5.0 of {chain A and resid [lindex $res_id $k]}}}}} "]
set ag_around_water resid [$ag_around_water get resid]
set ag_around_water_resname [$ag_around_water get resname]
puts $outfile "$pid [lindex $res_id $k] [lindex [$11 get resname] $k] $ag_around_water_resname A: $water_around_a_resname"
}
}
set b11 [atomselect top "chain B and name CA"]
set b_res_len [llength [$b11 get resid]]
set b_res_id [$b11 get resid]
#residue length for chain C
set ag [atomselect top "chain C and name CA"]
set ag_len [llength [$ag get resid]]
set ag_id [$ag get resid]
for {set k 0} {$k<$res_len} {incr k} {
set water_around_b [atomselect top "{resname HOH and {within 5.0 of {chain B and resid [lindex $b_res_id $k]} and {within 5.0 of chain C}}} "]
set water_around_b_resid [$water_around_b get resid]
set water_around_b_resname [$water_around_b get resname]
#loop antigen residues around water
for {set g 0} {$g < $ag_len} {incr g} {
set ag_around_water [atomselect top "{chain C and resid [lindex $ag_id $g] and {within 5.0 of {resname HOH and {within 5.0 of {chain B and resid [lindex $b_res_id $k]}}}}} "]
set ag_around_water resid [$ag_around_water get resid]
set ag_around_water_resname [$ag_around_water get resname]
puts $outfile "$pid [lindex $b_res_id $k] [lindex [$b11 get resname] $k] $ag_around_water_resname A: $water_around_b_resname"
}
}
}
close $outfile
cd ..
谢谢
最佳答案
那条消息:
wrong # args: should be "set varName ?newValue?"
is a standard error thrown when a built-in command gets the wrong number of arguments to evaluate. In this case, it's coming from the set
command, and indicates that you've either said set
on its own, or given more than two further arguments to it.
If you examine the stack trace (usually printed with the error message when using standard tclsh
, though it's changeable with user code) then you'll get told where the problem happened. However, in this case we can look through and see that this line near the bottom of the script:
set ag_around_water resid [$ag_around_water get resid]
变量名中有一个空格而不是下划线。现在,空格 在变量名中是合法的,但是变量名需要被引用,这会有点烦人。通常最好避免这样使用它们。没有引用,Tcl 不知道那是一个词。通用解析层决定那里确实有四个单词(set
、ag_around_water
、resid
和复杂的 [$ag_around_water get resid]
) 并告诉 set
处理它,它不喜欢。
记住,Tcl 的通用句法解析首先发生,然后命令参数被语义解释。 总是。
关于unix - Tcl 错误 : wrong # args: should be "set varName ?newValue?",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34095529/
我在工作中继承了一个C++项目,它是一个最初为Windows XP编写的应用程序,用于在心理实验中呈现视觉刺激。我无法在此处找出检查控制文件中语法错误的这一行: else if((m_SectorSw
这个问题已经有答案了: Difference between this and var in a function (5 个回答) What is the scope of variables in
这有什么区别: if( varName != NULL ){ // Do something } 还有: if( varName ){ // Do something } 我的意思是,处理速度
我有一个简单的问题,但我想知道 ${varname} 和有什么区别和 $varname ? 我两者都使用,但我看不出有什么区别可以告诉我何时使用其中之一。 最佳答案 使用 {} in 变量名有助于在执
该函数尚未完成,但我想知道拥有一个以这种方式更改变量的函数有多“安全”。 我正在使用具有实用功能的 Angular 服务,context是来 self 调用该函数的组件的this,其余的应该是不言自明
在我的 .h 中,我有一个变量,Texture ** skyboxTextures。我在一种方法中分配了一些纹理指针,并立即使用它们: Texture *skt[] = { tleft,
像这样声明数组有什么区别吗 int[] array = new int[10]; 并像这样声明 int array[] = new int[10]; ? 两者在 Java 中都有效,但我没有发现任何差
目标 阻止 Cloud9 IDE 给我警告消息。 背景 我正在使用 Cloud9 IDE 编写 JavaScript,无论我在哪里使用另一个文件(在同一文件夹中)的类,我都会收到警告消息: VarNa
var testvar = 'boat'; function testA() { console.log(testvar); } function testB() { console.
在 JavaScript 中,为什么以下两者都返回 true? > var a; undefined > "a" in window; true > a in window; true 是否存在某种类
经典 C 中的 float* varname 和 float *varname 有什么区别? 最佳答案 格式化。就是这样。他们的意思是一样的。 你把空间放在哪里(或者如果你有一个,真的)是一个偏好问题
使用以下数据框(类似于我的数据,但小得多): id 1 2 2 No 5 Yes 3 2 3 3 Yes 4 Yes 3
有人可以向我解释一下这段代码吗? a, b, c, d, *e = map(int, input().split()) 为什么这样做有效?星号运算符在这里到底扮演什么角色? 我知道它会在 d 之后创建
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: casting unused return values to void C++ What is the p
我只是写了一个 htaccess 文件和一个简单的规则。 RewriteRule ^/?([a-z]{2})/([0-9]{4})/?$ /run/run.php?country=$1&year=$2
在 PHP 中,我可以执行以下操作: $myVar = 'name'; print $myClass->$myVar; // Identical to $myClass->name 我想用 Pytho
我有一个像这样的 JavaScript 类: function Foo() { this.x = 5; this.y = x + 10; } 当我不使用“.this”时,“x”的作用域是否不会
我有一长组 div,当有人单击带有级联延迟的“主页”按钮时(我稍后会添加),我想将它们的所有背景颜色更改为随机颜色。我一直在 jfiddle 中对此进行测试,但似乎无法让它工作。 例如,在 jsfid
这个问题在这里已经有了答案: What is the difference between a function expression vs declaration in JavaScript? [
这个问题已经有答案了: Declaring variables without var keyword (8 个回答) 已关闭 6 年前。 我刚刚遇到了一个我以前从未见过的约定: window.the
我是一名优秀的程序员,十分优秀!