Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipped user prompt in SM-2019.bf #1700

Open
ArtPoon opened this issue Apr 4, 2024 · 1 comment
Open

Skipped user prompt in SM-2019.bf #1700

ArtPoon opened this issue Apr 4, 2024 · 1 comment

Comments

@ArtPoon
Copy link
Member

ArtPoon commented Apr 4, 2024

Version info:

HYPHY 2.5.60(MP) for Linux on x86_64 x86 AVX SIMD with FMA3 zlib (v1.2.11)
commit 6282dbb
OS: Ubuntu 22.04.4

Steps to reproduce:

  1. Launch hyphy from source directory
  2. Select (7) Compartmentalization
  3. Select (5) Perform a classic and structured Slatkin-Maddison test for the number migrations.
  4. Enter tests/hbltests/UnitTests/HBLCommands/res/EU3031.nwk when prompted for tree file.

Outcome:

  • interface bypasses user prompt for number of groups, defaulting to 2, and proceeds directly to identification of group 1.
>How many branch classes are there (permissible range = [2,3031], default value = 2, integer): groups: 2
>Please provide a description for group of branches 1 :

Analysis:

line 43 in SM-2019.bf

sm.group_count = io.PromptUser(">How many branch classes are there", 2, 2, sm.leaf_count, TRUE);

According to libv3/IOFunctions.bf:

/**
 * @name io.PromptUser
 * @param prompt
 * @param default
 * @param lower_bound
 * @param upper_bound
 * @param is_integer
 */
lfunction io.PromptUser(prompt,
    default, lower_bound, upper_bound, is_integer) {

Note sm.leaf_count (upper bound)) is reported as 3031. Nothing seems unusual here.

  • Does this prompt issue arise with other scripts? No, I proceeded through SimmondsAI.bf without issues.

  • Does this arise with a minimal script? I tried the following:

LoadFunctionLibrary ("libv3/IOFunctions.bf");
leaf_count = 10;
group_count = io.PromptUser(">How many branch classes are there", 2, 2, leaf_count, TRUE);
fprintf(stdout, group_count, "\n");

and obtained the following output:

art@Peregrine:~/git/hyphy/res/TemplateBatchFiles$ hyphy test.bf
>How many branch classes are there (permissible range = [2,10], default value = 2, integer): 5
5
@spond
Copy link
Member

spond commented Apr 8, 2024

Dear @ArtPoon,

Thanks for this highly detailed issue report. The strange behavior arises because the Slatkin-Maddison analysis has been ported to use CLI keyword arguments:

hyphy % hyphy sm --help

Available analysis command line options
---------------------------------------
Use --option VALUE syntax to invoke
If a [reqired] option is not provided on the command line, the analysis will prompt for its value
[conditionally required] options may or not be required based on the values of other options

tree [required]
	The Newick tree string defining the topology to use for testing

groups
	The number of compartments to test
	default value: 2

"description-"+(sm.i+1) [computed at run time] [required]
	"Description for sequences in compartment "+(sm.i+1) [computed at run time]

"regexp-"+(sm.i+1) [computed at run time] [required]
	"Regular expression to select the branches in compartment _"+sm.tag+"_" [computed at run time]

replicates
	The number of bootstrap replicates
	default value: 1000

weight
	Probability of branch selection for structured permutation [0-1]; 0 = classical Slatkin-Maddison, 1 = fully structured
	default value: 0.2

use-bootstrap
	Use bootstrap weights to respect well supported clades
	default value: Yes

output
	Write the JSON file here (default is to save to the same path as the tree file + '_SM.json')
	default value: sm.json_file [computed at run time]

In particular, the number of groups is given a default value of 2 which will be consumed in the interactive mode, unless you specify the -I (capital eye) flag, when you call HyPhy. So, if you do hyphy -I and then follow your workflow, then all prompts will be made.

Best,
Sergei

PS You can also specify some (or all) of the analysis arguments via CLI flags, e.g.

$hyphy sm --groups 3 

(the rest of the no-default-value prompts will be via `stdin`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants