This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### | |
## AUTHOR: BRIAN M. BOT | |
## ORGANIZATION: SAGE BIONETWORKS | |
## | |
## ALLOW USERS TO LEVERAGE KNITR WHEN CONSTRUCTING SYNAPSE WIKI CONTENT | |
##### | |
## PARAMETERS: | |
## file: path to a local .Rmd file which to knit | |
## owner: a Synapse object which will own the resulting WikiPage (usually a Project, Folder, or File) | |
## parentWikiId (optional): if the resulting WikiPage is to be a subpage of another WikiPage, this is the id for the parent WikiPage (NOTE: owner is still required) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### | |
## AUTHOR: BRIAN M. BOT | |
## ORGANIZATION: SAGE BIONETWORKS | |
## | |
## FUNCTION TO RENDER SYNAPSE-SPECIFIC MARKDOWN FOR TABLE RENDERING | |
##### | |
## PARAMETERS: | |
## x: an R object of class data.frame, matrix, or table | |
## row.names (=TRUE): whether or not to include row names in the table (if available) | |
## col.names (=TRUE): whether or not to include column names in the table (if available) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##### | |
## FUNCTION FOR COPYING ALL SYNAPSE WIKI CONTENT (AND SUBPAGES) FROM ONE OWNER RESOURCE TO ANOTHER | |
## AUTHOR: BRIAN M. BOT | |
##### | |
## ARGUMENTS: | |
## oldOwnerId - the Synapse ID of the resource (e.g. Project) to copy the wiki content from | |
## newOwnerId - the Synapse ID of the resource (e.g. Project) to copy the wiki content to | |
##### | |
## VALUE: | |
## Silently returns the Wiki headers from the new owner |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runAttractorInCRCSC <- function(projectId){ | |
require(synapseClient) | |
thisFile <- "https://gist.github.com/brian-bot/3f2b74694f58404c93fd" | |
## PULL FROM THE LINK THAT WAS CREATED IN THE PROJECT AT AN EARLIER STAGE | |
findLink <- synapseQuery(paste('SELECT id, name FROM link WHERE benefactorId=="', projectId, '"')) | |
resolveLink <- synGet(findLink$link.id[findLink$link.name=="COAD.attractors.rnaseq.txt"][1]) | |
## GET THE ATTRACTOR METAGENES FOR TCGA COAD FROM THE LINK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## NBA DRAFT ODDS - CHANCES OF 'CHALK' | |
chancesInOrder <- c(250, 199, 156, 119, 88, 63, 43, 28, 17, 11, 8, 7, 6, 5) | |
conditionalProb <- 1 | |
for(i in 1:3){ | |
conditionalProb <- conditionalProb*chancesInOrder[i]/sum(chancesInOrder[i:length(chancesInOrder)]) | |
} | |
conditionalProb | |
# > conditionalProb |