AlphaGenes / AlphaPeel

AlphaPeel: calling, phasing, and imputing genotype and sequence data in pedigrees
MIT License
2 stars 11 forks source link

Print version and commit hash in printouts #61

Open gregorgorjanc opened 1 year ago

XingerTang commented 1 year ago

@gregorgorjanc To access the version from the terminal, we can use pip show AlphaPeel:

(base) evie@Xingers-MacBook-Air AlphaPeel % pip show AlphaPeel 
Name: AlphaPeel
Version: 1.1.1
Summary: Multilocus and hybrid peeling
Home-page: 
Author: Andrew Whalen
Author-email: awhalen@roslin.ed.ac.uk
License: MIT license
Location: /Users/evie/mambaforge/lib/python3.10/site-packages
Requires: numba, numpy
Required-by: 

We can also add an option -version if necessary so that we can access the version of AlphaPeel via AlphaPeel -version. But for the commit hash, I am unsure if we would include the information in the software when we upload it to the PyPI.

gregorgorjanc commented 1 year ago

—version would be awesome, but a printout on the screen while it’s working might be useful too?!

gregorgorjanc commented 1 year ago

We can work on the commit hash later - I managed to get it working with AlphaMate - can check later.

XingerTang commented 1 year ago

@gregorgorjanc For now, the printout looks like the following

(base) evie@Xingers-MacBook-Air functional_tests % bash runTests.sh
Reading in AlphaGenes format: test1/genotypes.txt
Reading in sequence data : test1/seqfile.txt
Use of an external phase file is not currently supported. Phase information will be translated to genotype probabilities. If absolutely necessary use a penetrance file instead.
External penetrance file included, but esterrors flag used. The two options are incompatible. esterrors set to false.
Reading in penetrance file: test1/penetrance.txt
Cycle  0
Peeling Down, Generation 0
Peeling Up, Generation 0
Cycle  1
Peeling Down, Generation 0
Peeling Up, Generation 0
Cycle  2
Peeling Down, Generation 0
Peeling Up, Generation 0
Cycle  3
Peeling Down, Generation 0
Peeling Up, Generation 0
Cycle  4
Peeling Down, Generation 0
Peeling Up, Generation 0
Writing to  test1/outputs/output.seg
[1] "Test 1: Success"

I think maybe we can add the version information at the beginning of the printout.

gregorgorjanc commented 1 year ago

I think maybe we can add the version information at the beginning of the printout.

Yeah, something like AlphaPeel, version: X.Y.Z

gregorgorjanc commented 1 year ago

@jwoollia reports

For example every time I open R I get the version e.g. I am on 'Beagle Scouts'. Likewise ASReml prints the version as it runs e.g. 'AlphaPeel version 1.1.3 ...'. In Rstudio with the interface there is a help which gives the version and build. Every time I, a lazy Windows use has to go to 'terminal' or 'run' commands I worry. The latest 'brick in the wall' is I am no longer automatically an administrator due to a change in UoE policy so I then have to remember to 'Make Me An Adminstrator', but that is just another hurdle to climb over and which may appear at any time.