[R] Space in label name

2013-11-27 Thread Gitte Brinch Andersen
Hi

I am doing a cluster analysis and I have some troubles with the label names.

In the text file I have my data in, the first row contains the names of the 
samples. They are called "FFPE Tumor 2", "Fresh Frozen Tumor 2" etc.

But when the cluster is made the label names contains periods instead of space 
in the name.
I can't figure out how to change this, so I get spaces in the label names.
I hope someone can help?

The code I have used is:

#Set where you want to save your images/clusters
setwd("/Users/gban/Desktop/Lung Cancer/PAXgene article figures/PAXgene cluster 
+ Venn analysis")

#Read in data
data<-read.table("/Users/gban/Desktop/Lung Cancer/PAXgene article 
figures/PAXgene cluster + Venn 
analysis/BetaValue_ALL_tumo1_dup2_Codename.txt",sep="\t",dec=",",header=TRUE)

# Throw out rows with missing values.
data = na.omit(data)

#Turn the data into a matrix
Data_matrix<-as.matrix(data)

#Calculate the distance
Data_dist<-dist(t(data))

#Make the cluster
hc = hclust(Data_dist,method="ward")

# reduced label size
par(cex=0.7, mar=c(5, 8, 4, 1))
plot(hc, xlab="", ylab="", main="", sub="", axes=FALSE)
par(cex=1)
title(xlab="", ylab="", main="Cluster analysis")
axis(2)

The cluster output:
[cid:D57BB82B-3ACF-4681-BCA8-D8202EA34294@eduroam.net.au.dk]
Kind regards

Gitte Brinch Andersen

Ph.d student
Department of Biomedicine
Wilhelm Meyers Allé 4
Aarhus Universitet
DK-8000 Aarhus C

E-mail: gitt...@hum-gen.au.dk<mailto:gitt...@hum-gen.au.dk>


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Change font size in Cluster analysis

2013-06-27 Thread Gitte Brinch Andersen
36_4
OS_Tumor1_08_14985_2_3 0.860337470.90698171
OS_Tumor2_08_226869_1  0.696149330.66414891
OS_Tumor3_10_201917_2_30.587289270.65086446
OS_Tumor4_00_2395  0.417471300.45464648
OS_Tumor5_02_2669  0.742592130.88244165
OS_Tumor6_02_4738  0.796900180.93691928
OS_Tumor7_02_4850  0.055134710.91753824
OS_Tumor8_02_6935  0.707422990.77802530
OS_Tumor9_03_1430  0.845630860.87202952
OS_Tumor10_03_1701 0.813180170.72446802
OS_Tumor11_03_220  0.724890870.80580733
OS_Tumor12_03_2558 0.066567800.14739011
OS_Tumor13_03_373  0.940118670.95742989
OS_Tumor14_03_82   0.521297690.54734874
OS_Tumor15_06_223190.930251910.94392535
OS_Tumor16_07_165810.672368870.88546907
OS_Tumor17_07_285230.257648510.45550666
OS_Tumor18_07_3212 0.336245140.18623351
OS_Tumor19_07_6990 0.829047760.88946081
OS_Tumor20_07_6990sample2  0.768360300.82519665
OS_Tumor21_07_7724 0.903143150.71810973
OS_Tumor22_08_102380.837157820.86426252
OS_Tumor23_08_14985Sample2 0.825882140.90655043
OS_Tumor24_08_165920.775828280.83500490
OS_Tumor25_08_211970.902747850.96119490
OS_Tumor26_08_21197Sample2 0.873855780.83341529
OS_Tumor27_08_222863   0.725881950.59849569
OS_Tumor28_08_225814   0.879312320.89657489
OS_Tumor29_08_226869Sample20.863790630.88825605
OS_Tumor30_08_230660   0.924955630.95137547
OS_Tumor31_08_4485 0.844651790.66948504
OS_Tumor32_09_214654   0.920364410.71915709
OS_Tumor33_09_214654Sample20.939554310.46490552
OS_Tumor34_10_200150   0.803378130.82519665
OS_Tumor35_10_201917   0.877346860.91265824
OS_Tumor36_10_201917Sample20.936270040.94319232
OS_Tumor37_10_202221   0.931077760.96075927
OS_Tumor38_10_204294   0.858921540.94595920
OS_Tumor39_10_204294Sample20.698390750.76396555
OS_Tumor40_10_205933   0.258501290.43418918
OS_Tumor41_10_225662   0.714426830.88154146
OS_Tumor42_10_229129   0.423289770.77763541
OS_Tumor43_11_236261   0.829467210.87242385
OS_Tumor44_12_211561   0.847859940.12366988
Normalbone.3.  0.068402250.08229536
Normalbone.UA. 0.073833440.12502117
Normalbone.UA2.0.077418170.09563505
CRL_11372  0.054096890.13815797
CRL_1427   0.917300690.92421230
CRL_1543   0.777899180.94650563
CRL_2098   0.915241150.50725942
Ho_f.4610  0.057364180.51843963
HTB_85 0.954644680.05260867
HTB_96 0.884105290.92872206


#Calculate the distance
Data_dist<-dist(Data_matrix)

#Make the cluster
Data_clust<-hclust(Data_dist,method="ward")

#Save the plot as a pdf file
pdf(file="Cluster_Probes_From_genes_morethan_2_probes_and_morethan_30_methdiff.pdf")

#Plot the cluster
plot(Data_clust, cex=0.5)

dev.off() #Ends the pdf saving.

Gitte Brinch Andersen

Kandidat-Ph.d. studerende
Biomedicinsk Institut
Wilhelm Meyers Allé 4
Aarhus Universitet
DK-8000 Aarhus C

Mobil: +45 30433317
E-mail: gitt...@hum-gen.au.dk<mailto:gitt...@hum-gen.au.dk>



[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Heatmap with error message: `x' must be a numeric matrix

2013-06-25 Thread Gitte Brinch Andersen
49332"
DLX5_cg05597836_4 "0,906981714"  "0,664148911"
ARHGEF7_cg09129334_6  "0,88102921"   "0,726231077"
ZIC4_cg02387803_7 "0,770987986"  "0,568085839"
ZIC4_cg05855917_8 "0,880514891"  "0,681148663"
DLX5_cg13286614_9 "0,855132688"  "0,592368469"
ZIC4_cg04556126_10"0,907405655"  "0,718858033"
LOC145845_cg25718467_11   "0,893492688"  "0,793191968"
ZIC4_cg08393041_12"0,911133787"  "0,678042743"
SNED1_cg03785076_13   "0,862060883"  "0,70294155"
C10orf116_cg01004363_14   "0,858555164"  "0,553920222"
DLX5_cg20250426_15"0,903165828"  "0,64976206"
EPHX3_cg16184495_16   "0,927538308"  "0,519523714"
SNED1_cg21304158_17   "0,762270611"  "0,647588457"
EN1_cg12418535_19 "0,790529679"  "0,318880892"
RTKN_cg00689340_20"0,941714187"  "0,675243565"
SNED1_cg16937168_21   "0,894421593"  "0,821448724"
CD93_cg12873119_22"0,86949625"   "0,676389091"
RRN3P2_cg00525931_23  "0,862670615"  "0,855822961"
GPBAR1_cg18581950_24  "0,800216557"  "0,810012301"
SPARCL1_cg15552249_25 "0,815666773"  "0,837099021"
HOXD12_cg23130254_26  "0,840109076"  "0,502896181"
ZIC4_cg08889797_27"0,779606392"  "0,591615859"
ESRP2_cg06723863_28   "0,655488067"  "0,47819514"
ZIC4_cg16790847_29"0,735676228"  "0,611372155"
PFDN5_cg16309127_30   "0,753348167"  "0,630504254"
ARHGEF7_cg05776861_31 "0,951737748"  "0,926613919"
TBX15_cg24720355_32   "0,906521431"  "0,364984479"
FER1L5_cg01876130_33  "0,601084686"  "0,805388591"
HOXD12_cg1804_34  "0,865974739"  "0,543178066"
DLX6AS_cg26251506_35  "0,804479354"  "0,538022928"
GSTM5_cg05376982_36   "0,733426641"  "0,552089202"
ZIC4_cg12976081_37"0,464939006"  "0,551218578"
HOXB4_cg02132714_38   "0,798491712"  "0,718121432"
HOXD10_cg17489939_39  "0,970868858"  "0,790134913"
C10orf116_cg12261786_40   "0,727394677"  "0,573072856"
SPARCL1_cg19466563_41 "0,79754226"   "0,722582785"
HOXD12_cg03964958_42  "0,778450531"  "0,679889139"
HOXA5_cg09549073_43   "0,4652904""0,377825589"
ZIC4_cg00334063_44"0,783052842"  "0,634682328"
TBX15_cg16990168_45   "0,893463329"  "0,235197972"

heatmap.2(data1, col=redgreen(75), scale="row", key=T, 
keysize=1.5,density.info="none", trace="none",cexCol=0.9, labRow=NA)
Fejl i heatmap.2(data1, col = redgreen(75), scale = "row", key = T,  :
  `x' must be a numeric matrix

Many thanks!

Kind regards

Gitte Brinch Andersen


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] installing package

2013-04-25 Thread Gitte Brinch Andersen
Hi

I am trying to install a package (bioconductor) but every time I try to install 
it I get this message:

source("http://bioconductor.org/biocLite.R";)
Warning in install.packages("BiocInstaller", repos = a["BioCsoft", "URL"]) :
  'lib = "C:/Program Files/R/R-3.0.0/library"' is not writable
Error in install.packages("BiocInstaller", repos = a["BioCsoft", "URL"]) : 
  unable to install packages
> biocLite("methylumi")

I normally use mac computers, but I cannot get the right path for the folders I 
should use, so now I am trying with a windows platform instead. But now I 
cannot install one of the packages my pipeline needs.

Can anyone help?

I know it is probably a simple problem, but I have never used R before and 
don't know how to solve problems in it.

Best

Gitte Andersen

E-mail: gitt...@hum-gen.au.dk

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R cannot find the path on my mac

2013-04-24 Thread Gitte Brinch Andersen
Hi

I am really sorry for this probably quite simple question.
I am new to R, and I am running a pipeline that has already been made. All I 
have to do is give the paths for different folders, where the pipeline can find 
the files with my data.

But every time I try to run the pipeline it returns with the message, that it 
cannot find the file. And I really don't know why. I have found the path by 
going to the folder and finding the info about the folder, where the location 
of this is stated. I copy-paste this into the source command.

The path for the folder is:

When found with the "info about the folder":
/Users/gban/Desktop/Methylation analysis/MethylationDataAnalysis

But I think it should be:
/Users/gban/Desktop/Methylation 
analysis/MethylationDataAnalysis/1.Normalization_raw_data/
as it is the folder 1.Normalization_raw_data where my data are in.

I have tried both paths but it returns with this message every time:

> source('/Users/gban/Desktop/Methylation 
> analysis/MethylationDataAnalysis/1.Normalization_raw_data/pipelineIlluminaMethylation.main.R')
Fejl i file(filename, "r", encoding = encoding) : 
  cannot open the connection
In addition: Advarselsbesked:
In file(filename, "r", encoding = encoding) :
  cannot open file '/Users/gban/Desktop/Methylation 
analysis/MethylationDataAnalysis/1. 
450K_pipeline_Nov2012release./SRC/loadMethylumi2.R': No such file or directory


Do you have any idea why? 
I know this is probably more a question of how to type the path on a mac, than 
it is a question of how R works.

But I am really frustrated about this, and thought it might be possible for you 
to help?

Thank you in advance, and again sorry for the quite stupid question.

Best

Gitte Brinch Andersen

E-mail: gitt...@hum-gen.au.dk

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.