Skip to content

Commit e95ea19

Browse files
dlipschuwhimsial
andauthored
Insure that all scores get tested for association and fix code a bit. (#5)
* Minor debug to run eQTL and pQTL of CAD. * Removed change intended for local use only and some diff type artefacts that seemed to have been pulled across. * Replace tab with spaces. --------- Co-authored-by: aiakvlie <andrii.iakovliev@ed.ac.uk>
1 parent 0846d2c commit e95ea19

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

association.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ if(newrun) {
4444
load(file.path(output.dir, "coeffs.RData"))
4545
}
4646

47+
# Make sure that regressions were run for all scores
48+
if(nrow(coeffs) != length(scoreids)){
49+
stop('Number of associations does not equal the number of scores.')
50+
}
51+
4752
## merge coeffs with scores metadata
4853
if (analysis=="eQTL")
4954
scoresinfo <- allscores.info
@@ -111,4 +116,4 @@ coeffs.wide <- genes.info[, .(gene_symbol, gene_biotype, is.t1dgene, is.t2dgene,
111116
## annotate genes by whether they are known cause for monogenic diabetes
112117
coeffs.wide[, monogenic := ifelse(gene_symbol %in% t1d.monogenes, "+", ".")]
113118

114-
save(coeffs.wide, file=file.path(output.dir, "coeffs.wide.RData")
119+
save(coeffs.wide, file=file.path(output.dir, "coeffs.wide.RData"))

gw.trans.scores.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if (include.hla) {
5555
#' sum up all scores to generate a single genome-wide score also including cis
5656
#' effects.
5757
##------------------------------------------------------------------------------
58-
if (analysis == "immunecells")) {
58+
if (analysis == "immunecells") {
5959
cat("Immune cells cannot be currently annotated. Skipping.\n")
6060
ans[, trait_name := gsub(":", "_", trait_name)]
6161
ans[, trait_name := gsub(" ", "_", trait_name)]

qtl.metadata.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ if (analysis == "eQTL") {
9999
## recode cis-x as cis but keep an indicator for cis-x
100100
allscores.info[, cisx := qtl_type=="cis-x"]
101101
allscores.info[qtl_type=="cis-x", qtl_type := "cis"]
102-
setnames(allscores.info, "gene_chrom", "chromosome")
103102

104103
table(allscores.info$matrix.colname %in% colnames(genome.wide.scores))
105104
## remove rows not matched in scores table

0 commit comments

Comments
 (0)