Mercurial > repos > devteam > cummerbund
changeset 0:e462121e8269 draft
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/cummerbund commit 5a4e0ca9992af3a6e5ed2b533f04bb82ce761e0b
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cummeRbund.R Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,146 @@ +## Feature Selection ## +get_features <- function(myGenes, f="gene") { + if (f == "isoforms") + return(isoforms(myGenes)) + else if (f == "tss") + return(TSS(myGenes)) + else if (f == "cds") + return(CDS(myGenes)) + else + return(myGenes) +} + +## Main Function ## + +library(argparse) + +parser <- ArgumentParser(description='Create a plot with cummeRbund') + +parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +parser$add_argument('--features', dest='features', action="store", default="genes") +parser$add_argument('--clustering', dest='clustering', action="store", default="both") +parser$add_argument('--iter_max', dest='iter_max', action="store") +parser$add_argument('--genes', dest='genes', action="append") +parser$add_argument('--k', dest='k', action="store") +parser$add_argument('--x', dest='x', action="store") +parser$add_argument('--y', dest='y', action="store") + +args <- parser$parse_args() + +## Load cummeRbund library +library("cummeRbund") + +## Initialize cuff object +cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) + +## Print out info +print(cuff) +sink("cuffdb_info.txt") +print(cuff) +print("SAMPLES:") +samples(cuff) +print("REPLICATES:") +replicates(cuff) +print("FEATURES:") +print(annotation(genes(cuff))) +cat(annotation(genes(cuff))[[1]],sep=",") +sink() + +png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +tryCatch({ + if (args$plotType == 'density') { + csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) + } + else if (args$plotType == 'boxplot') { + csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) + } + else if (args$plotType == 'mds') { + MDSplot(genes(cuff), replicates=args$replicates) + } + else if (args$plotType == 'pca') { + PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) + } + else if (args$plotType == 'dendrogram') { + csDendro(genes(cuff), replicates=args$replicates) + } + else if (args$plotType == 'scatter') { + if (args$gene_selector) { + myGenes <- getGenes(cuff, args$genes) + csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) + } + else { + csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) + } + } + else if (args$plotType == 'volcano') { + if (args$gene_selector) { + myGenes <- get_features(getGenes(cuff, args$genes), args$features) + } + else { + myGenes <- genes(cuff) + } + csVolcano(myGenes, args$x, args$y) + } + else if (args$plotType == 'heatmap') { + if (args$gene_selector) { + myGenes <- getGenes(cuff, args$genes) + } + else { + myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) + } + csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) + } + else if (args$plotType == 'cluster') { + myGenes <- getGenes(cuff, args$genes) + csCluster(get_features(myGenes, args$features), k=args$k) + } + else if (args$plotType == 'dispersion') { + dispersionPlot(genes(cuff)) + } + else if (args$plotType == 'fpkmSCV') { + fpkmSCVPlot(genes(cuff)) + } + else if (args$plotType == 'scatterMatrix') { + csScatterMatrix(genes(cuff)) + } + else if (args$plotType == 'expressionplot') { + myGenes <- getGenes(cuff, args$genes) + expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) + } + else if (args$plotType == 'expressionbarplot') { + myGeneId <- args$genes + myGenes <- getGenes(cuff, myGeneId) + expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) + } + else if (args$plotType == 'mds') { + MDSplot(genes(cuff),replicates=args$replicates) + } + else if (args$plotType == 'pca') { + PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) + } + else if (args$plotType == 'maplot') { + MAplot(genes(cuff), args$x, args$y, useCount=args$count) + } + else if (args$plotType == 'genetrack') { + myGene <- getGene(cuff, args$genes) + plotTracks(makeGeneRegionTrack(myGene)) + } +},error = function(e) { + write(paste("Failed:", e, sep=" "), stderr()) + q("no", 1, TRUE) +}) +devname = dev.off()
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cummeRbund.xml Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,361 @@ +<?xml version="1.0"?> +<tool id="cummeRbund" name="cummeRbund" version="1.0.1"> + <description>visualize Cuffdiff output</description> + <requirements> + <requirement type="set_environment">CUMMERBUND_SCRIPT_PATH</requirement> + <requirement type="package" version="3.1.2">R</requirement> + <requirement type="package" version="2.8.2">cummeRbund</requirement> + </requirements> + <expand macro="stdio" /> + <macros> + <import>cummeRbund_macros.xml</import> + </macros> + <code file="cummeRbund_options.py"/> + <command> +<![CDATA[ +#for i, p in enumerate($plots): + R --vanilla --no-save -f \$CUMMERBUND_SCRIPT_PATH/cummeRbund.R --args + --input "${input_database}" --width $p.width --height $p.height --type "${p.plot.type}" + --outfile plot-${p.plot.type}-${i}.png + #if $p.plot.type in ["density", "boxplot", "mds", "pca", "dendrogram"]: + $p.plot.replicates + #elif $p.plot.type == "scatter": + $p.plot.smooth --x "$p.plot.x" --y "$p.plot.y" $p.plot.log10 + #if $p.plot.multiple_genes.multiple_genes_selector == "yes": + --features $p.plot.multiple_genes.features --gene_selector + #for gene in $p.plot.multiple_genes.genes: + --genes ${gene.gene_id} + #end for + #end if + #elif $p.plot.type == "maplot": + --x "$p.plot.x" --y "$p.plot.y" $p.plot.count + #elif $p.plot.type == "volcano": + --x "$p.plot.x" --y "$p.plot.y" + #if $p.plot.multiple_genes.multiple_genes_selector == "yes": + --features $p.plot.multiple_genes.features --gene_selector + #for gene in $p.plot.multiple_genes.genes: + --genes ${gene.gene_id} + #end for + #end if + #elif $p.plot.type == "heatmap": + --clustering "$p.plot.clustering" $p.plot.labcol $p.plot.labrow $p.plot.border --features $p.plot.features $p.plot.log10 + #if len($p.plot.genes) > 0: + #for gene in $p.plot.genes: + --genes ${gene.gene_id} + #end for + #end if + #elif $p.plot.type == "cluster": + --features $p.plot.features --k $p.plot.k --iter_max $p.plot.iter_max + #if len($p.plot.genes) > 0: + #for gene in $p.plot.genes: + --genes ${gene.gene_id} + #end for + #end if + #elif $p.plot.type in [ "expressionplot", "expressionbarplot" ]: + #if $p.plot.type == "expressionplot": + $p.plot.draw_summary + #end if + --features $p.plot.features $p.plot.error_bars --genes ${p.plot.gene_id} $p.plot.replicates $p.plot.log10 + #end if + #if $p.plot.type == "density": + $p.plot.log10 + #end if + > "${output}" 2>&1 ; +#end for +]]></command> + <inputs> + <param name="input_database" type="data" format="sqlite" label="Select backend database (sqlite)" /> + <repeat name="plots" title="Plots"> + <param name="width" type="integer" value="1280" label="The width of the image"/> + <param name="height" type="integer" value="960" label="The height of the image"/> + <conditional name="plot"> + <param name="type" type="select" label="Plot type"> + <option value="density" selected="true">Density</option> + <option value="boxplot">Boxplot</option> + <option value="mds">MultiDimentional Scaling (MDS) Plot</option> + <option value="pca">Principal Component Analysis (PCA) Plot</option> + <option value="dendrogram">Dendrogram</option> + <option value="scatter">Scatter</option> + <option value="volcano">Volcano</option> + <option value="heatmap">Heatmap</option> + <option value="dispersion">Dispersion</option> + <option value="fpkmSCV">Squared Coefficient of Variation</option> + <option value="scatterMatrix">Scatter Matrix</option> + <option value="cluster">Cluster</option> + <option value="expressionplot">Expression Plot</option> + <option value="expressionbarplot">Expression Bar Plot</option> + <option value="maplot">Intensity vs Fold-change (MvaA) Plot</option> + </param> + <when value="density"> + <expand macro="replicates_checkbox" /> + <expand macro="log10_checkbox" /> + </when> + <when value="mds"> + <expand macro="replicates_checkbox" /> + </when> + <when value="pca"> + <expand macro="replicates_checkbox" /> + </when> + <when value="boxplot"> + <expand macro="replicates_checkbox" /> + <expand macro="log10_checkbox" /> + </when> + <when value="dendrogram"> + <expand macro="replicates_checkbox" /> + </when> + <when value="scatter"> + <expand macro="xy_selector" /> + <expand macro="log10_checkbox" /> + <param name="smooth" type="boolean" truevalue="--smooth" falsevalue="" checked="True" label="Add a smooth-fit regression line"/> + <expand macro="multiple_genes_conditional" /> + </when> + <when value="volcano"> + <param name="x" type="select" label="First sample name for comparison" dynamic_options="get_samples(input_database.dataset.file_name)" /> + <param name="y" type="select" label="Second sample name for comparison" dynamic_options="get_samples(input_database.dataset.file_name)" /> + <expand macro="multiple_genes_conditional" /> + </when> + <when value="heatmap"> + <expand macro="features_selector" /> + <expand macro="genes_selector" /> + <param name="clustering" type="select" label="Cluster by"> + <option value="row">Row</option> + <option value="column">Column</option> + <option value="both" selected="true">Both</option> + <option value="none">None</option> + </param> + <param name="labcol" type="boolean" truevalue="--labcol" falsevalue="" checked="True" label="Display column labels?"/> + <param name="labrow" type="boolean" truevalue="--labrow" falsevalue="" checked="True" label="Display column labels?"/> + <param name="border" type="boolean" truevalue="--border" falsevalue="" checked="False" label="Draw border around plot?"/> + <expand macro="log10_checkbox" /> + </when> + <when value="cluster"> + <expand macro="features_selector" /> + <expand macro="genes_selector" /> + <param name="k" type="integer" value="1" label="Number of pre-defined clusters to attempt to find."/> + <param name="iter_max" type="integer" value="100" label="Max iterations"/> + </when> + <when value="maplot"> + <expand macro="xy_selector" /> + <param name="count" type="boolean" truevalue="--count" falsevalue="" checked="False" label="Use Count?"/> + </when> + <when value="dispersion" /> + <when value="fpkmSCV" /> + <when value="scatterMatrix" /> + <when value="expressionplot"> + <expand macro="features_selector" /> + <param name="gene_id" type="select" label="Gene ID" dynamic_options="get_genes(input_database.dataset.file_name)" /> + <param name="draw_summary" type="boolean" truevalue="--summary" falsevalue="" checked="False" label="Draw a 'summary' line with mean FPKM values for each condition?"/> + <param name="error_bars" type="boolean" truevalue="--error_bars" falsevalue="" checked="True" label="Draw error bars?"/> + <expand macro="replicates_checkbox" /> + <expand macro="log10_checkbox" /> + </when> + <when value="expressionbarplot"> + <expand macro="features_selector" /> + <param name="gene_id" type="select" label="Gene ID" dynamic_options="get_genes(input_database.dataset.file_name)" /> + <param name="error_bars" type="boolean" truevalue="--error_bars" falsevalue="" checked="True" label="Draw error bars?"/> + <expand macro="replicates_checkbox" /> + <expand macro="log10_checkbox" /> + </when> + </conditional> + </repeat> + </inputs> + <outputs> + <data format="txt" name="output" label="${tool.name} on ${on_string}"> + <discover_datasets pattern="plot-(?P<designation>.+)\.png" ext="png" visible="true" /> + </data> + </outputs> + <tests> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="maplot" /> + <param name="x" value="q1" /> + <param name="y" value="q2" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="maplot.txt" lines_diff="2"> + <discovered_dataset designation="maplot-0" ftype="png" file="maplot.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="scatter" /> + <param name="x" value="q1" /> + <param name="y" value="q2" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="scatter.txt" lines_diff="2"> + <discovered_dataset designation="scatter-0" ftype="png" file="scatter.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="dispersion" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="dispersion.txt" lines_diff="2"> + <discovered_dataset designation="dispersion-0" ftype="png" file="dispersion.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="scatterMatrix" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="scatterMatrix.txt" lines_diff="2"> + <discovered_dataset designation="scatterMatrix-0" ftype="png" file="scatterMatrix.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="pca" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="pca.txt" lines_diff="2"> + <discovered_dataset designation="pca-0" ftype="png" file="pca.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="expressionplot" /> + <param name="features" value="gene" /> + <param name="gene_id" value="XLOC_000059" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="expressionplot.txt" lines_diff="2"> + <discovered_dataset designation="expressionplot-0" ftype="png" file="expressionplot.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="features" value="gene" /> + <param name="type" value="expressionbarplot" /> + <param name="gene_id" value="XLOC_000039" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="expressionbarplot.txt" lines_diff="2"> + <discovered_dataset designation="expressionbarplot-0" ftype="png" file="expressionbarplot.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="heatmap" /> + <repeat name="genes"> + <param name="gene_id" value="XLOC_000078" /> + </repeat> + </conditional> + </repeat> + <output name="output" ftype="txt" file="heatmap.txt" lines_diff="2"> + <discovered_dataset designation="heatmap-0" ftype="png" file="heatmap.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="density" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="density.txt" lines_diff="2"> + <discovered_dataset designation="density-0" ftype="png" file="density.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="dendrogram" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="dendrogram.txt" lines_diff="2"> + <discovered_dataset designation="dendrogram-0" ftype="png" file="dendrogram.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="volcano" /> + <param name="x" value="q1" /> + <param name="y" value="q2" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="volcano.txt" lines_diff="2"> + <discovered_dataset designation="volcano-0" ftype="png" file="volcano.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="boxplot" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="boxplot.txt" lines_diff="2"> + <discovered_dataset designation="boxplot-0" ftype="png" file="boxplot.png" /> + </output> + </test> + <test> + <param name="input_database" value="cuffdiff_out.sqlite" ftype="sqlite" /> + <repeat name="plots"> + <param name="width" value="1280" /> + <param name="height" value="960" /> + <conditional name="plot"> + <param name="type" value="fpkmSCV" /> + </conditional> + </repeat> + <output name="output" ftype="txt" file="fpkmSCV.txt" lines_diff="2"> + <discovered_dataset designation="fpkmSCV-0" ftype="png" file="fpkmSCV.png" /> + </output> + </test> + </tests> + <help><![CDATA[ +This tool allows for persistent storage, access, exploration, and manipulation of Cufflinks high-throughput sequencing data. In addition, provides numerous plotting functions for commonly used visualizations. + +------ + +Based on the `cummeRbund wrapper <http://toolshed.bx.psu.edu/view/jjohnson/cummerbund>`_ written by James E. Johnson of the Minnesota Supercomputing Institute. + ]]></help> + <citations> + <citation type="doi">doi:10.1038/nprot.2012.016</citation> + </citations> +</tool>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cummeRbund_macros.xml Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,47 @@ +<?xml version="1.0"?> +<macros> + <macro name="stdio"> + <stdio> + <exit_code range="1:" /> + <exit_code range=":-1" /> + <regex match="Error:" /> + <regex match="Exception:" /> + </stdio> + </macro> + <macro name="replicates_checkbox"> + <param name="replicates" type="boolean" truevalue="--replicates" falsevalue="" checked="True" label="Replicates?"/> + </macro> + <macro name="log10_checkbox"> + <param name="log10" type="boolean" truevalue="--log10" falsevalue="" checked="True" label="Apply log10 transformation on FPKM values?"/> + </macro> + <macro name="xy_selector"> + <param name="x" type="select" label="Sample name for x axis" dynamic_options="get_samples(input_database.dataset.file_name)" /> + <param name="y" type="select" label="Sample name for y axis" dynamic_options="get_samples(input_database.dataset.file_name)" /> + </macro> + <macro name="genes_selector"> + <repeat name="genes" title="Genes"> + <param name="gene_id" type="select" label="Gene ID" dynamic_options="get_genes(input_database.dataset.file_name)" /> + </repeat> + </macro> + <macro name="features_selector"> + <param name="features" type="select" label="Expression levels to plot?"> + <option value="gene" selected="true">Genes</option> + <option value="isoforms">Isoforms</option> + <option value="tss">TSS</option> + <option value="cds">CDS</option> + </param> + </macro> + <macro name="multiple_genes_conditional"> + <conditional name="multiple_genes"> + <param name="multiple_genes_selector" type="select" label="Limit plot to genes"> + <option value="no" selected="true">Do not limit</option> + <option value="yes">Select genes</option> + </param> + <when value="yes"> + <expand macro="features_selector" /> + <expand macro="genes_selector" /> + </when> + <when value="no" /> + </conditional> + </macro> +</macros>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cummeRbund_options.py Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,11 @@ +import sqlite3 + +def get_genes( database_path ): + conn = sqlite3.connect( database_path ) + gene_ids = conn.execute( 'SELECT gene_short_name, gene_id FROM genes ORDER BY gene_short_name' ) + return [ ( gene_id[ 0 ], gene_id[ 1 ], False ) for gene_id in gene_ids ] + +def get_samples( database_path ): + conn = sqlite3.connect( database_path ) + samples = conn.execute( 'SELECT sample_name FROM samples ORDER BY sample_name' ) + return [ ( sample[ 0 ], sample[ 0 ], False ) for sample in samples ]
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/boxplot.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,308 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-boxplot-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmpCu9yWT/tmpPy7OpW/database/files/000/dataset_34.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "boxplot" + +$replicates +[1] TRUE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/dendrogram.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,309 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-dendrogram-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmp3exXG8/tmpuNktUy/database/files/000/dataset_43.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "dendrogram" + +$replicates +[1] TRUE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +'dendrogram' with 2 branches and 2 members total, at height 0.7672512 +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/density.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,311 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-density-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmpqBHFSU/tmpJRwxiS/database/files/001/dataset_1450.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] TRUE + +$plotType +[1] "density" + +$replicates +[1] TRUE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +Warning messages: +1: Removed 65 rows containing non-finite values (stat_density). +2: Removed 63 rows containing non-finite values (stat_density). +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/dispersion.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,308 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-dispersion-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmp3exXG8/tmpuNktUy/database/files/000/dataset_25.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "dispersion" + +$replicates +[1] FALSE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/expressionbarplot.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,340 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] TRUE + +$features +[1] "gene" + +$filename +[1] "plot-expressionbarplot-0.png" + +$gene_selector +[1] FALSE + +$genes +[1] "XLOC_000039" + +$height +[1] 960 + +$input_database +[1] "/tmp/tmpCu9yWT/tmpPy7OpW/database/files/000/dataset_19.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] TRUE + +$plotType +[1] "expressionbarplot" + +$replicates +[1] TRUE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Getting gene information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting isoforms information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting CDS information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting TSS information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting promoter information: + distData +Getting splicing information: + distData +Getting relCDS information: + distData +Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale. +ymax not defined: adjusting position using y instead +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/expressionplot.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,338 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] TRUE + +$features +[1] "gene" + +$filename +[1] "plot-expressionplot-0.png" + +$gene_selector +[1] FALSE + +$genes +[1] "XLOC_000059" + +$height +[1] 960 + +$input_database +[1] "/tmp/tmpNZmIuK/tmpbebRiN/database/files/000/dataset_94.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] TRUE + +$plotType +[1] "expressionplot" + +$replicates +[1] TRUE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Getting gene information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting isoforms information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting CDS information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting TSS information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting promoter information: + distData +Getting splicing information: + distData +Getting relCDS information: + distData +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/fpkmSCV.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,313 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-fpkmSCV-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmp3exXG8/tmpuNktUy/database/files/000/dataset_49.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "fpkmSCV" + +$replicates +[1] FALSE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Scale for 'x' is already present. Adding another scale for 'x', which will replace the existing scale. +geom_smooth: method="auto" and size of largest group is <1000, so using loess. Use 'method = x' to change the smoothing method. +Fontconfig error: Cannot load default config file +Warning message: +In .local(object, FPKMLowerBound, ...) : + At least one of your conditions does not have enough replicates to estimate variance. Estimating variance across all conditions instead. +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/heatmap.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,340 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "gene" + +$filename +[1] "plot-heatmap-0.png" + +$gene_selector +[1] FALSE + +$genes +[1] "XLOC_000078" + +$height +[1] 960 + +$input_database +[1] "/tmp/tmpCu9yWT/tmpPy7OpW/database/files/000/dataset_22.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] TRUE + +$labrow +[1] TRUE + +$log10 +[1] TRUE + +$plotType +[1] "heatmap" + +$replicates +[1] FALSE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Getting gene information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting isoforms information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting CDS information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting TSS information: + FPKM + Differential Expression Data + Annotation Data + Replicate FPKMs + Counts +Getting promoter information: + distData +Getting splicing information: + distData +Getting relCDS information: + distData +Using tracking_id, sample_name as id variables +No id variables; using all as measure variables +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/maplot.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,310 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-maplot-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmpk0xwrM/tmpNNuxXE/database/files/000/dataset_1.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "maplot" + +$replicates +[1] FALSE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +[1] "q1" + +$y +[1] "q2" + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +Warning message: +Removed 52 rows containing missing values (geom_point). +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/pca.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,308 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-pca-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmpY6OfpX/tmpXqSg_D/database/files/000/dataset_13.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "pca" + +$replicates +[1] TRUE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/scatter.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,308 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-scatter-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmp_cslqP/tmpQijFOJ/database/files/000/dataset_55.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] TRUE + +$plotType +[1] "scatter" + +$replicates +[1] FALSE + +$smooth +[1] TRUE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +[1] "q1" + +$y +[1] "q2" + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/scatterMatrix.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,308 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-scatterMatrix-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmp3exXG8/tmpuNktUy/database/files/000/dataset_28.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "scatterMatrix" + +$replicates +[1] FALSE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +NULL + +$y +NULL + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test-data/volcano.txt Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,308 @@ + +R version 3.1.2 (2014-10-31) -- "Pumpkin Helmet" +Copyright (C) 2014 The R Foundation for Statistical Computing +Platform: x86_64-unknown-linux-gnu (64-bit) + +R is free software and comes with ABSOLUTELY NO WARRANTY. +You are welcome to redistribute it under certain conditions. +Type 'license()' or 'licence()' for distribution details. + + Natural language support but running in an English locale + +R is a collaborative project with many contributors. +Type 'contributors()' for more information and +'citation()' on how to cite R or R packages in publications. + +Type 'demo()' for some demos, 'help()' for on-line help, or +'help.start()' for an HTML browser interface to help. +Type 'q()' to quit R. + +> ## Feature Selection ## +> get_features <- function(myGenes, f="gene") { ++ if (f == "isoforms") ++ return(isoforms(myGenes)) ++ else if (f == "tss") ++ return(TSS(myGenes)) ++ else if (f == "cds") ++ return(CDS(myGenes)) ++ else ++ return(myGenes) ++ } +> +> ## Main Function ## +> +> library(argparse) +Loading required package: proto +> +> parser <- ArgumentParser(description='Create a plot with cummeRbund') +> +> parser$add_argument('--type', dest='plotType', default='Density', required=TRUE) +> parser$add_argument('--height', dest='height', type='integer', default=960, required=TRUE) +> parser$add_argument('--width', dest='width', type='integer', default=1280, required=TRUE) +> parser$add_argument('--outfile', dest='filename', default="plot-unknown-0.png", required=TRUE) +> parser$add_argument('--input', dest='input_database', default="cuffData.db", required=TRUE) +> parser$add_argument('--smooth', dest='smooth', action="store_true", default=FALSE) +> parser$add_argument('--gene_selector', dest='gene_selector', action="store_true", default=FALSE) +> parser$add_argument('--replicates', dest='replicates', action="store_true", default=FALSE) +> parser$add_argument('--labcol', dest='labcol', action="store_true", default=FALSE) +> parser$add_argument('--labrow', dest='labrow', action="store_true", default=FALSE) +> parser$add_argument('--border', dest='border', action="store_true", default=FALSE) +> parser$add_argument('--summary', dest='summary', action="store_true", default=FALSE) +> parser$add_argument('--count', dest='count', action="store_true", default=FALSE) +> parser$add_argument('--error_bars', dest='error_bars', action="store_true", default=FALSE) +> parser$add_argument('--log10', dest='log10', action="store_true", default=FALSE) +> parser$add_argument('--features', dest='features', action="store", default="genes") +> parser$add_argument('--clustering', dest='clustering', action="store", default="both") +> parser$add_argument('--iter_max', dest='iter_max', action="store") +> parser$add_argument('--genes', dest='genes', action="append") +> parser$add_argument('--k', dest='k', action="store") +> parser$add_argument('--x', dest='x', action="store") +> parser$add_argument('--y', dest='y', action="store") +> +> args <- parser$parse_args() +> +> print(args) +$border +[1] FALSE + +$clustering +[1] "both" + +$count +[1] FALSE + +$error_bars +[1] FALSE + +$features +[1] "genes" + +$filename +[1] "plot-volcano-0.png" + +$gene_selector +[1] FALSE + +$genes +NULL + +$height +[1] 960 + +$input_database +[1] "/tmp/tmp3exXG8/tmpuNktUy/database/files/000/dataset_46.dat" + +$iter_max +NULL + +$k +NULL + +$labcol +[1] FALSE + +$labrow +[1] FALSE + +$log10 +[1] FALSE + +$plotType +[1] "volcano" + +$replicates +[1] FALSE + +$smooth +[1] FALSE + +$summary +[1] FALSE + +$width +[1] 1280 + +$x +[1] "q1" + +$y +[1] "q2" + +> +> #q() +> +> ## Load cummeRbund library +> library("cummeRbund") +Loading required package: BiocGenerics +Loading required package: parallel + +Attaching package: ‘BiocGenerics’ + +The following objects are masked from ‘package:parallel’: + + clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, + clusterExport, clusterMap, parApply, parCapply, parLapply, + parLapplyLB, parRapply, parSapply, parSapplyLB + +The following object is masked from ‘package:stats’: + + xtabs + +The following objects are masked from ‘package:base’: + + anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, + do.call, duplicated, eval, evalq, Filter, Find, get, intersect, + is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, + pmax.int, pmin, pmin.int, Position, rank, rbind, Reduce, rep.int, + rownames, sapply, setdiff, sort, table, tapply, union, unique, + unlist, unsplit + +Loading required package: RSQLite +Loading required package: DBI +Loading required package: ggplot2 +Loading required package: reshape2 +Loading required package: fastcluster + +Attaching package: ‘fastcluster’ + +The following object is masked from ‘package:stats’: + + hclust + +Loading required package: rtracklayer +Loading required package: GenomicRanges +Loading required package: S4Vectors +Loading required package: stats4 +Loading required package: IRanges +Loading required package: GenomeInfoDb +Loading required package: Gviz +Loading required package: grid + +Attaching package: ‘cummeRbund’ + +The following object is masked from ‘package:GenomicRanges’: + + promoters + +The following object is masked from ‘package:IRanges’: + + promoters + +The following object is masked from ‘package:BiocGenerics’: + + conditions + +> +> ## Initialize cuff object +> cuff <- readCufflinks(dir = "", dbFile = args$input_database, rebuild = FALSE) +> +> ## Print out info +> print(cuff) +CuffSet instance with: + 2 samples + 87 genes + 90 isoforms + 88 TSS + 0 CDS + 87 promoters + 88 splicing + 0 relCDS +> sink("cuffdb_info.txt") +> print(cuff) +> print("SAMPLES:") +> samples(cuff) +> print("REPLICATES:") +> replicates(cuff) +> print("FEATURES:") +> print(annotation(genes(cuff))) +> cat(annotation(genes(cuff))[[1]],sep=",") +> sink() +> +> png(filename = args$filename, width = args$width, height = args$height, type=c('cairo-png')) +> tryCatch({ ++ if (args$plotType == 'density') { ++ csDensity(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'boxplot') { ++ csBoxplot(genes(cuff), replicates=args$replicates, logMode=args$log10) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff), "PC1", "PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'dendrogram') { ++ csDendro(genes(cuff), replicates=args$replicates) ++ } ++ else if (args$plotType == 'scatter') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ csScatter(get_features(myGenes, args$features), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ else { ++ csScatter(genes(cuff), args$x, args$y, smooth=args$smooth, logMode=args$log10) ++ } ++ } ++ else if (args$plotType == 'volcano') { ++ if (args$gene_selector) { ++ myGenes <- get_features(getGenes(cuff, args$genes), args$features) ++ } ++ else { ++ myGenes <- genes(cuff) ++ } ++ csVolcano(myGenes, args$x, args$y) ++ } ++ else if (args$plotType == 'heatmap') { ++ if (args$gene_selector) { ++ myGenes <- getGenes(cuff, args$genes) ++ } ++ else { ++ myGenes <- getGenes(cuff,annotation(genes(cuff))[[1]]) ++ } ++ csHeatmap(get_features(myGenes, args$features), clustering=args$clustering, labCol=args$labcol, labRow=args$labrow, border=args$border, logMode=args$log10) ++ } ++ else if (args$plotType == 'cluster') { ++ myGenes <- getGenes(cuff, args$genes) ++ csCluster(get_features(myGenes, args$features), k=args$k) ++ } ++ else if (args$plotType == 'dispersion') { ++ dispersionPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'fpkmSCV') { ++ fpkmSCVPlot(genes(cuff)) ++ } ++ else if (args$plotType == 'scatterMatrix') { ++ csScatterMatrix(genes(cuff)) ++ } ++ else if (args$plotType == 'expressionplot') { ++ myGenes <- getGenes(cuff, args$genes) ++ expressionPlot(get_features(myGenes, args$features), drawSummary=args$summary, showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'expressionbarplot') { ++ myGeneId <- args$genes ++ myGenes <- getGenes(cuff, myGeneId) ++ expressionBarplot(get_features(myGenes, args$features), showErrorbars=args$error_bars, replicates=args$replicates) ++ } ++ else if (args$plotType == 'mds') { ++ MDSplot(genes(cuff),replicates=args$replicates) ++ } ++ else if (args$plotType == 'pca') { ++ PCAplot(genes(cuff),"PC1","PC2", replicates=args$replicates) ++ } ++ else if (args$plotType == 'maplot') { ++ MAplot(genes(cuff), args$x, args$y, useCount=args$count) ++ } ++ else if (args$plotType == 'genetrack') { ++ myGene <- getGene(cuff, args$genes) ++ plotTracks(makeGeneRegionTrack(myGene)) ++ } ++ },error = function(e) { ++ write(paste("Failed:", e, sep=" "), stderr()) ++ q("no", 1, TRUE) ++ }) +Fontconfig error: Cannot load default config file +> devname = dev.off() +> +> #end for +>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool_dependencies.xml Mon Nov 09 11:27:38 2015 -0500 @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<tool_dependency> + <set_environment version="1.0"> + <environment_variable action="set_to" name="CUMMERBUND_SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable> + </set_environment> + <package name="cummeRbund" version="2.8.2"> + <repository changeset_revision="5892deff54e9" name="package_cummerbund_2_8_2" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + </package> + <package name="R" version="3.1.2"> + <repository changeset_revision="41f43a2064ba" name="package_r_3_1_2" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu" /> + </package> +</tool_dependency>