Skip to content

Commit

Permalink
rowSums added
Browse files Browse the repository at this point in the history
  • Loading branch information
TanerArslan committed Apr 23, 2019
1 parent b37acec commit 842e6a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions R/mergeProbability.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@
mergeProbability <- function(df){

t.secretory.df <- data.frame(df[, colnames(df)[2:5]])
t.secretory.df$Secretory <- apply(t.secretory.df, 1, sum)
t.secretory.df$Secretory <- rowSums(t.secretory.df)
t.nuclear.df <- data.frame(df[, colnames(df)[6:9]])
t.nuclear.df$Nuclear <- apply(t.nuclear.df, 1, sum)
t.nuclear.df$Nuclear <- rowSums(t.nuclear.df)
t.cytosol.df <- data.frame(df[, colnames(df)[10:14]])
t.cytosol.df$Cytosol <- apply(t.cytosol.df, 1, sum)
t.cytosol.df$Cytosol <- rowSums(t.cytosol.df)
t.Mitochondria.df <- data.frame(df[, colnames(df)[15:16]])
t.Mitochondria.df$Mitochondria <- apply(t.Mitochondria.df, 1, sum)
t.Mitochondria.df$Mitochondria <- rowSums(t.Mitochondria.df)

merged.df <- data.frame(Proteins = rownames(df),
svm.pred.all = df[,colnames(df)[1]],
Expand Down
8 changes: 4 additions & 4 deletions R/sumProbability.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
sumProbability <- function(df){

t.secretory.df <- data.frame(df[, colnames(df)[3:6]])
t.secretory.df$Secretory <- apply(t.secretory.df, 1, sum)
t.secretory.df$Secretory <- rowSums(t.secretory.df)
t.nuclear.df <- data.frame(df[, colnames(df)[7:10]])
t.nuclear.df$Nuclear <- apply(t.nuclear.df, 1, sum)
t.nuclear.df$Nuclear <- rowSums(t.nuclear.df)
t.cytosol.df <- data.frame(df[, colnames(df)[11:15]])
t.cytosol.df$Cytosol <- apply(t.cytosol.df, 1, sum)
t.cytosol.df$Cytosol <- rowSums(t.cytosol.df)
t.Mitochondria.df <- data.frame(df[, colnames(df)[16:17]])
t.Mitochondria.df$Mitochondria <- apply(t.Mitochondria.df, 1, sum)
t.Mitochondria.df$Mitochondria <- rowSums(t.Mitochondria.df)

summed.df <- data.frame(Proteins = rownames(df),
df[,colnames(df)[seq_len(2)]],
Expand Down

0 comments on commit 842e6a4

Please sign in to comment.