Project

General

Profile

Bug #580

Code modifications to add -tu option to g_hbond

Added by Justin Lemkul about 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

I made some slight modifications to g_hbond such that it prints a correct x-axis legend (with time unit), and I added the -tu option that many of the analysis tools have. I find it handy to write all of my output in the same units, but g_hbond doesn't seem to have this capability. The relevant git diff is:

diff --git a/src/tools/gmx_hbond.c b/src/tools/gmx_hbond.c
index d4769e5..6a3c107 100644
--- a/src/tools/gmx_hbond.c
+++ b/src/tools/gmx_hbond.c
@ -3262,7 +3262,7 @ int gmx_hbond(int argc,char *argv[])
npargs = asize(pa);
ppa = add_acf_pargs(&npargs,pa);

- parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_BE_NICE,NFILE,fnm,npargs,
+ parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_TIME_UNIT | PCA_BE_NICE,NFILE,fnm,npargs,
ppa,asize(desc),desc,asize(bugs),bugs,&oenv);

/* NN-loop? If so, what estimator to use ?*/
@ -3646,7 +3646,7 @ int gmx_hbond(int argc,char *argv[])
dump_grid(debug, ngrid, grid);
add_frames(hb,nframes);
- init_hbframe(hb,nframes,t);
+ init_hbframe(hb,nframes,output_env_conv_time(oenv,t));
if (hb->bDAnr)
count_da_grid(ngrid, grid, hb->danr[nframes]);
@ -3927,7 +3927,7 @ int gmx_hbond(int argc,char *argv[])
aver_nhb = 0;
aver_dist = 0;
fp = xvgropen(opt2fn("-num",NFILE,fnm),bContact ? "Contacts" :
- "Hydrogen Bonds","Time","Number",oenv);
+ "Hydrogen Bonds",output_env_get_xvgr_tlabel(oenv),"Number",oenv);
snew(leg,2);
snew(leg[0],STRLEN);
snew(leg[1],STRLEN);
gmx_hbond.c (145 KB) gmx_hbond.c Modified gmx_hbond.c Justin Lemkul, 11/10/2010 04:42 PM

Associated revisions

Revision 68fa2250 (diff)
Added by Justin Lemkul over 8 years ago

Add -tu option to g_hbond.

IssueID #580

History

#1 Updated by Rossen Apostolov almost 9 years ago

Assigning to Erik Marklund

#2 Updated by Justin Lemkul almost 9 years ago

Created an attachment (id=566)
Modified gmx_hbond.c

#3 Updated by Justin Lemkul almost 9 years ago

(In reply to comment #2)

Created an attachment (id=566) [details]
Modified gmx_hbond.c

I'm attaching a more thoroughly modified gmx_hbond.c, one that properly implements the time options for all output files. I realized that my earlier proposed modifications only worked for the hbnum.xvg output, not the others. I've done some limited testing, but it all appears to be correct.

#4 Updated by Justin Lemkul over 8 years ago

  • Status changed from New to In Progress
  • Assignee changed from Erik Marklund to Justin Lemkul

#5 Updated by Justin Lemkul over 8 years ago

  • Status changed from In Progress to Closed

Fixed in commit 68fa2250.

Also available in: Atom PDF