#' Parse full-sibling family membership from BestFS COLONY output
#'A function that will extract full-sibling family membership per individual from Colony Output
#'@param path file path to BestFS output from the program COLONY
#'@author Zak Robinson, Contact: zachary.robinson(at)umontana.com
#'@return Data frame with individuals and full-sibling family membership
#'@export
read_colonyV2_BestFS<-function(path){
require(reshape2)
z<-readLines(con=path)
df<-list()
length(df)<-length(z)-1
for(i in 2:length(z)){
f<-gsub(pattern = "^\\s+\\S+\\s+\\S+\\s+\\S+\\s+(\\S+)$",x = z[i],perl = T,replacement = "\\1")
df[[i-1]]<-unlist(strsplit(f,",",fixed = T))
}
out<-melt(data = df,level = 1)
names(out)<-c("ID","FAMID")
return(as.data.frame(out,stringsAsFactors=F))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.