# Specificity_index functions, version 1.0 # Created by Joe Dougherty, jdougherty_at_mail.rockefeller.edu or # jodoc_a_ucla.edu # Last updated 8/24/09 # The permutation testing is computationally intensive. Expect it to run for a while. # Variable descriptions: # summary_in - is a dataframe with expresion values for genes in rows, and samples #or cell types in columns (at this point replicate arrays have been averaged, so #one column per cell type) #summary_fc is a matched array (same genes and samples) but with NA's for any #genes that should be excluded for a particular cell type. # We often filter prior to specificity index to remove genes below a particular # background threshold. # Define function specificity_index<-function(summary_in, summary_fc){ bts<-50 #set amount of distributions to average for permutation testing p_max<- .1 # set the maximum pvalue to be calculated e_min<- 50 #set the minimum expression value for a gene to be included #make a clean version of summary_in... dat_clean<-summary_in #...for each sample, remove values with less than # 50 absolute expression... dat_clean[summary_in