Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: incorrect ref definition for kmFit contrasts #55

Merged
merged 1 commit into from
May 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: kimma
Type: Package
Title: Kinship In Mixed Model Analysis of RNA-seq
Version: 1.2.0
Version: 1.3.0
Author: Kim Dill-McFarland
Maintainer: Kim Dill-McFarland <kadm@uw.edu>
Description: Linear mixed effects models with pairwise kinship for RNA-seq data.
Expand Down
7 changes: 5 additions & 2 deletions R/kmFit_contrast.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @keywords internal

kmFit_contrast <- function(fit, contrast.var, to.model.gene, metrics){
contrast.i <- term <- p.value <- contrast_ref <- contrast_lvl <- contrast <- null.value <- NULL
contrast.i <- term <- p.value <- contrast_ref <- contrast_lvl <- contrast <- null.value <- estimate <- NULL
contrast.result <- data.frame()

#Fit variables in contrast.var
Expand Down Expand Up @@ -55,7 +55,10 @@ kmFit_contrast <- function(fit, contrast.var, to.model.gene, metrics){
}}
contrast.result.format <- contrast.result %>%
dplyr::rename(variable=term, pval=p.value) %>%
dplyr::select(-null.value)
dplyr::select(-null.value) %>%
#Switch estimate sign to match lvl-ref calculation
#THE REF AND LVL VALUES ARE INCORRECT UNTIL YOU DO THIS
dplyr::mutate(estimate = -estimate)
return(contrast.result.format)
}