Publications by Author: Ahmad Ali

RBIF_112_HW2

24.01.2023

1 Problem 1 (30 points) 1.1 Part A Locate the data directory “apoptosis” under the directory “extdata” in the facsDorit package installation folder (use R command to do the job programmatically if you can, see the Notes). # For this to work, the apoptosis folder must be in the same directory as the Markdown file directory <- paste(dirnam...

6587 sym R (7199 sym/29 pcs) 10 img

HW1

06.10.2022

Question 1 Using no other R functions besides sqrt (e.g. to calculate sum use a loop summing all elements from first to last) implement function my.sd calculating standard deviation for a numeric vector of arbitrary length and demonstrate that it produces exactly the same results as R function sd. Setting up parameters for consistency and r...

9638 sym R (17404 sym/149 pcs) 24 img

Homework 2 - Ahmad Ali

18.10.2022

Question 1 Establishing Variables and Empty Vectors #Setting seed for debugging/consistency set.seed(1) #integer vector with the sample sizes size.samples <- 2:20 num.samples <- 1000 #For Tomorrow, redo the rnorm stuff to become a for loop and stuff # May have done the simulation variable incorrectly based on values of sd() (should be go...

4411 sym 22 img

Homework 3 - Ahmad Ali

26.10.2022

Part 1 Establishing Variables set.seed(1) x <- 1:20 y <- 20+10*1:20+5*(1:20)^2+ rnorm(20,0,200) quadratic.df <- data.frame(x,y) Displaying plots and applying linear regression. ggplot(quadratic.df, aes(x = x, y = y)) + geom_point() model.intercept <- lm(formula = y ~ 1, data = quadratic.df) model.linear <- lm(formula = y ~ x, data...

2763 sym R (10473 sym/65 pcs) 15 img

Homework 4 - Ahmad Ali

01.11.2022

Question 1 Establishing Variables set.seed(4356) sample.sizes <- c(1,2,4,8,16,32,64,128) num.samples <- 1000 rexp.results <- matrix(0, nrow = num.samples, ncol = 0) smpl.sizes <- c(1,2,4,8,16,32,64,128) r.mu <- numeric() r.sem <- numeric() n.sim <- 1000 for ( i.smpl in smpl.sizes ) { r.mat <- matrix(rexp(i.smpl*n.sim, rate = 1), ...

3602 sym R (10961 sym/39 pcs) 22 img

Homework 5 - Ahmad Ali

09.11.2022

Importing Data # Building for table 3, contains experimental set 1 url.s3 <- "https://www.ncbi.nlm.nih.gov/pmc/articles/PMC1789144/bin/pone.0000216.s007.xls" destfile.s3 <- "table_s3_143.xls" curl::curl_download(url.s3, destfile.s3) table.s3.143 <- read_excel(destfile.s3, range = "A4:U147") # Building for table 4, contains experimental set ...

7504 sym R (31278 sym/95 pcs) 14 img

Homework 6 - Ahmad Ali

16.11.2022

Question 1 Establishing Variables set.seed(4356) library("ALL") data("ALL") phen.data <- pData(ALL) phen.data <- phen.data %>% mutate(BT = substr(BT,1,1)) phen.data$BT <- as.factor(phen.data$BT) gene.data <- exprs(ALL) bt.data <- phen.data %>% mutate(BT = substr(BT,1,1)) %>% select(BT) bt.w.gene <- cbind(bt.data, t(gene.data...

6190 sym R (20333 sym/108 pcs) 13 img

Homework 8 - Ahmad Ali

29.11.2022

Question 1 Establishing Variables set.seed(4356) library("ALL") data("ALL") phen.data <- pData(ALL) gene.data <- exprs(ALL) sex.relapse.gene.df <- data.frame( sex = pData(ALL)$sex, relapse = pData(ALL)$relapse) b.mask <- !is.na(phen.data$sex) & !is.na(phen.data$relapse) ### Dimensions are all 99 now sex.na.rm <- phen.data$sex[b...

1919 sym R (10278 sym/37 pcs) 6 img

Homework 7 - Ahmad Ali

29.11.2022

Question 1 Establishing Variables set.seed(4356) library("ALL") data("ALL") phen.data <- pData(ALL) date.cr.chr <- as.character(phen.data$date.cr) diag.chr <- as.character(phen.data$diagnosis) date.cr.t <- strptime(date.cr.chr,"%m/%d/%Y") diag.t <- strptime(diag.chr,"%m/%d/%Y") days2remiss <- as.numeric(date.cr.t - diag.t) x.d2r <- as...

868 sym R (20916 sym/44 pcs) 4 img

Homework 9 - Ahmad Ali

06.12.2022

Question 1 Establishing Variables set.seed(4356) n <- 100 cntr.dist <- 4 x <- c(rnorm(n, cntr.dist), rnorm(n, -cntr.dist), rnorm(n, cntr.dist)) y <- c(rnorm(n, cntr.dist), rnorm(n, -cntr.dist), rnorm(n, 0)) z <- c(rnorm(n, cntr.dist), rnorm(n, -cntr.dist), rnorm(n, 0)) scatter.df <- as.data.frame(...

5703 sym R (13218 sym/37 pcs) 18 img