Page 1 of 1

How to use command line interface?

Posted: Mon Sep 21, 2015 3:20 pm
by SimonG03
Hi everyone,

I am interested in the command line interface (CLI) of Stat-JR, and how I can use it for analysing my data. I use R for most of my computations; I would like to run Stat-JR from the command line rather than using the GUI, so I can stay within R if possible.
My Question(s): How can I use the CLI of Stat-JR? Is there documentation explaining this? Suppose I have already fit a model in Stat-JR, thus generating the code necessary to run it, can I use the CLI to fit the same model again using R?

So far, I've been using Stat-JR 1.0.2 via the browser-based GUI. As noted in [1] (see link below), there is a CLI for Stat-JR, which appears to be "under development", and which would allow Stat-JR to be run from external software. A neat feature, considering that most of the operations seem do be done by python and pre-compiled C++ code.
In the advanced documentation [2], I found a reference to a "Python command line interface". However, it is not discussed in that document how it can be used. In "~\StatJR\src\apps\scripting" there is an executable file called "runScript.exe", which triggers the same loading process as the main executable, but it doesn't start the TREE interface.

Is this the exetutable for the CLI? If so, how can I use it? Are there help files or man pages that explain the use of the CLI? If so, I would be happy if someone points me into the right direction; if not, I would be even more happy if someone could explain a few basic steps on "how to get started" :)

Thanks in advance! I'm looking forward to using this feature!

Best,
Simon

[1] http://www.bristol.ac.uk/cmm/software/s ... port/faqs/
[2] http://www.bristol.ac.uk/cmm/media/migr ... vanced.pdf

Re: How to use command line interface?

Posted: Mon Sep 21, 2015 4:34 pm
by ChrisCharlton
Yes, it is possible to run Stat-JR templates from a command line, although as you have discovered the support for this is preliminary and the exact mechanism may change in the future (if you do attempt to use it we would be interested in your feedback). In another topic in this forum I have provided some syntax for running a Stat-JR model from R and then retrieving the MCMC chains:

https://www.cmm.bristol.ac.uk/forum/vie ... =879#p2201

Let us know if anything is unclear.

Re: How to use command line interface?

Posted: Tue Sep 22, 2015 9:17 am
by SimonG03
That already helps a lot. However, I am not sure yet if I stick with Stat-JR in this case because that would require me to write a new template to run in this manner.

Is there, perhaps, a good documentation on how to extend the current templates in Stat-JR? In the advanced documentation, there is a bit about extending templates and writing new ones, but it seems like great familiarity with Python and C++ is required to write them. Judging from that, the amount of work I would need to invest in that are outweighted (by far) by switching to a different program, even though I am genuinely interested in using Stat-JR.

I will have a look at the documentation and the example you provided. I'll let you know if there is any progress. I'd be happy to hear about a documentation on creating templates.

Best,
Simon

Re: How to use command line interface?

Posted: Thu Sep 24, 2015 12:49 pm
by richardparker
Hi - thanks for your interest in the software. The forum message Chris linked to illustrates how to call Stat-JR from R and bring the results back. It's not actually necessary to write a Stat-JR template in order to do that (one can use the templates provided in the Stat-JR package), although it would be necessary to write a Stat-JR template if one wanted to extend Stat-JR's functionality.

Best wishes,

Richard

Re: How to use command line interface?

Posted: Tue Jan 03, 2023 5:01 am
by plopblurt
Hi everyone, basket random
A helpful documentation on how to extend the functionality of the templates currently available in Stat-JR? There is some discussion of extending templates and writing new ones in the more advanced documentation; however, it appears that an in-depth understanding of Python and C++ is necessary in order to write them.

Re: How to use command line interface?

Posted: Wed Jan 04, 2023 11:19 am
by ChrisCharlton
We don't have a lot of information on this outside the advanced guide. What kind of extensions are you hoping to add?

Re: How to use command line interface?

Posted: Mon Jul 03, 2023 4:05 am
by JoseSpencer
ChrisCharlton wrote: Wed Jan 04, 2023 11:19 am We don't have a lot of information on this outside the advanced guide. What kind of extensions are you hoping to add?
I want to learn all kinds of gadgetsSonic exe. Do you have a manual page on this?