Basic built in functions of Qliphoth - hello31337/BI-SGX GitHub Wiki
As the name "BI-SGX" shows, BI-SGX provides a lot of utility built-in functions mainly for bioinformatic analysis.
Output some string or content of variable to result file (NOT TO STDOUT). You have to use this function or println to get calculation result from ISV.
You can combine following 2 types of arguments with ,.
-
string:stringto output to result. Currently BI-SGX doesn't support string-type variable, so use this type by directly hard-coding to your code. -
double: Variable name ofdoublevalue.
There is no return value with this function.
var arg1
arg1 = 9999
print "arg1 is: ", arg1
==============================================
--------------------------------------------
Date: 2019/05/05 Sun 02:31:40
--------------------------------------------
arg1 is: 9999
==============================================
Output some string or content of variable to result file (NOT TO STDOUT). Different from print, println inserts newline after output designated contexts. You have to use this function or print to get calculation result from ISV.
You can combine following 2 types of arguments with ,.
-
string:stringto output to result. Currently BI-SGX doesn't support string-type variable, so use this type by directly hard-coding to your code. -
double: Variable name ofdoublevalue.
There is no return value with this function.
var arg1
arg1 = 9999
println "arg1 is: ", arg1
==============================================
--------------------------------------------
Date: 2019/05/05 Sun 02:31:40
--------------------------------------------
arg1 is: 9999
==============================================
Truncate after the decimal point of designated double variable.
-
double:doublevariable to truncate after the decimal point.
-
double: Truncation result.
var dbl1
dbl1 = 12.34567
trc_dbl1 = toint(dbl1)
println trc_dbl1 // "12.0" will be written to the result file.Calculate average of secret in protected which is stored in DB.
-
string: Dataset name. Designate the name of dataset (which is stored in DB table:BI-SGX->stored_data).
double: Average value of designated dataset.
var avg
avg = average("dataset0")
println "average of dataset0 is: ", avg
Calculate edit distance between first string of designated dataset's secret and other designated dataset's secrets. BI-SGX uses bit-parallel method to calculate edit distance; And the code implementation is refer to this code. NOTE: The feature to compute edit distance between researcher's own query string and dataset's secret will be implemented in near future.
-
string: Dataset name. Designate the name of dataset (which is stored in DB table:BI-SGX->stored_data).
double: Average of edit distance.
var ed1
ed1 = edist("dataset0")
println "edit distance's average of dataset0 is: ", ed1
Execute global alignment between first string of designated dataset's secret and other designated dataset's secrets. BI-SGX uses Needleman-Wunsch algorithm for computing global alignment.
-
string: Dataset name. Designate the name of dataset (which is stored in DB table:BI-SGX->stored_data). Note that the dataset's format must be FASTA.
double: Maximum score from every global alignment computation.
var nw_res
nw_res = galign("dataset0")
println "Maximum score of NW is: ", nw_res
Output the list of dataname and datatype pair in the table stored_data to the result file.
No arguments are needed. Parentheses for arguments isn’t needed too (i.e. inquiryDB is correct although inquiryDB() is incorrect).
There is no return value with this function.
println “TableName-DataType list: ”
inquiryDB
==============================================
--------------------------------------------
Date: 2019/07/15 Sun 13:30:04
--------------------------------------------
TableName-DataType list:
dataset0 -> integer
dataset1 -> genome
dataset2 -> FASTA
==============================================
Generate true random in integer between designated range. RDRAND instruction of Intel CPU is internally used for generating random numbers.
-
int: Minimum number for RNG. If you designated this argument withdouble, it will be automatically cast toint. Must be between-2147483647and2147483647. -
int: Maximum number for RNG. If you designated this argument withdouble, it will be automatically cast toint. Must be between-2147483647and2147483647.
If the first argument is larger than the second argument, they will be automatically exchanged.
double: Generated true random number in the range of minimum to maximum.
var rnd_res
rnd_res = rand(-40000, 60000)
println "Generated random number: ", rnd_res