I am trying to program a pathway analysis. Briefly, I have a list of genes which contain 1 or more mutations. I have mapped these genes to pathways, and I want find out if any pathways are over-represented in these mappings.
My approach is permutation based: I randomly place an equivalent number of mutations within the genome (taking gene length) into account, and then I do this 10,000 times, and count up the number of times each pathway got a certain number of mutations. Plotting a histogram of these permutations for any one pathway looks like a chi sq distribution plotted in R with a df=1 and ncp=0.
My question is how do I now calculate a p-value based on this distribution? Any help is appreciated.