Skip to content

Commit

Permalink
Version bumped 0.99.1
Browse files Browse the repository at this point in the history
  • Loading branch information
TanerArslan committed Mar 3, 2019
1 parent d48d59a commit 4a3299a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: SubCellBarCode
Type: Package
Title: SubCellBarCode: Integrated workflow for robust mapping and visualizing whole human spatial proteome
Version: 0.99.0
Version: 0.99.1
Author: Taner Arslan
Maintainer: Taner Arslan <taner.arslan@ki.se>
Description: Mass-Spectrometry based spatial proteomics have enabled the proteome-wide mapping of protein subcellular localization (Orre et al. 2019, Molecular Cell). SubCellBarCode R package robustly classifies proteins into corresponding subcellular localization.
Expand Down
Empty file added R/.Rapp.history
Empty file.
34 changes: 25 additions & 9 deletions R/tSNEVisualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,20 @@ tsneVisualization <- function(protein.data, markerProteins, dims,

message("Optimization was performed.")

#get the optimization parameters
theta.val <- as.numeric(paste(0,
as.character(min.theta.perp[2]), sep = "."))

perplexity.val <- as.numeric(min.theta.perp[1])

message(sprintf("Theta value: %s", theta.val))
message(sprintf("Perplexity value: %s", perplexity.val))


rtsne.map <- Rtsne::Rtsne(tsne.df,
dims = 3,
theta=as.numeric(paste(0,
as.character(min.theta.perp[2]), sep = ".")),
perplexity=as.numeric(min.theta.perp[1]))
theta= theta.val,
perplexity = perplexity.val)


#plot 3D tsne-map
Expand All @@ -77,7 +86,7 @@ tsneVisualization <- function(protein.data, markerProteins, dims,
legend = c("S1", "S2", "S3", "S4","N1", "N2", "N3", "N4",
"C1", "C2", "C3", "C4", "C5", "M1", "M2"),
pch = 16,
cex = 0.85,
cex = 0.75,
col = c("gold", "orange", "salmon", "tomato2",
"grey90","grey70", "grey50", "grey30",
"lightblue", "aquamarine", "cyan", "deepskyblue2",
Expand All @@ -92,7 +101,7 @@ tsneVisualization <- function(protein.data, markerProteins, dims,
legend = c("S1", "S2", "S3", "S4","N1", "N2", "N3", "N4",
"C1", "C2", "C3", "C4", "C5", "M1", "M2"),
pch = 16,
cex = 0.85,
cex = 0.75,
col = c("gold", "orange", "salmon", "tomato2",
"grey90", "grey70", "grey50", "grey30",
"lightblue","aquamarine", "cyan","deepskyblue2",
Expand All @@ -107,7 +116,7 @@ tsneVisualization <- function(protein.data, markerProteins, dims,
legend = c("S1", "S2", "S3", "S4","N1", "N2", "N3", "N4",
"C1", "C2", "C3", "C4", "C5", "M1", "M2"),
pch = 16,
cex = 0.85,
cex = 0.75,
col = c("gold", "orange", "salmon", "tomato2",
"grey90", "grey70", "grey50", "grey30",
"lightblue", "aquamarine", "cyan", "deepskyblue2",
Expand Down Expand Up @@ -135,11 +144,18 @@ tsneVisualization <- function(protein.data, markerProteins, dims,

message("Optimization was performed.")

#get the optimization parameters
theta.val <- as.numeric(paste(0,
as.character(min.theta.perp[2]), sep = "."))

perplexity.val <- as.numeric(min.theta.perp[1])

message(sprintf("Theta value: %s", theta.val))
message(sprintf("Perplexity value: %s", perplexity.val))
rtsne.map <- Rtsne::Rtsne(tsne.df,
dims = 2,
theta=as.numeric(paste(0,
as.character(min.theta.perp[2]), sep = ".")),
perplexity=as.numeric(min.theta.perp[1]))
theta = theta.val,
perplexity = perplexity.val)

#plot 2D tsne-map
d <- data.frame(x=rtsne.map$Y[, 1],
Expand Down
9 changes: 5 additions & 4 deletions vignettes/SubCellBarCode.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ distribution and separation of marker proteins.

```{r tsneparameter}
#Default parameters
#Run the broad-range parameters to optimize well !!!
#Output dimensionality
#dims = 3
#Speed/accuracy trade-off (increase for less accuracy)
Expand All @@ -171,8 +172,8 @@ set.seed(6)
tsne.map <- tsneVisualization(protein.data = df,
markerProteins = r.markers,
dims = 3,
theta = c(0.1, 0.2, 0.3, 0.4, 0.5),
perplexity = c(5, 10, 20, 30, 40, 50, 60))
theta = c(0.1),
perplexity = c(60))
```

We recommend 3D vizualisation by setting `dims = 3`,
Expand All @@ -188,8 +189,8 @@ set.seed(9)
tsne.map2 <- tsneVisualization(protein.data = df,
markerProteins = r.markers,
dims = 2,
theta = c(0.1, 0.2, 0.3, 0.4, 0.5),
perplexity = c(5, 10, 20, 30, 40, 50, 60))
theta = c(0.5),
perplexity = c(60))
```

## Build model and classify proteins
Expand Down

0 comments on commit 4a3299a

Please sign in to comment.