Skip to content

Commit

Permalink
Commit made by the Bioconductor Git-SVN bridge.
Browse files Browse the repository at this point in the history
Consists of 1 commit(s).

Commit information:

    Commit id: 8867577
    Commit message:
    Fix silly typos and refactor polyfunctionality plotting code
    Committed by Kevin Ushey <kevinushey at gmail.com>
    Commit date: 2014-03-24T15:39:00-07:00

From: Bioconductor Git-SVN Bridge <[email protected]>

git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/COMPASS@87819 bc3139a8-67e5-0310-9ffc-ced21a209358
  • Loading branch information
Kevin Ushey committed Mar 24, 2014
1 parent ed0b11b commit 3b2992b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: COMPASS
Type: Package
Title: Combinatorial Polyfunctionality Analysis of Single Cells
Version: 1.1.5
Version: 1.1.5-1
Date: 2014-02-11
Authors@R: c( person("Lynn", "Lin", role="aut", email="[email protected]"),
person("Kevin", "Ushey", role=c("aut", "cre"), email="[email protected]"),
Expand Down
61 changes: 34 additions & 27 deletions inst/shiny/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ shinyServer( function(input, output, session) {

getFacet2 <- reactive({
if (input$facet2 == "None") return(NULL)
else return( input$facet1 )
else return( input$facet2 )
})

getFacet3 <- reactive({
if (input$facet3 == "None") return(NULL)
else return( input$facet1 )
else return( input$facet3 )
})

getSample <- reactive({
Expand Down Expand Up @@ -320,6 +320,8 @@ shinyServer( function(input, output, session) {

facet1 <- getFacet1()
facet2 <- getFacet2()
facet3 <- getFacet3()

filter1 <- getFilter1()
filter1_cb <- getFilter1Cb()

Expand Down Expand Up @@ -347,39 +349,44 @@ shinyServer( function(input, output, session) {
value.name="Score"
)

if (!is.null(facet1)) {
if (!is.null(facet3)) {

if (!is.null(facet2)) {

p <- ggplot(pf, aes_string(y="Score", x=facet2, fill=facet1)) +
geom_boxplot(outlier.size = 0) +
facet_wrap(~ FunctionalityType, scales="free_y") +
geom_point( position=position_jitterdodge() )

} else {

p <- ggplot(pf, aes_string(y="Score", x="factor(1)", fill=facet1)) +
geom_boxplot(outlier.size = 0) +
facet_wrap(~ FunctionalityType, scales="free_y") +
xlab("") +
geom_point( position=position_jitterdodge() ) +
theme(
axis.text.x=element_blank(),
axis.ticks.x=element_blank()
)

}
p <- ggplot(pf, aes_string(y="Score", x=facet2, fill=facet1)) +
geom_boxplot(outlier.size = 0) +
geom_point(position=position_jitterdodge()) +
facet_grid(paste(facet3, "~", "FunctionalityType"), scales="free_y")

} else {
} else if (!is.null(facet2)) {

p <- ggplot(pf, aes_string(x=factor(1), y="Score")) +
p <- ggplot(pf, aes_string(y="Score", x=facet2, fill=facet1)) +
geom_boxplot(outlier.size = 0) +
geom_point(position=position_jitterdodge()) +
facet_wrap(~ FunctionalityType, scales="free_y")

} else if (!is.null(facet1)) {

p <- ggplot(pf, aes_string(x="factor(1)", y="Score", fill=facet1)) +
geom_boxplot(outlier.size = 0) +
geom_point(position=position_jitterdodge()) +
facet_wrap(~ FunctionalityType, scales="free_y") +
xlab("") +
geom_point( position=position_jitter(width=0.1) )
theme(
axis.text.x=element_blank(),
axis.ticks.x=element_blank()
)

} else {

p <- ggplot(pf, aes_string(x="factor(1)", y="Score")) +
geom_boxplot(outlier.size = 0) +
geom_point(position=position_jitter()) +
facet_wrap(~ FunctionalityType, scales="free_y") +
xlab("")

}

p <- p + ggtitle("Functionality Scores") +
p <- p +
ggtitle("Functionality Scores") +
theme(plot.title=element_text(face="bold", size=12, vjust=1))

print(p)
Expand Down

0 comments on commit 3b2992b

Please sign in to comment.