Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions 7 dockerfiles/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ RUN apt-get update && apt-get install -y \
libpq-dev \
make \
curl \
r-base \
perl-modules \
liburi-perl \
libwww-perl \
Expand Down Expand Up @@ -36,12 +35,16 @@ RUN mkdir -p /var/log/httpd/api.metagenomics/ && \
cd /MG-RAST && \
make

# R dependencies
apt-get install -y r-base r-cran-nlme r-cran-ecodist && \
echo 'install.packages("matlab", repos = "http://cran.wustl.edu")' | R --no-save && \
echo 'source("http://bioconductor.org/biocLite.R"); biocLite("pcaMethods")' | R --no-save

# pipeline dependencies
RUN apt-get install -y \
python-dev \
python-pip \
libtemplate-perl

RUN pip install gspread xlrd openpyxl lepl
RUN cd / && git clone https://github.com/MG-RAST/pipeline.git

Expand Down
4 changes: 3 additions & 1 deletion 4 dockerfiles/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ RUN cd / && git clone https://github.com/MG-RAST/pipeline.git

# 3rd party dependencies
RUN mkdir -p /tools && \
apt-get install -y gcc wget r-base
apt-get install -y gcc wget r-base r-cran-nlme r-cran-ecodist && \
echo 'install.packages("matlab", repos = "http://cran.wustl.edu")' | R --no-save && \
echo 'source("http://bioconductor.org/biocLite.R"); biocLite("pcaMethods")' | R --no-save
RUN cd /tools && \
wget circos.ca/distribution/circos-0.67-7.tgz && \
tar zxvf circos-0.67-7.tgz && \
Expand Down
40 changes: 20 additions & 20 deletions 40 src/MGRAST/r/dendrogram.r
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ MGRAST_dendrograms <<- function(
}

###### load the neccessary packages
if (produce_figures==TRUE)
{
suppressPackageStartupMessages(library(Cairo)) # (### indicates commented out to prevent production of the figure)
}
# if (produce_figures==TRUE)
# {
# suppressPackageStartupMessages(library(Cairo)) # (### indicates commented out to prevent production of the figure)
# }
##### by default, hclust(dist(object)) will produce a row dendrogram of the object
##### get the element counts for the imported object (this will be for the row dendrogram)
##### and for the 90 degree rotated version (for the column dendrogram)
Expand All @@ -124,14 +124,14 @@ MGRAST_dendrograms <<- function(
input_object_row_cluster <- hclust(find_dist(input_object, dist_method), method = clust_method)
input_object_clustered_row_order <- input_object_row_cluster$order

if (produce_figures==TRUE)
{
row_dendrogram_filename = paste(output_files_prefix, ".dist-", dist_method, "_clust-", clust_method, ".row_dendrogram.png")
row_dendrogram_filename = gsub(" ", "", row_dendrogram_filename)
CairoPNG(row_dendrogram_filename, width = row_dendrogram_width , height = row_dendrogram_height , units = "px")
plot(input_object_row_cluster, labels = input_object_row_cluster$labels, hang = -1, ann = FALSE, yaxs = "i") # THIS WORKS
dev.off()
}
# if (produce_figures==TRUE)
# {
# row_dendrogram_filename = paste(output_files_prefix, ".dist-", dist_method, "_clust-", clust_method, ".row_dendrogram.png")
# row_dendrogram_filename = gsub(" ", "", row_dendrogram_filename)
# CairoPNG(row_dendrogram_filename, width = row_dendrogram_width , height = row_dendrogram_height , units = "px")
# plot(input_object_row_cluster, labels = input_object_row_cluster$labels, hang = -1, ann = FALSE, yaxs = "i") # THIS WORKS
# dev.off()
# }
row_labels = matrix(0,1,(dim(matrix(input_object_row_cluster$labels))[1]))

for(i in 1:(dim(matrix(input_object_row_cluster$labels))[1]))
Expand All @@ -142,14 +142,14 @@ MGRAST_dendrograms <<- function(
input_object_col_cluster <- hclust(find_dist(input_object_rot_90, dist_method), method = clust_method)
input_object_clustered_col_order <- input_object_col_cluster$order

if (produce_figures==TRUE)
{
col_dendrogram_filename = paste(output_files_prefix, ".dist-", dist_method, "_clust-", clust_method, ".column_dendrogram.png")
col_dendrogram_filename = gsub(" ", "", col_dendrogram_filename)
CairoPNG(col_dendrogram_filename, width = col_dendrogram_width , height = col_dendrogram_height , units = "px")
plot(input_object_col_cluster, labels = input_object_col_cluster$labels, hang = -1, ann = FALSE, yaxs = "i")
dev.off()
}
# if (produce_figures==TRUE)
# {
# col_dendrogram_filename = paste(output_files_prefix, ".dist-", dist_method, "_clust-", clust_method, ".column_dendrogram.png")
# col_dendrogram_filename = gsub(" ", "", col_dendrogram_filename)
# CairoPNG(col_dendrogram_filename, width = col_dendrogram_width , height = col_dendrogram_height , units = "px")
# plot(input_object_col_cluster, labels = input_object_col_cluster$labels, hang = -1, ann = FALSE, yaxs = "i")
# dev.off()
# }
col_labels = matrix(0,1,(dim(matrix(input_object_col_cluster$labels))[1]))

for(i in 1:(dim(matrix(input_object_col_cluster$labels))[1]))
Expand Down
50 changes: 25 additions & 25 deletions 50 src/MGRAST/r/plot_pca.r
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,31 @@ MGRAST_plot_pca <<- function(file_in,

my_pcaRes <<- pca(input_object, nPcs = num_PCs) # Run pca and create pcaRes object

if (produce_fig == TRUE){ # option to produce figure

suppressPackageStartupMessages(library(Cairo))

CairoPNG(image_out, width = figure_width, height = figure_height, pointsize = 12, res = figure_res , units = "px")

plot(my_pcaRes@loadings[,PC1],
my_pcaRes@loadings[,PC2],
cex.axis = axis_cex,
cex.lab = lab_cex,
main = image_title,
type = "p",
col = points_color,
xlab = paste(PC1, "R^2 =", round(my_pcaRes@R2[PC1], 4)),
ylab = paste(PC2, "R^2 =", round(my_pcaRes@R2[PC2], 4))
)

if (points_color != 0){
points(my_pcaRes@loadings[,PC1], my_pcaRes@loadings[,PC2], col = points_color, pch=19, cex=2 )
# color in the points if the points_color option has a value other than NA
# pch, integer values that indicate different point types (19 is a filled circle)
}

text(my_pcaRes@loadings[,PC1], my_pcaRes@loadings[,PC2], labels=rownames(my_pcaRes@loadings), cex = points_text_cex)
}
# if (produce_fig == TRUE){ # option to produce figure
#
# suppressPackageStartupMessages(library(Cairo))
#
# CairoPNG(image_out, width = figure_width, height = figure_height, pointsize = 12, res = figure_res , units = "px")
#
# plot(my_pcaRes@loadings[,PC1],
# my_pcaRes@loadings[,PC2],
# cex.axis = axis_cex,
# cex.lab = lab_cex,
# main = image_title,
# type = "p",
# col = points_color,
# xlab = paste(PC1, "R^2 =", round(my_pcaRes@R2[PC1], 4)),
# ylab = paste(PC2, "R^2 =", round(my_pcaRes@R2[PC2], 4))
# )
#
# if (points_color != 0){
# points(my_pcaRes@loadings[,PC1], my_pcaRes@loadings[,PC2], col = points_color, pch=19, cex=2 )
# # color in the points if the points_color option has a value other than NA
# # pch, integer values that indicate different point types (19 is a filled circle)
# }
#
# text(my_pcaRes@loadings[,PC1], my_pcaRes@loadings[,PC2], labels=rownames(my_pcaRes@loadings), cex = points_text_cex)
# }

write.table(my_pcaRes@R2, file=file_out, sep="\t", col.names=FALSE, row.names=TRUE, append = FALSE)
write.table(loadings(my_pcaRes), file=file_out, sep="\t", col.names=FALSE, row.names=TRUE, append = TRUE)
Expand Down
20 changes: 10 additions & 10 deletions 20 src/MGRAST/r/preprocessing.r
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ MGRAST_preprocessing <<- function(file_in, # name of the input file (tab del
###### write the log transformed and centered data to a file
write.table(log2_cent_data, file=file_out, sep="\t", col.names = NA, row.names = TRUE, quote = FALSE)

if (produce_fig == TRUE){ # optional - produce an out put image
suppressPackageStartupMessages(library(Cairo))
CairoPNG(image_out, width = figure_width, height = figure_height, pointsize = 12, res = fiure_res , units = "px")
split.screen(c(2,1))
screen(1)
boxplot(input_data, main = raw_data_boxplot_title, las=2)
screen(2)
boxplot(log2_cent_data, main = centered_data_boxplot_title, las=2)
dev.off()
}
# if (produce_fig == TRUE){ # optional - produce an out put image
# suppressPackageStartupMessages(library(Cairo))
# CairoPNG(image_out, width = figure_width, height = figure_height, pointsize = 12, res = fiure_res , units = "px")
# split.screen(c(2,1))
# screen(1)
# boxplot(input_data, main = raw_data_boxplot_title, las=2)
# screen(2)
# boxplot(log2_cent_data, main = centered_data_boxplot_title, las=2)
# dev.off()
# }

}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.