-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTF.Rmd
38 lines (28 loc) · 1.06 KB
/
TF.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---
title: "Transcription factors"
output:
html_document:
code_folding: hide
---
```{r library, echo=TRUE,warning=FALSE,message=FALSE,error=FALSE, include=FALSE}
library(pheatmap)
library(tidyverse)
source('functions.R')
library(yaml)
```
```{r yaml, echo=TRUE,warning=FALSE,message=FALSE,error=FALSE, include=FALSE}
params <- read_yaml("config.yml")
```
# Transcription factor analysis
The aim of this code is to subset each transcription factor from your significant results and place the results of that into the folder TranscriptionFactors/
```{r tr, echo=TRUE,warning=FALSE,message=FALSE,error=FALSE, include=FALSE}
TF <- read.csv("TF.csv", header = T)
TF <- TF %>% dplyr::filter(X == "Yes") %>% dplyr::select(Name)
design_files <- list.files(path="results", pattern = "(design_)*res\\.csv$")
for (i in design_files) {
df <- read.csv(paste0("results/",i), header=T)
df_new <- subset(df, toupper(SYMBOL) %in% toupper(TF$Name))
dir.create(file.path("TranscriptionFactors"), showWarnings = FALSE)
write.csv(df_new, file=paste0("TranscriptionFactors/",i))
}
```