From: Ashar Malik (asharjm_at_gmail.com)
Date: Tue Dec 12 2017 - 21:41:31 CST

I am not sure what you want to achieve.

chain A and resname XXX --- will only select resname XXX
chain A or resname XXX --- select all of chain A and all residues resnames
XXX (not sure if this would double your selection if resname XXX is already
included in the selection of chain A)

is resname XXX covalantly linked to chain A?

if you want to measure a quantity (say energy) between everything in chain
A and resname XXX and if resname XXX is also labelled as chain A then you
should use

selection - 1:: chain A and not resname XXX
                   # This will select everything in chain A excluding
resname XXX
selection - 2:: resname XXX
                             # Will only select resname XXX

You should only use the above if you are absolutely sure there is only one
residue labelled resname XXX cause if you have multiple you will still get
an answer - but I am not sure what I would make of it.

On Wed, Dec 13, 2017 at 4:04 PM, jrhau lung <jrhaulung_at_gmail.com> wrote:

> Dear Ashar:
> Thanks for your hint. Yes, the complex contains only one ligand.
> And I realize that using "and" in selection need both selected parts are
> true.
>
> Instead of using "and", input "chain A or resname XXX" in selection 1
> and "chain B" in selection 2 works.
> But I guess the nonbond energy between chain A and ligand XXX is still
> missing.
>
> sincerely
>
> Jrhau
>
> 2017-12-12 22:43 GMT+08:00 Ashar Malik <asharjm_at_gmail.com>:
>
>> Just to add to this, your original question reads:
>>
>> ... which contains two protein subunits (chain A and chain B. A and B
>> also interact each other) and *"**a"* ligand (resname 711 and located in
>> the middle of the complex and *contact with both chain A and B*) ...
>>
>> This to me sounds like you have just one thing by the name of resname of
>> 711.
>>
>> However when you type in:
>>
>> "chain A and resname 711" in selection 1 and "chain B and resname 711"
>>
>> you are looking for two 711s one in each chain A and B. The error of no
>> atom in selection appears to suggest that while you have a 711 :: protein
>> ~ 711 = -40 kcal/mol there is just one of this (as understood from your
>> original question.
>>
>> set sel [atomselect top "resname 711"]
>> $sel get chain
>>
>> Only if the second line returns A and B should you expect an answer from
>> ::
>>
>> Input "chain A and resname 711" in selection 1 and "chain B and resname
>> 711" in selection 2
>>
>> On Wed, Dec 13, 2017 at 2:25 AM, Peter Freddolino <petefred_at_umich.edu>
>> wrote:
>>
>>> I'm sorry, but this doesn't seem to make sense:
>>> " If chain A and chain B do not both have residues with this name, input
>>> "chain A" in selection 1 and "chain B" in selection 2 should get same error
>>> message as
>>> when input "chain A and resname 711" in selection 1 and "chain B and
>>> resname 711". "
>>>
>>> Why would that be? If chain A and chain B each have many atoms, but none
>>> are resname 711 (which is a very odd residue name), then you would get
>>> normal results for the first case, but things would not work for the
>>> second. Perhaps you could double check what the chain names are for all of
>>> the residues in your system? Perhaps
>>> set sel [atomselect top all]
>>> lsort -unique [$sel get {chain resname resid}]
>>>
>>>
>>> On Tue, Dec 12, 2017 at 2:13 AM, jrhau lung <jrhaulung_at_gmail.com> wrote:
>>>
>>>> Dear Giocomo:
>>>> Thanks for your advice.
>>>> The protein complex only contains 250 residues, including the
>>>> ligand 711. The "resname 711" should be correct for the analysis.
>>>> If chain A and chain B do not both have residues with this name,
>>>> input "chain A" in selection 1 and "chain B" in selection 2 should get
>>>> same error message as
>>>> when input "chain A and resname 711" in selection 1 and "chain B and
>>>> resname 711".
>>>>
>>>> Continue struggling.
>>>>
>>>> sincerely,
>>>> Jrhau
>>>>
>>>> 2017-12-12 11:51 GMT+08:00 Giacomo Fiorin <giacomo.fiorin_at_gmail.com>:
>>>>
>>>>> Perhaps chain A and chain B do not both have residues with this name?
>>>>> Also, are you sure that you are not interchanging "resname" with "resid"?
>>>>>
>>>>> On Mon, Dec 11, 2017 at 9:52 PM, jrhau lung <jrhaulung_at_gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Dear João and VMD friends:
>>>>>>
>>>>>> I would like to calculate the nonbond energy of a protein
>>>>>> complex, which contains two protein subunits (chain A and chain B. A
>>>>>> and B also interact each other) and a ligand (resname 711 and
>>>>>> located in the middle of the complex and contact with both chain A and B)
>>>>>> using NAMDenergy plugin. What should I input in selection 1 and selection 2
>>>>>> to let result return in one calculation run. Thanks for any help.
>>>>>>
>>>>>> Input "protein" in selection 1 and "resname 711" in selection 2 got ~
>>>>>> -40 kcal/mol
>>>>>> Input "chain A" in selection 1 and "chain B" in selection 2 got ~
>>>>>> -300 kcal/mol
>>>>>> Input "chain A and resname 711" in selection 1 and "chain B and
>>>>>> resname 711" in selection 2 returned a error message "both selection
>>>>>> must contain at least one atom"
>>>>>>
>>>>>>
>>>>>> sincerely,
>>>>>>
>>>>>> Jrhau
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Giacomo Fiorin
>>>>> Associate Professor of Research, Temple University, Philadelphia, PA
>>>>> Contractor, National Institutes of Health, Bethesda, MD
>>>>> http://goo.gl/Q3TBQU
>>>>> https://github.com/giacomofiorin
>>>>>
>>>>
>>>>
>>>
>>
>>
>> --
>> Best,
>> /A
>>
>
>

-- 
Best,
/A