Skip to content
Open
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
14 changes: 14 additions & 0 deletions Exercise7_1.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
fastadata<-scan(file="Lecture11.fasta",what=character())
#Make indices of either even or odd numbers to 200
x<-1:200
oddintegers<-x[c(TRUE,FALSE)]
evenintegers<-x[c(FALSE,TRUE)]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting approach. Are you sure this would work generally?

Sequences<-fastadata[evenintegers]
#count number of nucleotides in sequences and plot histogram
SeqLength<-nchar(Sequences)
HistofLength<-qplot(SeqLength,geom="histogram")
#Similar histogram but of the number of G's and C's in sequences
SeqWithoutA<-gsub("A","",Sequences)
SeqWithoutAT<-gsub("T","",SeqWithoutA)
GCSeqLength<-nchar(SeqWithoutAT)
qplot(GCSeqLength,geom="histogram")
10 changes: 10 additions & 0 deletions ExerciseScript7_2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
library(ggplot2)
library(grid)
library(gridExtra)

SoilIsotopes <- read.table("~/Desktop/Alaska Data/EA-IRMS/170517_EA-IRMS_MASTERSPREADSHEET.txt",sep = ' ',header=TRUE)

EAIRMS <- read.csv("~/Desktop/Alaska Data/EA-IRMS/170517_EA-IRMS_MASTERSPREADSHEET.csv")

a <- ggplot(data = EAIRMS, aes(x = Corrected.d15N, y = Corrected.d13C))
a + geom_point(color = "cyan", shape = 17, size = 3) + coord_cartesian() + theme_classic() + ggtitle("Alaska Soils") + ylab("d13C") + stat_smooth(method = "lm")
11 changes: 11 additions & 0 deletions ExerciseScript7_3.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
library(ggplot2)
library(grid)
library(gridExtra)
Data <- read.csv("~/Desktop/data-shell/Intro_Biocomp_ND_317_Tutorial7/data.txt",sep = ',',header=TRUE)
##This script can be executed to produce a bar graph of populations from the regions in the data.txt file
a = ggplot(data = Data)
a + geom_bar(aes(x = as.factor(region), y = observations), stat = "summary",
fun.y = "mean", fill = "black", color = "black") + theme_classic() + xlab("Regions") + ylab("Population")
##This script can be executed to produce a scatterplot of the popualtions from the regions in the data.txt file.
b = ggplot(data = Data, aes(x = region, y = observations)) + theme_classic()
b + geom_point() + geom_jitter()+ xlab("Regions") + ylab("Population")