Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oncoprintplus #33

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@
<package name="R" version="3.2.1" />
</repository>
<package>https://cran.r-project.org/src/contrib/RColorBrewer_1.1-2.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/lattice_0.20-33.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/lattice/lattice_0.20-33.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/latticeExtra/latticeExtra_0.6-26.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/R.methodsS3/R.methodsS3_1.7.0.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/hexbin_1.27.1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/hexbin/hexbin_1.27.0.tar.gz</package>
<package>http://bpg.oicr.on.ca/src/contrib/BoutrosLab.plotting.general_5.3.4.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/proto_0.3-10.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/proto/proto_0.3-10.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/findpython_1.0.1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/getopt_1.20.0.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/rjson_0.2.15.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/argparse_1.0.1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/argparse/argparse_1.0.1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/assertthat_0.1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/R6_2.1.3.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Rcpp_0.12.6.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/R6/R6_2.1.3.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/Rcpp/Rcpp_0.12.6.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/lazyeval_0.2.0.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/tibble_1.1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/tibble/tibble_1.1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/magrittr_1.5.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/DBI_0.5.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/BH_1.60.0-2.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/DBI/DBI_0.5.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/Archive/BH/BH_1.60.0-1.tar.gz</package>
<package>https://cran.r-project.org/src/contrib/dplyr_0.5.0.tar.gz</package>
</action>
</actions>
Expand Down
7 changes: 7 additions & 0 deletions tools/maftools/.shed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
categories:
- Variant Analysis
description: MAFTools - a suite of visualizations for summarizing MAF files
name: maftools
owner: morinlab
remote_repository_url: https://github.com/morinlab/tools-morinlab/tree/master/tools/maftools
type: unrestricted
18 changes: 18 additions & 0 deletions tools/maftools/all_fasta.loc.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#This file lists the locations and dbkeys of all the fasta files
#under the "genome" directory (a directory that contains a directory
#for each build). The script extract_fasta.py will generate the file
#all_fasta.loc. This file has the format (white space characters are
#TAB characters):
#
#<unique_build_id> <dbkey> <display_name> <file_path>
#
#So, all_fasta.loc could look something like this:
#
#apiMel3 apiMel3 Honeybee (Apis mellifera): apiMel3 /path/to/genome/apiMel3/apiMel3.fa
#hg19canon hg19 Human (Homo sapiens): hg19 Canonical /path/to/genome/hg19/hg19canon.fa
#hg19full hg19 Human (Homo sapiens): hg19 Full /path/to/genome/hg19/hg19full.fa
#
#Your all_fasta.loc file should contain an entry for each individual
#fasta file. So there will be multiple fasta files for each build,
#such as with hg19 above.
#
33 changes: 33 additions & 0 deletions tools/maftools/gene_cloud.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require(maftools);
library(argparse);

###

parser <- ArgumentParser(description="Create a Gene Lollipop using Maftools");

parser$add_argument(
"--input_maf", "-maf",
required="True",
help="Input Variants in MAF format"
);

parser$add_argument(
"--min_mutations", "-m",
required="True",
help="Minimum number of mutations for each included gene"
)

parser$add_argument(
"--output_pdf", "-o",
required="True",
help="Output PDF"
)

args <- parser$parse_args();

###

laml = read.maf(maf = args$input_maf, removeSilent = T, useAll = T)
pdf(args$output_pdf)
geneCloud(input = laml, minMut = args$min_mutations)
dev.off()
25 changes: 25 additions & 0 deletions tools/maftools/gene_cloud.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<tool id="gene_cloud" name="Gene Cloud Plot" version="0.9.30">

<description>
creates a cloud plot where gene names are sized by mutation rate
</description>

<command detect_errors="aggressive">

Rscript $__tool_directory__/gene_cloud.R
--input_maf $input_maf
--min_mutations $min_mutations
--output_pdf $output

</command>

<inputs>
<param type="data" format="maf" name="input_maf" label="MAF File"/>
<param type="integer" min="1" value="3" name="min_mutations" label="Minimum mutation count to include gene"/>
</inputs>

<outputs>
<data format="pdf" name="output"/>
</outputs>

</tool>
39 changes: 39 additions & 0 deletions tools/maftools/lollipop.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require(maftools);
library(argparse);

###

parser <- ArgumentParser(description="Create a Gene Lollipop using Maftools");

parser$add_argument(
"--input_maf", "-maf",
required="True",
help="Input Variants in MAF format"
);

parser$add_argument(
"--gene_list", "-gl",
required="True",
help="Input gene list with separated by newline"
);

parser$add_argument(
"--output_directory", "-o",
required="True",
help="Output directory to store gene plots"
)

args <- parser$parse_args();

###

all_genes <- read.table(args$gene_list, stringsAsFactors=FALSE)[,1]
laml = read.maf(maf = args$input_maf, removeSilent = T, useAll = T)
count = 1
for (gene in all_genes) {
output_name = paste(args$output_directory, paste("samp", count, ".pdf", sep=""), sep="/")
pdf(output_name)
lollipopPlot(maf = laml, gene = gene, AACol = 'amino_acid_change', labelPos = 'all')
dev.off()
count <- count + 1
}
46 changes: 46 additions & 0 deletions tools/maftools/lollipop.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<tool id="lollipop" name="Lollipop Plot" version="0.9.30">

<description>
gene summary plots
</description>

<command detect_errors="aggressive">

mkdir outputs;
touch gene_list.txt;
#if $gene_input_type.gene_input_type_selector.value == "other":
echo $gene_input_type.gene > gene_list.txt;
#else:
cat $gene_input_type.gene_file > gene_list.txt;
#end if

Rscript $__tool_directory__/lollipop.R
--input_maf $input_maf
--gene_list gene_list.txt
--output_directory \$(pwd)/outputs;

</command>

<inputs>
<param type="data" format="maf" name="input_maf" label="MAF File"/>
<conditional name="gene_input_type">
<param name="gene_input_type_selector" type="select" label="Choose how to input genes">
<option value="file" selected="True">Gene File</option>
<option value="other">Other</option>
</param>
<when value="file">
<param name="gene_file" type="data" format="txt" label="Gene File" help="list of genes separated by newlines" />
</when>
<when value="other">
<param name="gene" type="text" value="TP53" label="Gene" help="type the single gene" />
</when>
</conditional>
</inputs>

<outputs>
<collection name="list_output" type="list" description="Gene Lollipop Plots">
<discover_datasets pattern="__name_and_ext__" directory="outputs"/>
</collection>
</outputs>

</tool>
27 changes: 27 additions & 0 deletions tools/maftools/maf_summary.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
require(maftools);
library(argparse);

###

parser <- ArgumentParser(description="Create a Gene Lollipop using Maftools");

parser$add_argument(
"--input_maf", "-maf",
required="True",
help="Input Variants in MAF format"
);

parser$add_argument(
"--output_pdf", "-o",
required="True",
help="Output directory to store gene plots"
)

args <- parser$parse_args();

###

laml = read.maf(maf = args$input_maf, removeSilent = T, useAll = T)
pdf(args$output_pdf)
plotmafSummary(maf = laml, rmOutlier = T, addStat = 'median', dashboard = TRUE)
dev.off()
23 changes: 23 additions & 0 deletions tools/maftools/maf_summary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<tool id="maf_summary" name="MAF Summary Plot" version="0.9.30">

<description>
summarizes maf statistics into single multiplot
</description>

<command detect_error="aggressive">

Rscript $__tool_directory__/maf_summary.R
--input_maf $input_maf
--output_pdf $output;

</command>

<inputs>
<param type="data" format="maf" name="input_maf" label="MAF File"/>
</inputs>

<outputs>
<data format="pdf" name="output"/>
</outputs>

</tool>
33 changes: 33 additions & 0 deletions tools/maftools/oncoplot.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
require(maftools);
library(argparse);

###

parser <- ArgumentParser(description="Create a Gene Lollipop using Maftools");

parser$add_argument(
"--input_maf", "-maf",
required="True",
help="Input Variants in MAF format"
);

parser$add_argument(
"--top", "-t",
required="True",
help="The Top [val] genes to include in plot"
)

parser$add_argument(
"--output_pdf", "-o",
required="True",
help="Output directory to store gene plots"
)

args <- parser$parse_args();

###

laml = read.maf(maf = args$input_maf, removeSilent = T, useAll = T)
pdf(args$output_pdf)
oncoplot(maf = laml, top=args$top)
dev.off()
25 changes: 25 additions & 0 deletions tools/maftools/oncoplot.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<tool id="oncoplot" name="MAF Oncoplot" version="0.9.30">

<description>
summarizes top mutated genes by mutual exclusivity
</description>

<command detect_errors="aggressive">

Rscript $__tool_directory__/oncoplot.R
--input_maf $input_maf
--top $top
--output_pdf $output;

</command>

<inputs>
<param type="data" format="maf" name="input_maf" label="MAF File"/>
<param type="integer" min="1" value="10" name="top" label="Top Gene Count"/>
</inputs>

<outputs>
<data format="pdf" name="output"/>
</outputs>

</tool>
39 changes: 39 additions & 0 deletions tools/maftools/rainfall.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
require(maftools);
library(argparse);

###

parser <- ArgumentParser(description="Create a Gene Lollipop using Maftools");

parser$add_argument(
"--input_maf", "-maf",
required="True",
help="Input Variants in MAF format"
);

parser$add_argument(
"--sample_list", "-sl",
required="True",
help="Input sample list separated by newline"
);

parser$add_argument(
"--output_directory", "-o",
required="True",
help="Output directory to store rainfall plots"
)

args <- parser$parse_args();

###

all_samples <- read.table(args$sample_list, stringsAsFactors=FALSE)[,1]
laml = read.maf(maf = args$input_maf, removeSilent = T, useAll = T)
count = 1
for (sample in all_samples) {
output_name = paste(args$output_directory, paste("samp", count, ".pdf", sep=""), sep="/")
pdf(output_name)
rainfallPlot(maf = laml, tsb = sample)
dev.off()
count <- count + 1
}
Loading