This transforms a list of possible interactions between proteins downloaded from STRING database into a matrix which can be used for blacklisting/penalization in BiDAG.
string2mat(curnames, int, mapping = NULL, type = c("int"), pf = 2)square matrix whose entries correspond to the list of interactions and parameter type
character vector with gene names which will be used in BiDAG learning function
data frame, representing a interactions between genes/proteins downloaded from STRING (https://string-db.org/); two columns are necessary 'node1' and 'node2'
(optional) data frame, representing a mapping between 'curnames' (gene names, usually the column names of 'data') and gene names used in interactions downloaded from STRING (https://string-db.org/); two columns are necessary 'queryItem' and 'preferredName'
character, defines how interactions will be reflected in the output matrix; int will result in a matrix whose entries equal 1 if interaction is present in the list of interactions int and 0 otherwise; blacklist results in a matrix whose entries equal 0 when interaction is present in the list of interactions and 1 otherwise;
pf results in a matrix results in a matrix whose entries equal 1 is interaction is present in the list of interactions int and pf otherwise$ "int" by default
penalization factor for interactions, needed if type=pf
curnames<-colnames(kirp)
intmat<-string2mat(curnames, mapping, interactions, type="pf")
Run the code above in your browser using DataLab