Re: [AMBER] how to obtain index of atoms based on residue and atom masks

From: Ming Tang <m21.tang.qut.edu.au>
Date: Thu, 20 Jan 2022 05:35:31 +0000

Hi Matthew, this is helpful. Thanks

-----Original Message-----
From: Matthew Guberman-Pfeffer <matthew.guberman-pfeffer.uconn.edu>
Sent: Wednesday, 19 January 2022 1:13 PM
To: AMBER Mailing List <amber.ambermd.org>
Subject: Re: [AMBER] how to obtain index of atoms based on residue and atom masks

Hello Tammy,

One thought is that you can use the mask keyword in cpptraj to generate a file. This file, call it mask.txt, will list the atom numbers in the second column. You then can process this file with a bash script to get a comma separated list, something like the following:

idx=0
while IFS= read -r F1 <&2;do

  if [ $idx != 0 ];then
    atnum=$(echo $F1 | awk '{print $2}')
    echo -n “${atnum},";
  fi

  idx=$((idx+1))
done 2< mask.txt

Note that the line indexing (idx) is to skip the “AtomNum” header in mask.txt.

Hope this work-around helps.

Best,
Matthew

 

> On Jan 18, 2022, at 8:01 PM, Ming Tang <m21.tang.qut.edu.au> wrote:
>
> *Message sent from a system outside of UConn.*
>
>
> Dear list,
>
> Is there a command to print out atom indexes (separated by comma) for a large number of residues? I want to use them as cv_i in ABMD.
>
> Thanks,
> Tammy
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> https://urldefense.com/v3/__https://nam10.safelinks.protection.outlook.com/?url=http*3A*2F*2Flists.ambermd.org*2Fmailman*2Flistinfo*2Famber&amp;data=04*7C01*7C*7Ca3db9972ee9c4966acc508d9dae759ff*7C17f1a87e2a254eaab9df9d439034b080*7C0*7C0*7C637781509453316189*7CUnknown*7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0*3D*7C2000&amp;sdata=o3k7Hiee*2BYZzNqzGNTdf1m25ArVSsRCTXDG9VnQvBiI*3D&amp;reserved=0__;JSUlJSUlJSUlJSUlJSUlJSUlJQ!!NVzLfOphnbDXSw!X-NTRkZWiJ_wMNAs7TzoeYa32WsFDUOy-YcIuQSIe6g5tLVTxh1aMQ-bsvyAgeqPgKLw$


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
https://urldefense.com/v3/__http://lists.ambermd.org/mailman/listinfo/amber__;!!NVzLfOphnbDXSw!X-NTRkZWiJ_wMNAs7TzoeYa32WsFDUOy-YcIuQSIe6g5tLVTxh1aMQ-bsvyAgU8eSfPr$
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Jan 19 2022 - 22:00:02 PST
Custom Search