cpptraj icon indicating copy to clipboard operation
cpptraj copied to clipboard

Do not require output file [out <filename>] / reduce Action/Analysis verbosity for libcpptraj/pytraj

Open hainm opened this issue 10 years ago • 17 comments

I am not sure if we chat about this.

What's you opinion about strictly requiring output filename? If the Action is used in pytraj, I prefer to have the filename as an option.

updated I add a todo list here

  • [x] Action_AtomicCorr.cpp
  • [x] Action_Watershell.cpp
  • [x] Action_Radial.cpp
  • [x] Action_PairDist.cpp
  • [x] Action_Density.cpp
  • [x] Action_Volmap
  • [x] Action_Grid.cpp
  • [ ] Action_Bounds.cpp
  • [ ] Action_NativeContacts.cpp
  • [x] Action_MRT.cpp
  • [x] Action_Average.cpp
  • [ ] Analysis_Rotdif.cpp
  • [x] Analysis_Lifetime.cpp # wrong topic
  • [ ] Analysis_Corr.cpp

hainm avatar Sep 30 '15 02:09 hainm

Much of this is from legacy ptraj code, where if you didn't supply an output file the command didn't make sense because the data was not stored. Make a list of Actions/Analyses you find with this behavior and post them here. I'll get to them in time.

drroe avatar Sep 30 '15 14:09 drroe

Okie

On Sep 30, 2015, at 10:19 AM, Daniel R. Roe [email protected] wrote:

Much of this is from legacy ptraj code, where if you didn't supply an output file the command didn't make sense because the data was not stored. Make a list of Actions/Analyses you find with this behavior and post them here. I'll get to them in time.

— Reply to this email directly or view it on GitHub.

hainm avatar Sep 30 '15 15:09 hainm

@drroe

this is the list so far

  • Action_AtomicCorr.cpp
  • Action_Watershell.cpp
  • Action_Radial.cpp
  • Action_PairDist.cpp
  • Action_Density.cpp
  • Action_Grid.cpp

hainm avatar Sep 30 '15 18:09 hainm

  • Analysis_Rotdif.cpp

@drroe Additionally, I can not turn of verbose of this Analysis. And seems that you did not save data to Dataset.

hainm avatar Sep 30 '15 20:09 hainm

  • Action_Bounds.cpp: if filename is not provided, the output will be STDOUT.

hainm avatar Oct 02 '15 17:10 hainm

  • Action_NativeContacts.cpp: STDOUT

hainm avatar Oct 02 '15 19:10 hainm

  • Action_MRT.cpp

hainm avatar Oct 04 '15 04:10 hainm

  • Action_Average.cpp

.Error: average: No filename given

hainm avatar Oct 09 '15 05:10 hainm

@drroe I updated checkbox in my 1st post. If you finish any Action, you can check the box. It will show the progress in the issue. quite cool. https://github.com/Amber-MD/cpptraj/issues

hainm avatar Oct 09 '15 20:10 hainm

  • Analysis_Lifetime.cpp

if runanalysis lifetime HB[solutehb] out test.dat does not have out test.dat, got STDOUT

#Set       Nlifetimes      MaxLT      AvgLT  TotFrames SetName
         0         19          4     1.4211         27 GLU_13@O-VAL_2@N-H
         1          1          1     1.0000          1 ACE_1@O-PHE_3@N-H
         2          6          2     1.1667          7 GLU_13@O-PHE_3@N-H
         3          2          1     1.0000          2 VAL_2@O-ILE_4@N-H
         4         21         12     2.5238         53 TYR_11@O-ILE_4@N-H
         5         16          4     1.6250         26 LYS_9@O-SER_6@N-H
         6          6          1     1.0000          6 TYR_11@O-SER_6@N-H
         7          2          1     1.0000          2 THR_5@O-GLY_8@N-H
         8         12          4     1.4167         17 SER_6@O-LYS_9@N-H
         9          4          1     1.0000          4 PRO_7@O-LYS_9@N-H
        10         22          6     1.9091         42 ILE_4@O-TYR_11@N-H
        11          8          4     2.0000         16 LYS_9@O-TYR_11@N-H
        12         24         10     2.8750         69 ILE_19@O-THR_12@N-H
        13         20         15     2.9500         59 VAL_2@O-GLU_13@N-H
        14          6          2     1.3333          8 PHE_3@O-GLU_13@N-H
        15         30          5     1.7667         53 LYS_17@O-VAL_14@N-H
        16         22         10     2.2273         49 THR_12@O-ILE_19@N-H
        17         20          7     2.1500         43 THR_10@O-GLN_21@N-H
        18          1          1     1.0000          1 LEU_20@O-NHE_22@N-HN1

hainm avatar Oct 18 '15 05:10 hainm

  • Action_Volmap
  if (filename.empty()) {
    mprinterr("Error: Volmap: no filename specified.\n");
    return Action::ERR;
  }

hainm avatar Nov 03 '15 00:11 hainm

Action_Average.cpp .Error: average: No filename given

You need to use crdset to create a REF data set if you do not specify an output file name, which is why the help for average starts with:

> help average
    {crdset <set name> | <filename>}

So no file name is required if crdset is specified.

drroe avatar Feb 19 '16 15:02 drroe

Action_MRT.cpp

This action is not actually used yet (it's not even in Command.cpp) - haven't gotten around to converting all of Hannes Loeffler's code...

drroe avatar Feb 19 '16 15:02 drroe

if runanalysis lifetime HB[solutehb] out test.dat does not have out test.dat, got STDOUT

Are you sure? I just added this to the end of the first test in Test_Lifetime:

runanalysis lifetime H1[solutehb] out total.dat

and both total.dat and crv.total.dat were written.

drroe avatar Feb 19 '16 15:02 drroe

I think I posted Analysis_Lifetime in wrong issue topic.

I meant if not adding out total.dat, the output is STDOUT. So this should be in dataset issue.

hainm avatar Feb 19 '16 19:02 hainm

@hainm This issue is also about suppressing stdout from cpptraj right? For example, bounds doesn't require out, but will print to STDOUT if no output file is specified. You want to prevent this behavior for pytraj right?

drroe avatar Sep 06 '18 13:09 drroe

yeah, right.

hainm avatar Sep 06 '18 14:09 hainm