Re: Re: psf creating for carbon nanotube

From: Jian Liu (bay__gulf618_at_sina.com)
Date: Mon Aug 16 2010 - 00:23:54 CDT

Dear Sara
First, this script should be saved in "Plain Text", any modify is unneedful.
This script file is also attached in this email.

After source this script, you can access the new command "nanotube2" in the following way
nanotube2 19.54 8 2 (8,2)CNT

It is not necessary to prepare the topology file contain miscellaneous bonding information.
Alternatively, if distance between two atoms is less than 1.8 Ang, a bond will be created by PATCH

I hope you can enjoy it

------------------------------------------------
Jian Liu
Master-degree Graduate Candidate Majoring in Molecular Modelling
Outstanding Students and PhD. Wanted, CV: http://is.gd/ducip

----- Original Message -----
From: sara <sara_15_s_at_yahoo.com>
To: Jian Liu <bay__gulf618_at_sina.com>
Subject: Re: namd-l: psf creating for carbon nanotube
Date: 2010-8-16 13:00:43

Hi Dear Jian Liu
 
I tested the psfgen you sent but it didn't work and said:
 
 
invalid command name "\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fcharset0 Times New Roman;}{\f1\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1515;}\viewkind4\uc1\pard\sb100\sa100\f0\fs24 # Tcl Script for Preparing pdb/psf of SWNT\line # Programed by bay <bay__gulf618 at sina dot com> on June 22, 2010\line # Usage: nanotube2 <l> <n> <m> [<output>] after source this script\line\line package require nanotube\line package require psfgen\line proc writetop \{\{op ""\}\} \{\line if \{$op=="del"\} \{\line file delete tmp.top\line\} else \{\line set fz [open "tmp.top" w]\line puts $fz "* >>> Top File for C Cluster<<< "\line puts $fz "0 1 "\line puts $fz "MASS 21 CA 12.01100 C \\n "\line puts $fz "RESI CNT 0.00 "\line puts $fz "GROUP "\line puts $fz "ATOM C CA 0.00 \\n "\line puts $fz "PRES LINC 0.00 "\line puts $fz "BOND 1C 2C
 \\n "\line puts $fz "END "\line close $fz\line\}\line\}\line\line proc nanotube2 \{19.54 8 2 \{(8,2)CNT nanotube\}\} \{\line nanotube -l $length -n $n -m $m\line set sel1 [atomselect top all]\line $sel1 set resid [$sel1 get index]\line $sel1 write(2,8) CNT tmp1.pdb\line\line writetop\line resetpsf\line topology tmp.top\line segment CCC \{(2,8) CNT tmp1.pdb\}\line set xyz [$sel1 get \{x y z\}]\line foreach c1 [$sel1 get resid] \{\line foreach c2 [$sel1 get resid] \{\line set dist [vecdist [lindex $xyz $c1] [lindex $xyz $c2]]\line if \{$c1 < $c2 && $dist < 1.8\} \{\line patch LINC CCC:$c1 CCC:$c2\line\}\line\}\line\}\line coordpdb tmp1.pdb CCC\line regenerate angles dihedrals\line writepdb $\{(2,8) CNT\}.pdb\line writepsf $\{(2,8) CNT\}.psf\line\line writetop del\line\}\line\par
\pard\f1\fs20\par
 
ofcourse I changed some terms of this file.see please:
 
# Tcl Script for Preparing pdb/psf of SWNT
# Programed by bay <bay__gulf618 at sina dot com> on June 22, 2010
# Usage: nanotube2 <l> <n> <m> [<output>] after source this script

package require nanotube
package require psfgen
proc writetop {{op ""}} {
if {$op=="del"} {
file delete tmp.top
} else {
set fz [open "tmp.top" w]
puts $fz "* >>> Top File for C Cluster<<< "
puts $fz "0 1 "
puts $fz "MASS 21 CA 12.01100 C \n "
puts $fz "RESI CNT 0.00 "
puts $fz "GROUP "
puts $fz "ATOM C CA 0.00 \n "
puts $fz "PRES LINC 0.00 "
puts $fz "BOND 1C 2C \n "
puts $fz "END "
close $fz
}
}

proc nanotube2 {19.54 8 2 {(8,2)CNT nanotube}} {
nanotube -l $length -n $n -m $m
set sel1 [atomselect top all]
$sel1 set resid [$sel1 get index]
$sel1 write(2,8) CNT tmp1.pdb

writetop
resetpsf
topology tmp.top
segment CCC {(2,8) CNT
 tmp1.pdb}
set xyz [$sel1 get {x y z}]
foreach c1 [$sel1 get resid] {
foreach c2 [$sel1 get resid] {
set dist [vecdist [lindex $xyz $c1] [lindex $xyz $c2]]
if {$c1 < $c2 && $dist < 1.8} {
patch LINC CCC:$c1 CCC:$c2
}
}
}
coordpdb tmp1.pdb CCC
regenerate angles dihedrals
writepdb ${(2,8) CNT}.pdb
writepsf ${(2,8) CNT}.psf

writetop del
}

 
 
because my pdb name is (8,2) CNT.I saved this file .pgn format. Are these changes needfull? or I have to do any other changes? please guid me.
 
thanks alot

Sara








      


This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:54:25 CST