Add selectPDBrep() function to select random, representative PDB IDs
This commit is contained in:
parent
d28536b395
commit
b748c1264c
19
.utilities.R
19
.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 ==================================================================
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user