-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
100 lines (100 loc) · 4.62 KB
/
.Rhistory
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
if (!require("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install("rtracklayer")
library(rtracklayer)
library(readr)
library(ggplot2)
library(gplots)
?hclust
?as.dist
??readr
?as.dist
?hclust
install.packages("VennDiagram")
library(VennDiagram)
experiment1 <- c('peptide1', 'peptide2', 'peptide3')
experiment2 <- c('peptide2', 'peptide3', 'peptide4')
experiment3 <- c('peptide1', 'peptide4', 'peptide5')
# Create the Venn diagram
venn.plot <- venn.diagram(
x = list('Experiment 1' = experiment1, 'Experiment 2' = experiment2, 'Experiment 3' = experiment3),
category.names = c('Experiment 1', 'Experiment 2', 'Experiment 3'),
filename = NULL, # Set this to a file path to save the diagram, or NULL to plot directly
output = TRUE,
imagetype = "png", # Image type
height = 3000, # Image height
width = 3000, # Image width
resolution = 300, # Image resolution
compression = "lzw", # Image compression
col = "transparent",
fill = c("#999999", "#E69F00", "#56B4E9"),
alpha = 0.50,
label.col = c("black", "white", "white", "white", "white", "white", "white"),
cex = 2,
fontfamily = "serif",
fontface = "bold",
cat.default.pos = "text",
cat.col = c("#999999", "#E69F00", "#56B4E9"),
cat.cex = 2,
cat.fontfamily = "serif",
cat.dist = c(0.06, 0.06, 0.03),
cat.pos = 0
)
# Plot the diagram
grid.draw(venn.plot)
# 31814
pq31814_df <- read_csv("01_filter_data/01.2_make_clean_peptide_tables/sn_pep31814_pep_07022024.csv")
# Format an output file for input into Pogo to make Genome Browser tracks
# Restructure the dataframe for input into Pogo
# Outputs are named first by TMT or TOM, their ID number, WTC11, then unfrac or 8frac
setwd("/Volumes/sheynkman/projects/zhang_mouse_aging")
library(readr)
library(dplyr)
library(stringr)
# 31814
pq31814_df <- read_csv("01_filter_data/01.2_make_clean_peptide_tables/sn_pep31814_pep_07022024.csv")
setwd("/Volumes/sheynkman/projects/zhang_mouse_aging")
# 31814
pq31814_df <- read_csv("01_filter_data/01.2_make_clean_peptide_tables/sn_pep31814_pep__07022024.csv")
restructured_pogo_df <- pq31814_df %>%
mutate( #mutate just allows us to modify and add columns!
Experiment = "pq31814", #create column called "Experiment" that is filled with the experiment type
PSMs = 1, #create column called "PSMs" and fill with 1
Quant = 1 #create column called "Quant" and fill with 1
) %>%
select(Experiment, Distinct_Peptide = PeptideSequence, PSMs, Quant) #the dataframe we're creating will only have these columns
file_path <- "02_Peptides2Pogo/sn_pq31814_peptides.txt"
write.table(restructured_pogo_df, file = file_path, sep = "\t", quote = FALSE, row.names = FALSE)
# 31811
pq31811_df <- read_csv("01_filter_data/01.2_make_clean_peptide_tables/sn_pep31811_pep_07022024.csv")
restructured_pogo_df <- pq31811_df %>%
mutate( #mutate just allows us to modify and add columns!
Experiment = "pq31811", #create column called "Experiment" that is filled with the experiment type
PSMs = 1, #create column called "PSMs" and fill with 1
Quant = 1 #create column called "Quant" and fill with 1
) %>%
select(Experiment, Distinct_Peptide = PeptideSequence, PSMs, Quant) #the dataframe we're creating will only have these columns
file_path <- "02_Peptides2Pogo/sn_pq31811_peptides.txt"
write.table(restructured_pogo_df, file = file_path, sep = "\t", quote = FALSE, row.names = FALSE)
# 31812
pq31812_df <- read_csv("01_filter_data/01.2_make_clean_peptide_tables/sn_pep31812_pep_07022024.csv")
restructured_pogo_df <- pq31812_df %>%
mutate( #mutate just allows us to modify and add columns!
Experiment = "pq31812", #create column called "Experiment" that is filled with the experiment type
PSMs = 1, #create column called "PSMs" and fill with 1
Quant = 1 #create column called "Quant" and fill with 1
) %>%
select(Experiment, Distinct_Peptide = PeptideSequence, PSMs, Quant) #the dataframe we're creating will only have these columns
file_path <- "02_Peptides2Pogo/sn_pq31812_peptides.txt"
write.table(restructured_pogo_df, file = file_path, sep = "\t", quote = FALSE, row.names = FALSE)
# 31813
pq31813_df <- read_csv("01_filter_data/01.2_make_clean_peptide_tables/sn_pep31813_pep_07022024.csv")
restructured_pogo_df <- pq31813_df %>%
mutate( #mutate just allows us to modify and add columns!
Experiment = "pq31813", #create column called "Experiment" that is filled with the experiment type
PSMs = 1, #create column called "PSMs" and fill with 1
Quant = 1 #create column called "Quant" and fill with 1
) %>%
select(Experiment, Distinct_Peptide = PeptideSequence, PSMs, Quant) #the dataframe we're creating will only have these columns
file_path <- "02_Peptides2Pogo/sn_pq31813_peptides.txt"
write.table(restructured_pogo_df, file = file_path, sep = "\t", quote = FALSE, row.names = FALSE)