Search
Question: Help with EdgeR running error
0
gravatar for Chia Jing Yi
4.7 years ago by
Chia Jing Yi10
Chia Jing Yi10 wrote:
Hi, Attached is the input file that I used to run EdgeR for my data set. Ideally the input file should be able to run through the following R-script: *library(cluster)* *library(gplots)* *library(Biobase)* *library(ctc)* *library(ape)* *data = read.table("diffExpr.P0.001_C1.matrix", header=T, com='', sep="\t")* *rownames(data) = data[,1] # set rownames to gene identifiers* *data = data[,2:length(data[1,])] # remove the gene column since its now the rowname value* *data = as.matrix(data) # convert to matrix* *cr = cor(data, method='spearman')* *data = log2(data+1)* *centered_data = t(scale(t(data), scale=F)) # center rows, mean substracted* *gene_dist = dist(centered_data, method='euclidean')* *hc_genes = hclust(gene_dist, method='complete')* *hc_samples = hclust(as.dist(1-cr), method="complete") # cluster conditions* *myheatcol = redgreen(75)* *gene_partition_assignments <- cutree(as.hclust(hc_genes), k=6);* *partition_colors = rainbow(length(unique(gene_partition_assignments)), start=0.4, end=0.95)* *gene_colors = partition_colors[gene_partition_assignments]* *save(list=ls(all=TRUE), file="diffExpr.P0.1_C1.matrix.R.all.RData")* *pdf("diffExpr.P0.001_C1.matrix.heatmap.pdf")* *heatmap.2(centered_data, dendrogram='both', Rowv=as.dendrogram(hc_genes), Colv=as.dendrogram(hc_samples), col=myheatcol, RowSideColors=gene_colors, scale="none", density.info="none", trace="none", key=TRUE, keysize=1.2, cexCol=1, lmat=rbind(c(5,0,4,0),c(3,1,2,0)), lhei=c(1.5,5),lwid=c(1.5,0.2,2.5,2.5), margins=c(12,5))* *try(heatmap.2(cr, col = cm.colors(256), scale='none', symm=TRUE, key=TRUE, density.info='none', trace='none', symkey=FALSE, Colv=TRUE,margins=c(10,10), cexCol=1, cexRow=1))* *dev.off()* However it stuck at the "*gene_dist = dist(centered_data, method='euclidean')*" and gives the following error message: *Loading required package: amap* *Error in dist(centered_data, method = "euclidean") : * * negative length vectors are not allowed* *Execution halted* If I run with smaller data set. The above R script worked fine. I was thinking the error caused by huge input file? Thanks for any advice to solve my doubt. best regards edge
ADD COMMENTlink written 4.7 years ago by Chia Jing Yi10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 145 users visited in the last hour