AndersenLab / cegwas2-nf

GWA mapping with C. elegans
MIT License
8 stars 6 forks source link

include significance values in output for variable threshold burden mapping #23

Open tcrombie opened 4 years ago

tcrombie commented 4 years ago

The data output for VT burden mapping does not contain the variable used for plotting significance /BURDEN/VT/Data/{trait_name}_VariableThresholdPrice.assoc. It looks like significance is coded in the plot_burden.R script. maybe we should add the significant logical variable to the output /BURDEN/VT/Data/{trait_name}_VariableThresholdPrice.assoc?

from plot_burden.R:


  dplyr::rowwise()%>%
  dplyr::mutate(CHROM = strsplit(strsplit(RANGE,split = ",")[[1]][1],split = ":")[[1]][1],
                POS = as.numeric(strsplit(strsplit(strsplit(RANGE,split = ",")[[1]][1],split = ":")[[1]][2],split = "-")[[1]][1]),
                endPOS = as.numeric(strsplit(strsplit(strsplit(RANGE,split = ",")[[1]][1],split = ":")[[1]][2],split = "-")[[1]][2]))%>%
  dplyr::mutate(size = abs(POS-endPOS)) %>%
  ungroup()%>%
  dplyr::mutate(significant = ifelse(PermPvalue < .05/n(), TRUE,FALSE ))%>%
  dplyr::filter(CHROM!="MtDNA",NumVar>1,size >500)
burden_manplot <- benreg_burden%>%
  ggplot()+
  aes(x = POS/1e6, y = Stat, size = NumVar, alpha = 0.5, color = significant)+```