Add selectPDBrep() function to select random, representative PDB IDs

This commit is contained in:
hyginn 2017-10-21 21:00:18 -04:00
parent d28536b395
commit b748c1264c

View File

@ -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 ================================================================== # ====== DATA ==================================================================