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

From: Matthew Guberman-Pfeffer <matthew.guberman-pfeffer.uconn.edu>
Date: Tue, 18 Jan 2022 22:12:31 -0500

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://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


_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue Jan 18 2022 - 19:30:02 PST
Custom Search