diff --git a/.utilities.R b/.utilities.R index 4b459fa..ad19221 100644 --- a/.utilities.R +++ b/.utilities.R @@ -130,6 +130,25 @@ waitTimer <- function(t, nIntervals = 50) { } +# ====== PDB ID selection ====================================================== + +selectPDBrep <- function(n) { + # Select n PDB IDs from a list of high-resolution, non-homologous, single + # domain, single chain structure files that represent a CATH topology + # group. + # Parameters n num number of IDs to return. + # Value: char PDB IDs + # Note: the list is loaded from an RData file in the data directory + + load("./data/pdbRep.RData") # loads pdbRep + if (n > length(pdbRep)) { + stop(sprintf("You can select no more than %d IDs.", length(pdbRep))) + } + set.seed(as.numeric(Sys.time())) + return(sample(pdbRep, n)) +} + + # ====== DATA ==================================================================