From b748c1264c318df2b4905fea1c0f8f7ad9c157ba Mon Sep 17 00:00:00 2001 From: hyginn Date: Sat, 21 Oct 2017 21:00:18 -0400 Subject: [PATCH] Add selectPDBrep() function to select random, representative PDB IDs --- .utilities.R | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 ==================================================================