Package: ukbsearch
UKBsearchUKBsearchis a search tool to retreive term(or terms) from UKBiobank HTML files and tab files downloaded in the local drive.Installationfrom pypipip install ukbsearchfrom githubpip install https://github.com/danielmsk/ukbsearch/raw/main/dist/ukbsearch-0.2.1-py3-none-any.whlDependencyThisUKBsearchrequires the following packages:richpyreadrprettytablepandaspytabixOptionsoptional arguments:
  -h, --help            show this help message and exit

  -v, --version         show program's version number and exit

  -s, --searchterm      search. terms (ex: age smoking)
                        -s age
                        -s age smoking
                        -s 'smok*'
                        -s '*age' 'smok*'

  -l, --logic           logical operator for multiple terms [or(default), and]
                        -s '*age' 'smok*' -l and
                        -s age 'smok*' -l or

  -o, --out             title of output file
                        -o searchresult_20220322

  -t, --outtype         output type [console(default), csv, udi]
                        -t csv
                        -t console csv
                        -t udi
                        -t console udi

  -p, --path            directory path for data files (.html, .Rdata) (default: /data2/UKbiobank/ukb_phenotype)
                        -p /other/path/for/ukb/html/.

  -u, --udilist         FileID and UDI list for saving data from tcf files
                        -u ukb39003 3536-0.0 3536-1.0 3536-2.0

  -d, --savedata        save data from .Rdata [csv, rdata]
                        -d csv
                        -d rdata
                        -d csv rdata

  -i, --index
                        index tab file and make tcf file (ex. ukb39003.tab)UsageSearch resultukbsearch -s 'ag*' 'smok*' -l andSearch for single termukbsearch -s age
ukbsearch --searchterm age
ukbsearch -s 'ag*'
ukbsearch -s '*ge'Search for multiple termsThe logical operators (andoror) are supported.ukbsearch -s age smoking
ukbsearch -s age smoking -l or
ukbsearch -s age smoking -l and
ukbsearch -s 'ag*' 'smok*' -l andPrint only html and UDIukbsearch -s 'ag*' 'smok*' -l and -t udiSave the search result as csv fileukbsearch -s 'ag*' 'rep*' -l and -o test1 -t csv
(= ukbsearch --searchterm 'ag*' 'rep*' --logic and --out test1 --outtype csv)
ukbsearch -s 'ag*' 'rep*' -l and -o test1 -t console csv
ukbsearch -s 'ag*' 'rep*' -l and -o test1 -t console udi csvSet a particular directoryThe default path is/data2/UKbiobank/ukb_phenotype.ukbsearch -s age -p /other/path/for/ukb/html/.Index tab fileukbsearch -i ukb26086.tabThis step generates.tab.tcf.gz,.tab.tcf.gz.tbi, and.tab.tcf.gz.idx. After generating tcf files, the tab file is no longer required to search.Save data (.csv and .rdata) from .tcf.gzukbsearch -u ukb39003 3536-0.0 3536-1.0 3536-2.0 -d csv -o test3
(=ukbsearch --udilist ukb39003 3536-0.0 3536-1.0 3536-2.0 --savedata csv --out test3)
ukbsearch -u ukb39003 3536-0.0 3536-1.0 ukb26086 20161-0.0 21003-1.0 -d csv rdata -o test3

ukbsearch -s 'ag*' 'rep*' -l and -d csv -o test3
ukbsearch -s 'ag*' 'rep*' -l and -d rdata -o test3Version History0.2.2 (2022-04-05)change saving type for a single fileremove csvi (inversed form) option.0.2.1 (2022-03-25)add csvi (inversed form) option.debug unsaved values issue.0.2.0 (2022-03-24)implementated tab file indexing based ontabix.0.1.1 (2022-03-23)changed default path to/data2/UKbiobank/ukb_phenotype0.1.0 (2022-03-21)first released.