-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgists.R
79 lines (53 loc) · 1.37 KB
/
gists.R
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
# Install libraries
install.packages("BiocManager")
BiocManager::install("Rbowtie2")
# Load libraries
library(Rbowtie2)
# Manipulation of Directories
dir.exists()
dir.create()
# List the files in a directory
list.files()
dir()
# File manipulation
file.exists()
file.create()
file.rename()
file.remove()
# Download File from the Internet
download.file()
# Remove object
rm()
# Object features
class()
length()
#Test Objects for Exact Equality
identical()
# Scatter-plot
plot()
# Histogram
hist()
# Save object : .csv file
write.csv()
# Load object
read.csv()
# Timing code
start_time <- Sys.time()
# do something
end_time <- Sys.time()
end_time - start_time
# Create dataframe (table data)
# -----------------------------------------------------------------------------
# Create sample vector
sampleID = paste0("SRR93364", 68:76)
# Create condition vector
conditions = rep(c("basal", "indust1", "indust2"), each = 3)
# Create description vector
description = rep(c("pH5_0.04CO2", "pH5_5CO2", "pH3_0.04CO2"), each = 3)
# Create data frame
saccha_metadata <- data.frame(sampleID, conditions, description)
# Assign the row names of the data frame
rownames(saccha_metadata) = paste(conditions, 1:3, sep = "_")
# Save the df into a csv file
# -----------------------------------------------------------------------------
write.csv(saccha_metadata, file = "saccha_metadata.csv")