Skip to content

Commit

Permalink
intial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitjohnson committed Jun 25, 2018
0 parents commit a44114d
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .Rbuildignore
@@ -0,0 +1,2 @@
^.*\.Rproj$
^\.Rproj\.user$
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
13 changes: 13 additions & 0 deletions DESCRIPTION
@@ -0,0 +1,13 @@
Package: imsig
Type: Package
Title: Immune Cell Gene Signatures for Profiling the Microenvironment of Solid Tumours
Version: 0.1.0
Author: Ajit Johnson Nirmal
Maintainer: Ajit Johnson Nirmal <ajitjohnson.n@gmail.com>
Description: Estimating relative abundance of tissue-infiltrating immune subpopulations abundances using gene expression data.
License: MIT
Encoding: UTF-8
LazyData: true
Imports:
HiClimR (>= 1.2.3)
RoxygenNote: 6.0.1
4 changes: 4 additions & 0 deletions NAMESPACE
@@ -0,0 +1,4 @@
# Generated by roxygen2: do not edit by hand

export(corr_matrix)
importFrom(HiClimR,fastCor)
Binary file added R/.DS_Store
Binary file not shown.
16 changes: 16 additions & 0 deletions R/corr_matrix.R
@@ -0,0 +1,16 @@
#' @title Generation of a correlation matrix
#' @description Creates a correlation matrix using ImSig signature genes.
#' @param exp Expression matrix with genes as rows and samples as columns [data.frame]
#' @param r Correlation cut-off to use. Correlations below the defined cut-off will be replaced with zero before returning the final correlation matrix.
#' @return Gene-gene correlation matrix of the ImSig genes.
#' @importFrom HiClimR fastCor
#' @export

corr_matrix <- function(exp, r){
sig_su <- sig[which(as.character(sig$gene) %in% row.names(exp)), ]
data <- exp[as.character(sig_su$gene),]
cor_data <- fastCor(t(data))
cor_data[cor_data <= r]= 0
diag(cor_data) = 0
return(cor_data)
}
8 changes: 8 additions & 0 deletions R/sig.R
@@ -0,0 +1,8 @@
#' @title ImSig genes
#' @description ImSig signature genes and the cell type they represent
#' @name sig
#' @docType data
#' @usage sig
#' @format dataframe
#' @keywords datasets
NULL
Binary file added data/.DS_Store
Binary file not shown.
Binary file added data/sig.rda
Binary file not shown.
22 changes: 22 additions & 0 deletions imsig.Rproj
@@ -0,0 +1,22 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageCheckArgs: --as-cran
PackageRoxygenize: rd,collate,namespace,vignette
Binary file added man/.DS_Store
Binary file not shown.
19 changes: 19 additions & 0 deletions man/corr_matrix.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions man/sig.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a44114d

Please sign in to comment.