Posts

Azizi and this blog

Image
Hi! It has been two years I haven't updated this blog ever since Azizi was admitted to the hospital for schizophrenia. Now, he's back to school and is determined more than ever to complete his PhD in Fluid Dynamics (hooray!).  If you're reading this Zee, I am above the clouds for this great news and I wish you good luck! No.2 on the agenda, is to update all the R codings and lab protocols that I used during my PhD into this humble blog. I was really busy with thesis writing and attending conferences. Now, I can dedicate my time to contribute my knowledge and experience here and hopefully be of use. Watch this space guys! Love lots, Nas Denis

The Elements

Image

The SketchUp

Image
Drawing completed by using SketchUp http://www.sketchup.com/ Maludam National Park in its glory, 3-D perception. Acknowledgement: Thank you Raini!

Multiple plots in one page

Image
And to view multiple plots in one page, I referred to the below: > old.par <- par(mfrow=c(1, 2)) > plot(faithful, main="Faithful eruptions") > plot(large.islands, main="Islands", ylab="Area") > par(old.par) (Source: http://www.dummies.com/programming/r/how-to-put-multiple-plots-on-a-single-page-in-r/ ( inserted with my data: chns.par<-par(mfrow=c( 2 ,2)) barplot(as.matrix(Maludam.December.2014.Station.1CHNS), main="Elemental Analysis for Station 1", ylab= "Carbon Ratio", beside=TRUE, col=rainbow(5)) + legend("topright", c("Top","Middle","Bottom"), cex=0.6,bty="n", fill=rainbow(5)) barplot(as.matrix(Maludam.December.2014.Station.2CHNS), main="Elemental Analysis for Station 2", ylab= "Carbon Ratio", beside=TRUE, col=rainbow(5)) + legend("topright", c("Top","Middle","Bottom"), cex=0.6,bty="n", f

Correlation

Image
Correlation.R # ============================================================ # Tutorial on drawing a correlation map using ggplot2 # by Umer Zeeshan Ijaz (http://userweb.eng.gla.ac.uk/umer.ijaz) # =============================================================   abund_table<- read.csv ( "SPE_pitlatrine.csv" , row.names = 1 , check.names= FALSE ) #Transpose the data to have sample names on rows abund_table<- t ( abund_table ) meta_table<- read.csv ( "ENV_pitlatrine.csv" , row.names = 1 , check.names= FALSE )   #Filter out samples with fewer counts abund_table<-abund_table [ rowSums ( abund_table ) > 200 , ]   #Extract the corresponding meta_table for the samples in abund_table meta_table<-meta_table [ rownames ( abund_table ) , ]   I changed the parameters #You can use sel_env to specify the variables you want to use and sel_env_label to specify the labes for the pannel sel_env<- c ( "pH" , "Temp" , "TS

NMDS (Non-metric multidimensional scaling)

Image
So this works for my data! I had started with the commands under the section NMDS from http://userweb.eng.gla.ac.uk/umer.ijaz/bioinformatics/ecological.html the sample and data samples were prepared according to the above. and proceed with the following: library("vegan", lib.loc="~/R/win-library/3.2") library("lattice", lib.loc="C:/Program Files/R/R-3.2.5/library") set.seed(2) abund_table<-read.csv("Sample.csv",row.names=1,check.names=FALSE) #Transpose the data to have sample names on rows abund_table<-t(abund_table) abund_table<-t(abund_table) example_NMDS=metaMDS(abund_table, k=2) plot(example_NMDS) ordiplot(example_NMDS,type="n") orditorp(example_NMDS,display="species",col="red",air=0.01) orditorp(example_NMDS,display="sites",cex=1.25,air=0.01) And I changed "Treatment 1" and "Treatment 2" to: treat=c(rep("pH",5),rep("Cond

Simple GRaphs (Part II)

Image
After much eye squinting from all viewers, it was decided during the meeting with great panel judges that the graph needed a face lift.  The best Simple Graph tutorial that was perfect for my data derived from: http://www.harding.edu/fmccown/r/#autosdatafile So, the changes were as per below: # Graph autos with adjacent bars using rainbow colors barplot( as.matrix(Maludam_Mac2014) , main="Elemental Analysis", ylab= "Carbon Ratio", beside=TRUE, col=rainbow(5) ) # Place the legend at the top-left corner with no frame # using rainbow colors legend("topleft", c("S1","S4","S6","S8","S9"), cex=0.6, bty="n", fill=rainbow(5)); After much thinking and staring at my PC for one day, giving opportunity to bloodshot eyes, I've realized the data was the key. Therefore, I changed the raw data to C:N C:S H:C 0.40   1.81 1.13 2.42   17.66 0.33 0.67   4.