From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Tue May 07 2013 - 00:47:33 CDT
Hi Izhar,
the script looks ok so far. The only thing I noticed is a missing bracket,
but I guess it's just in the mail.
foreach segid $seglist resid $reslist { <-- bracket missing???
delatom $segid $resid
}
Additionally, you could simply check the lengths of the lists to see where
the error occurs, I guess it's llength. Also you didn't mention if the psf
has too less atoms or the DCD too much. What's the output of :
llength [[atomselect top protein] get index]
Norman Geist.
> -----Ursprüngliche Nachricht-----
> Von: owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] Im
> Auftrag von Izhar Karbat
> Gesendet: Dienstag, 7. Mai 2013 00:19
> An: namd-l_at_ks.uiuc.edu
> Betreff: namd-l: catdcd output and .psf file atom count mismatch
>
> Hi all.
>
> I'm dealing with a long trajectory of a membrane embedded protein
> complex, divided between 3 separate DCD files. for the sake of
> analysis, i would like to extract only the protein coordinates(
> discarding the lipids/water/ions etc .) into a single DCD that would
> contain the entire trajectory. Reading previous posts on this subject i
> have used the following piece of code, which generates an index file
> containing the protein atom indexes (findexfile.ind), and a PSF
> containing these atoms only (complex_prot.psf ).
>
>
> ******************************
> package require psfgen
> topology ../../../top_all27_prot_lipid.rtf
>
>
>
> readpsf ../complex_popcwi.psf
> coordpdb ../complex_popcwi.pdb
>
> mol load psf ../complex_popcwi.psf pdb ../complex_popcwi.pdb
>
> set all [atomselect top all]
> $all set beta 0
> set sel1 [atomselect top "protein"]
>
> set indices [$sel1 get index]
>
> set file [open findexfile.ind w]
> foreach i $indices {
> puts $file $i
> set sel [atomselect top "index $i"]
> $sel set beta 1
> }
>
> flush $file
> close $file
>
> set NotProtein [atomselect top "beta = 0"]
>
> set seglist [$NotProtein get segid]
> set reslist [$NotProtein get resid]
>
> foreach segid $seglist resid $reslist
> delatom $segid $resid
> }
>
> writepsf complex_prot.psf
> *******************************
>
> The call to catdcd is as follows :
>
> ./catdcd -o protein_trajectory.dcd -i findexfile.ind complex_popcwieq-
> 04.dcd complex_popcwieq-05.dcd complex_popcwieq-06.dcd
>
>
> the script prepares the two files at the very same loop, first writing
> the atom index to findexfile.ind, and then mark it for preservation for
> the PSF file.
> Yet, when trying to load the resulting trajectory with the
> complex_prot.psf protein structure file, i get the following error :
>
>
> ERROR) BaseMolecule: attempt to init atoms while structure building in
> progress!
> ERROR) Invalid number of atoms in file: 7689
>
> indeed, the .psf contains only 7677 atoms.
>
> it is unclear to me what could be the source to this discrepancy (so
> basically i am stuck :( ).
> any help would be highly appreciated.
This archive was generated by hypermail 2.1.6 : Tue Dec 31 2013 - 23:23:13 CST