Page 1 of 4 1 2 3 4 >
Topic Options
#186 - 10/23/03 05:24 AM Sample scripts for basic tasks in CHARMM
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
I have posted a handful CHARMM input files, each as a separate thread. This is the README file for the collection.

This is a set of CHARMM sample input files for some basic tasks, put together
from files that have been used for several years in the lab, and some newly
created scripts.

You can get a tar-file containing all these files from
www.biosci.ki.se/md/charmm.html
All individual files have been posted to the Script Archive Forum at
www.charmm.org

The *.inp files are standalone scripts and may need editing to suit your
specific system, although some of them can actually be run directly with the
data files that are also included.
The *.str files should be streamed to from your input file (some of the
sample .inp files do this), and could be used as they are.

Most files require that unix environment variables CHM_HOME (pointing to
the CHARMM installation directory) and CHM_STREAM (pointing to the directory
where these files are located) are defined.

The scripts are only supposed to be a reasonable help to get started using
CHARMM - you have to know your system and make the scientific decisions
about it.

Most of the scripts have been tested for CHARMM typos and technical
correctness and should run with c27 or newer, but please report anomalies,
comments o r suggestions to

Lennart.Nilsson@biosci.ki.se

Stockholm, October 2003 (First edition)

SETUP
add-ions.str
gen-alpha-helix.inp
gen-dna.inp
gen-prot.inp
minimize.inp
rename-2pdb.str
setup-truncated-octahedron.str
solvent-box.str
solvent-shell.str
solvent-sphere.str

DYNAMICS
dynamics.inp
noe-dynamics.inp
run-cpt-md.inp
run-pbc-md.inp
run-sdb-md.inp

ANALYSIS
asa-protein.str
extract-coordinate-frame.inp
hbonds.inp
interaction-energy.inp
merge-orient-trajectory.inp
merge-recenter-trajectory.inp
rmsd-nucleotide.str
rmsd-residue.str
rmsd-rgyr.inp
rmsf-nucleotide.str
rmsf-residue.str
self-diffusion-coeff.inp
trp-anisotropy.inp

There is also a small set of auxiliary (data) files.
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top
#187 - 10/20/04 09:31 PM Re: Sample scripts for basic tasks in CHARMM [Re: lennart]
Edo Offline
Forum Member

Registered: 08/31/04
Posts: 192
Hi Lennart,
I have a question about running your script "gen-prot.inp", which I downloaded from your website.

I define the environment variables as you recommend:
setenv CHM_HOME /v/estor1/home/charmm/c30b2/
setenv CHM_STREAM /v/estor3/home/usr/Temp/CHARMM_Tutorial/Scripts/

and run the script and get the following error:
CHARMM> open unit 21 read form name 4pti-a.pdb
VOPEN> Attempting to open::4pti-a.pdb::
OPNLGU> Unit 21 cannot be opened as 4PTI-A.PDB

***** LEVEL 0 WARNING FROM *****
***** "OPEN" not possible.
******************************************

The 4pti-a.pdb file definatley exists in the working directory:

m1~/Temp/CHARMM_Tutorial/Scripts/>ls 4pti-a.pdb
4pti-a.pdb

It appears that charmm is not looking in my current working directory, because I can fix this error (and get the file to open) by modifying the following line:

open unit 21 read form name 4pti-a.pdb

to

open unit 21 read form name "$CHM_STREAM/H4pti-a.pdb"

CHARMM> open unit 21 read form name "$CHM_STREAM/4pti-a.pdb"
VOPEN> Attempting to open::/v/estor3/home/usr/Temp/CHARMM_Tutorial/Scripts/4pti-a.pdb::
OPNLGU> Unit 21 opened for READONLY access to /v/estor3/home/usr/Temp/CHARMM_Tutorial/Scripts/4pti-a.pdb

My question is, how do I get CHARMM to automatically look into my current working directory (from which I call charmm and run the scripts) to open files? I would like to avoid having to give the absolute path of the input files each time.

Thanks,
Ed

Top
#188 - 10/21/04 02:29 AM Re: Sample scripts for basic tasks in CHARMM [Re: Edo]
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
CHARMM does read from the current directory - there is nothing you have to do about it.
The only way I could reproduce your problem was by removing read privilege from the file (chmod -r 4pti-a.pbd).
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top
#189 - 10/21/04 04:54 AM Re: Sample scripts for basic tasks in CHARMM [Re: Edo]
bogdan Offline
Forum Member

Registered: 02/16/04
Posts: 147
Loc: Heidelberg, Germany
Look at the difference between:
Quote:

CHARMM> open unit 21 read form name 4pti-a.pdb
VOPEN> Attempting to open::4pti-a.pdb::
OPNLGU> Unit 21 cannot be opened as 4PTI-A.PDB



and
Quote:

CHARMM> open unit 21 read form name "$CHM_STREAM/4pti-a.pdb"
VOPEN> Attempting to open::/v/estor3/home/usr/Temp/CHARMM_Tutorial/Scripts/4pti-a.pdb::
OPNLGU> Unit 21 opened for READONLY access to /v/estor3/home/usr/Temp/CHARMM_Tutorial/Scripts/4pti-a.pdb




In the first case, CHARMM translated the file name to all uppercase; I'm sure that running 'ls 4PTI-A.PDB' would return 'No such file or directory.'. Using the quotes, as in the second case, makes a difference...

Top
#190 - 10/21/04 05:21 AM Re: Sample scripts for basic tasks in CHARMM [Re: bogdan]
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
The double quotes are only necessary if the string is in mixed case.

These are the basic rules that CHARMM uses when opening a file:
1/If the filename is in double quotes, remove the quotes and use the string as is.
2/If there are no quotes, first convert the string to all lower case and try to open the file. If this fails convert the string to all upper case and try again. If this fails, issue error message.
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top
#191 - 10/21/04 09:20 AM Re: Sample scripts for basic tasks in CHARMM [Re: lennart]
Edo Offline
Forum Member

Registered: 08/31/04
Posts: 192
It appears the file is readable/writable

m1~/Temp/CHARMM_Tutorial/Scripts/>ls -ls *pdb
48 -rw------- 1 ed cbs 46656 Oct 23 2003 4pti-a.pdb
8 -rw------- 1 ed cbs 4861 Oct 23 2003 4pti-wat.pdb
20 -rw------- 1 ed cbs 19582 Oct 23 2003 atcg.pdb

so I don't think that is the problem.

I modified the permissions to let all users have read/write access
m1~/Temp/CHARMM_Tutorial/Scripts/>chmod a+rw 4pti-a.pdb
m1~/Temp/CHARMM_Tutorial/Scripts/>ls -ls *pdb
48 -rw-rw-rw- 1 ed cbs 46656 Oct 23 2003 4pti-a.pdb

I then rerun the original script, only to get the same error:
CHARMM> open unit 21 read form name 4pti-a.pdb
VOPEN> Attempting to open::4pti-a.pdb::
OPNLGU> Unit 21 cannot be opened as 4PTI-A.PDB

And Bogdan you are right, the capitalized form of the file does not exist:
m1~/Temp/CHARMM_Tutorial/Scripts/>ls 4PTI-A.PDB
ls: 4PTI-A.PDB: No such file or directory

Any other ideas what might be causing this problem?
Thanks for your help,
Ed

Top
#192 - 10/21/04 01:53 PM Re: Sample scripts for basic tasks in CHARMM [Re: Edo]
lennart Offline

Forum Member

Registered: 09/25/03
Posts: 4688
Loc: ~ 59N, 15E
Well, I cannot reproduce your problem.
What machine, OS and Fortran compiler are you using?

You can also check what your CHARMM thinks is the working directory, what files are in it, and if you can create a file there with a small CHARMM script:
* testing filenames
*
system "pwd"
system "ls -l"
open unit 21 write form name myfile.txt
stop
_________________________
Lennart Nilsson
Karolinska Institutet
Stockholm, Sweden

Top
#193 - 10/21/04 03:33 PM Re: Sample scripts for basic tasks in CHARMM [Re: Edo]
zhangxd68 Offline
Forum Member

Registered: 10/31/03
Posts: 39
try this

charmm<1.inp

the 1.inp is the following

* test
*
stream "inputfile"
stop

Top
#194 - 10/21/04 05:59 PM Re: Sample scripts for basic tasks in CHARMM [Re: zhangxd68]
Edo Offline
Forum Member

Registered: 08/31/04
Posts: 192
Hi,
I tried your suggestion, get the same error (see error below). Here are the different tests I've tried, only 'Test 3' works.

* test
*

! Test 0
!stream "4pti-a.pdb"
!stop

! Test 1
!open unit 21 read form name 4pti-a.pdb
!close unit 21

!Test 2
!open unit 21 read form name /v/estor3/home/usr/Temp/CHARMM_Tutorial/Scripts/4pti-a.pdb
!close unit 21

! Test 3
open unit 21 read form name "/v/estor3/home/usr/Temp/CHARMM_Tutorial/Scripts/4pti-a.pdb"
close unit 21

Here is my computer info:
Linux de6 2.4.21-4.ELsmp #1 SMP Fri Oct 3 17:52:56 EDT 2003 i686 i686 i386 GNU/Linux

I am running charmm version c30b2.

Ed

Here was the error message for 'Test 0':
CHARMM> ! Test 0
CHARMM> stream "4pti-a.pdb"
VOPEN> Attempting to open::4pti-a.pdb::
OPNLGU> Unit 99 cannot be opened as 4pti-a.pdb

***** LEVEL 0 WARNING FROM *****
***** "OPEN" not possible.
******************************************
BOMLEV ( 0) IS REACHED - TERMINATING. WRNLEV IS 5

Top
#195 - 10/21/04 06:00 PM Re: Sample scripts for basic tasks in CHARMM [Re: lennart]
Edo Offline
Forum Member

Registered: 08/31/04
Posts: 192
Lennart,
When I include the system calls in the script this is the output (before it dies).

CHARMM> system "pwd"
Invoking: pwd
/v/apps/charmm/c30b2

CHARMM> system "ls -l"
Invoking: ls -l

Regards,
Ed

Top
Page 1 of 4 1 2 3 4 >

Moderator:  chmgr, John Legato, petrella