


data <- data.frame( col1 = c("SRR12331556" ,"SRR12331557" ,"SRR12331558" ,
                             "SRR12331559" ,"SRR12331560" ,"SRR12331561" ,
                             "SRR12331562" , "SRR12331563" ,"SRR12331564" ,"input") ,
                    col2 = c(15.6,13.7,9.3,15.3,15.1,13.2,17.4,17.8,13.4 , 7.9))

View(data)

max(data$col2)
data$col2[10]

x <- max(data$col2)/data$col2[10]

vec <-c()
for(i in 1:nrow(data)){
  
  a <- data$col2[i]
  b <- a / x
  vec <- append(vec , b)
}

data <- cbind(data , vec)
View(data)


vec2 <-c()
for(i in 1:nrow(data)){
  
  a <- data$col2[i] / data$vec[i]
  vec2 <- append(vec2 , a)
}

data <- cbind(data , vec2)
View(data)


input_count <- data$col2[10]

vec3 <-c()
for(i in 1:nrow(data)){
  
  a <- data$vec[i] / input_count 
  vec3 <- append(vec3 , a)
}

vec4 <- substr(vec3 , start = 3 , stop = 4)
vec5 <- paste0("1.",vec4 )

data <- cbind(data , vec5)

colnames(data) <- c("sample" , "read_counts" , "optimum_input_size" , "ratio" , "argument")

View(data)


write.csv(data , "normalization information.csv")







