From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Fri Apr 11 2014 - 10:29:18 CDT

Hi Ashish,

If you are just trying to make a pdb-formatted file out of this,
literally all you need to do is:

set all [atomselect top "all"]
$all writepdb filename.pdb

I'm not familiar with the file format you are using. What do the first
two columns and last three columns mean? What does VMD think the fields
mean (ie, if you go to the graphical representations window, what are
the values associated with each keyword)? You haven't given me (or
anyone else) enough information to help you effectively. My advice would
be to play around with the graphical representations, and try to play
around with the atomselections to separate the two types of atoms. The
easiest way to do this would probably be to look at the keyword-value
pairs (under the "selections" tab of the graphical representations
window), and determine which keywords/values pick between Copper and not
copper atoms.

Good luck!
-Josh Vermaas

On 04/11/2014 10:17 AM, Ashish .Chauniyal wrote:
> Dear Josh,
> I was having some problem with the usage of the 'atomselect' command
> and wonder if you could suggest something as you in your previous
> post. I am a little confused with the explaination given in the user
> guide regarding atomselect.
>
> I have a file containing 2 types of atoms and their coordinates.
> given below <Atomid> <type><x><y><z>.
>
> Atoms
>
> 4003 2 -3.6948671457303270e+01 -8.2178357941409985e+01
> -1.0333348401063144e+01 0 0 1
> 807 1 -3.6990060733492541e+01 -8.0262837680770645e+01
> -8.2698926717344481e+00 0 0 0
> 1 1 -4.1360378365219930e+01 -8.0595341475920435e+01
> -1.1523945200048335e+01 0 0 0
> 85 2 -3.8964145243144991e+01 -7.9837065660776460e+01
> -1.0375438044916475e+01 0 0 0
> ........
>
>
> I just need to read the file an make a .pdb format out of it.
>
> ## this is part of the code, where i try to read only type 1 atoms, is
> this correct?
> set selc [atomselect top "resid 1"]
> $selc set type Cu
> $selc set resname PPP
>
> set resid {}
> foreach r [$selc get residue] {
> incr r
> lappend resid $r
> }
> $selc set resid $resid
> $selc delete
>
>
> Thanks in advance,
>
> regards,
> Ashish Chauniyal
> Deptt. Mechanical Engg.
> BITS Pilani(INDIA)
>
>
> On Fri, Apr 11, 2014 at 7:58 PM, Josh Vermaas <vermaas2_at_illinois.edu
> <mailto:vermaas2_at_illinois.edu>> wrote:
>
> Hi Vlad,
>
> It is certainly doable, but requires some bookkeeping on your end.
> If you look at the user guide, the measure fit command takes an
> optional argument:
> *fit /selection1/ /selection2/ [weight /weight/] [order /index list/]*
> Again taken from the user guide:
> The optional flag /order/ takes as argument a list of 0-based
> indices specifying how to reorder the atoms in /selection2/
> (Example: To reverse the order of atoms in a selection containing
> 10 atoms one would use order {9 8 7 6 5 4 3 2 1 0}).
>
> I've never needed to use this feature so far, but what I believe
> you'd need to do is make an index list that puts them into the
> order you want. This is an outline to get you started:
>
> set indexlist [list ]
>
> foreach resid [list 8 9 10] {
> set sel [atomselect 2 "resid $resid"]
> #To figure out how big the offset needs to be, we need to know
> how many atoms in the selection are out of order before us.
> set abovesel [atomselect 2 "resid 8 9 10 and resid > $resid"]
> set counter 0
> foreach el [$sel get index] {
> lappend indexlist [expr { [$abovesel num] + $counter] } ]
> incr counter
> }
> $abovesel delete
> $sel delete
> }
>
> The reason you have to do these gymnastics is because VMD stores
> atoms in the order they were loaded, and decides if an atom is
> inside or outside of an atomselection following this order. This
> is why if you ever tried an atomselection like "resid 11 1", it
> will return indices that are in increasing order, rather than
> returning the indices belonging to residue 11 then those belonging
> to residue 1.
>
> -Josh Vermaas
>
>
>
>
> On 04/11/2014 07:16 AM, Vlad Cojocaru wrote:
>> Dear all,
>>
>> I have a rather simple question but for which I did no figure an
>> answer yet ... I have 2 DNA molecules which I want to superimpose.
>> The superposition should be done like this:
>>
>> res 1 from mol 1 on res 10 from mol 2,
>> res 2 from mol 1 on res 9 from mol 2,
>> res 3 from mol 1 on res 8 from mol2,
>>
>> .. and so on ...
>>
>> If I do the selections "resid 1 to 3" and "resid 10 to 8", it
>> does not work as VMD tries to superimpose 1 on 8, 2 on 9, and 3
>> on 10.
>> I also tried to change the residue numbers in mol 2 such as res
>> 10 becomes res 100, res 9 becomes res 101, res 8 becomes res 102
>> (to have ascending order). However, still no success, VMD does
>> not care about the residue number, it still tries the same. ...
>>
>> Do I need to change all atom indices to actually make VMD
>> superimpose the way I want ? Or is there an easier solution to
>> this ?
>>
>> Thanks for any advice ..
>>
>> Best wishes
>> Vlad
>>
>>
>
>