|
1 | | -Entrez_gene_ids_sign <- res$ENTREZID[(res$FDR < 0.01) & (res$logFC > 4)] |
2 | | -# Downregulated: |
3 | | -#Entrez_gene_ids_sign <- res$ENTREZID[(res$FDR < 0.01) & (res$logFC < -4)] |
4 | | -# General disruption: |
5 | | -#Entrez_gene_ids_sign <- res$ENTREZID[(res$FDR < 0.01) & (abs(res$logFC) > 4)] |
6 | | -Entrez_gene_ids_sign <- Entrez_gene_ids_sign[!is.na(Entrez_gene_ids_sign)] |
7 | | -Entrez_gene_ids_sign <- sort(as.character(Entrez_gene_ids_sign)) |
8 | | -length(Entrez_gene_ids_sign) |
9 | | -# Write IDs to file |
10 | | -write.table(Entrez_gene_ids_background, file="Entrez_gene_ids_background.txt", |
11 | | -col.names=F, quote=F, row.names=F) |
12 | | -write.table(Entrez_gene_ids_sign, file="Entrez_gene_ids_sign.txt", |
13 | | -col.names=F, quote=F, row.names=F) |
14 | | -# Load data for one individual sample |
15 | | -dat_lengths <- read.table("GSM1545545_JMS9-P8c.txt", header=T, sep="\t") |
16 | | -head(dat_lengths) |
17 | | -# Sort based on Entrez IDs |
18 | | -dat_lengths_sorted <- dat_lengths[sort(as.character(dat_lengths$EntrezID),index.return=T)$ix, ] |
19 | | -# Sort the results based on Entrez IDs |
20 | | -res_sorted <- res[sort(as.character(res$ENTREZID),index.return=T)$ix, ] |
21 | | -# Select the ones that are in the results table |
22 | | -dat_lengths_sorted <- dat_lengths_sorted[dat_lengths_sorted$EntrezID %in% res$ENTREZID, ] |
23 | | -# Check if order and amount of Entrez IDs is correct |
24 | | -all(dat_lengths_sorted$EntrezID == res_sorted$ENTREZID) |
25 | | -# Add gene lengths to results |
26 | | -res_sorted$Lengths <- dat_lengths_sorted$GeneLength |
27 | | -head(res_sorted) |
28 | | -# GO analysis |
29 | | -gsa <- goana(sort(Entrez_gene_ids_sign), |
30 | | -species = "Mm", |
31 | | -universe = sort(Entrez_gene_ids_background), |
32 | | -trend = res_sorted$Lengths) |
33 | | -head(gsa) |
34 | | -# Sort results and calculate FDR |
35 | | -gsa <- gsa[sort(gsa$P.DE,index.return=T)$ix,] |
36 | | -gsa$P.DE.adj <- p.adjust(gsa$P.DE, n=nrow(gsa), method="BH") |
37 | | -head(gsa) |
38 | | -# Write results |
39 | | -write.table(gsa, file="GSA_analysis_all.txt", col.names = T, |
40 | | -row.names = F, quote = F, sep="\t") |
41 | | -View(gsa) |
42 | | -?parlapply |
43 | | -??parlapply |
44 | | -?mblogit |
45 | | -??mblogit |
46 | | -library(mclogit) |
47 | | -install.packages("mclogit") |
48 | | -library(mclogit) |
49 | | -?mblogit |
50 | | -load("~/MultiData.RData") |
51 | | -# Fit the model: |
52 | | -MultiData.mblogit <- mblogit(formula = Bin ~ Genotype, |
53 | | -random = ~1|BC, |
54 | | -weights = count, |
55 | | -data = MultiData) |
56 | | -?mclogit |
57 | | -?VGAM::zibinomial |
58 | | -install.packages(VGAM) |
59 | | -install.packages("VGAM") |
60 | | -?VGAM::zibinomial |
61 | | -?VGAM::zimultinomial |
62 | | -??zimultinomial |
63 | | -MAGE::LOItest_logreg(c(5, 8, 10, 3, 5, 6, 23), c(8, 8, 6, 4, 4, 10, 0), |
64 | | -c(5, 0, 0, 3, 5, 1, 23), c(1, 8, 6, 2, 0, 10, 0)) |
65 | | -?mclogit |
66 | | -?mblogit |
67 | | -load("~/SCRIPT7_DI_results_genes.RData") |
68 | | -View(DI_results_genes) |
69 | | -load("~/SCRIPT7_DI_results_SNP.RData") |
70 | | -View(DI_results_SNP) |
71 | | -load("~/SCRIPT7_DI_results_genes.RData") |
72 | | -View(DI_results_genes) |
73 | | -load("~/SCRIPT7_DI_results_genes.RData") |
74 | | -View(DI_results_genes) |
75 | | -load("~/SCRIPT7_DI_results_SNP.RData") |
76 | | -View(DI_results_SNP) |
77 | | -View(DI_results_SNP) |
78 | | -load("~/SignTab2.RData") |
79 | | -View(SignTab) |
80 | | -SignTabClone <- SignTab |
81 | | -load("~/SignTab2_New.RData") |
82 | | -View(SignTabClone) |
83 | | -View(SignTab) |
84 | | -sum(SignTab$p_DI_FDR < 0.05) |
85 | | -sum(SignTabClone$p_DI_FDR < 0.05) |
86 | | -SignTab$Gene[SignTab$p_DI_FDR < 0.05] |
87 | 1 | SignTabClone$Gene[SignTabClone$p_DI_FDR < 0.05] |
88 | 2 | View(SignTab) |
89 | 3 | View(SignTabClone) |
@@ -510,3 +424,89 @@ View(GENEdata_Table3SS) |
510 | 424 | GENEdata_Table3SS <- GENEdata_Table3[, c(-30:-20) ] |
511 | 425 | ?glm |
512 | 426 | ?lm |
| 427 | +?merge |
| 428 | +CurDF <- (data_allchr_control[[chr]][[HelpTab$SNPname[j]]]) |
| 429 | +SnpsTillNow <- 0 |
| 430 | ++ |
| 431 | +1 |
| 432 | +SnpsTillNow |
| 433 | +load("~/MAGEgenotyper/ARAS.RData") |
| 434 | +load("~/MAGEgenotyper/BRBS.RData") |
| 435 | +View(ara1) |
| 436 | +SelectedSamps <- ara1$TCGA_sample_ID[1:5] |
| 437 | +SelectedSamps <- ara1$TCGA_sample_ID[1:5] |
| 438 | +ara1 <- ara1[ara1$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "chr", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 439 | +View(ara1) |
| 440 | +ara1 <- ara1[ara1$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "chr", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 441 | +ara1 <- ara1[ara1$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "chr", "TCGA_sample_ID", "A", "T", "C")] |
| 442 | +ara1 <- ara1[ara1$TCGA_sample_ID %in% SelectedSamps, c("C", "G", "ref", "var", "total")] |
| 443 | +load("~/MAGEgenotyper/ARAS.RData") |
| 444 | +load("~/MAGEgenotyper/ARAS.RData") |
| 445 | +load("~/MAGEgenotyper/BRBS.RData") |
| 446 | +SelectedSamps <- ara1$TCGA_sample_ID[1:5] |
| 447 | +ara1 <- ara1[ara1$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 448 | +brb1 <- brb1[brb1$TCGA_sample_ID %in% SelectedSamps, c("SNPname", "gene", "NEW", "ref_count", "var_count", "total")] |
| 449 | +colnames(brb1) <- c("SNP_ID", "gene", "Sample_ID", "ref_count", "var_count", "total") |
| 450 | +ara2 <- ara2[ara2$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 451 | +brb2 <- brb2[brb2$TCGA_sample_ID %in% SelectedSamps, c("SNPname", "gene", "NEW", "ref_count", "var_count", "total")] |
| 452 | +colnames(brb2) <- c("SNP_ID", "gene", "Sample_ID", "ref_count", "var_count", "total") |
| 453 | +ara3 <- ara3[ara3$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 454 | +brb3 <- brb3[brb3$TCGA_sample_ID %in% SelectedSamps, c("SNPname", "gene", "NEW", "ref_count", "var_count", "total")] |
| 455 | +colnames(brb3) <- c("SNP_ID", "gene", "Sample_ID", "ref_count", "var_count", "total") |
| 456 | +View(ara1) |
| 457 | +View(ara2) |
| 458 | +View(ara3) |
| 459 | +View(brb1) |
| 460 | +View(brb2) |
| 461 | +View(brb3) |
| 462 | +load("~/MAGEgenotyper/ARAS.RData") |
| 463 | +load("~/MAGEgenotyper/ARAS.RData") |
| 464 | +load("~/MAGEgenotyper/BRBS.RData") |
| 465 | +SelectedSamps <- ara1$TCGA_sample_ID[1:5] |
| 466 | +ara1 <- ara1[ara1$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 467 | +brb1 <- brb1[brb1$TCGA_sample_ID %in% SelectedSamps, c("SNPname", "gene", "NEW", "ref_count", "var_count", "total")] |
| 468 | +colnames(brb1) <- c("SNP_ID", "gene", "Sample_ID", "ref_count", "var_count", "total") |
| 469 | +ara2 <- ara2[ara2$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 470 | +brb2 <- brb2[brb2$TCGA_sample_ID %in% SelectedSamps, c("SNPname", "gene", "NEW", "ref_count", "var_count", "total")] |
| 471 | +colnames(brb2) <- c("SNP_ID", "gene", "Sample_ID", "ref_count", "var_count", "total") |
| 472 | +ara3 <- ara3[ara3$TCGA_sample_ID %in% SelectedSamps, c("dbSNP_ref", "gene", "TCGA_sample_ID", "A", "T", "C", "G", "ref", "var", "total")] |
| 473 | +brb3 <- brb3[brb3$TCGA_sample_ID %in% SelectedSamps, c("SNPname", "gene", "NEW", "ref_count", "var_count", "total")] |
| 474 | +colnames(brb3) <- c("SNP_ID", "gene", "Sample_ID", "ref_count", "var_count", "total") |
| 475 | +View(ara1) |
| 476 | +View(ara2) |
| 477 | +View(ara3) |
| 478 | +View(brb1) |
| 479 | +View(brb2) |
| 480 | +View(brb3) |
| 481 | +HelpTab_ReConstruct <- data.frame("dbSNP_ref"=character(), "gene"=character()) |
| 482 | +View(ara2) |
| 483 | +?read.csv |
| 484 | +21:21 |
| 485 | +NC <- 10 |
| 486 | +NS <- 50 |
| 487 | +NS <- length(AllLocs) |
| 488 | +NS <- 50 |
| 489 | +spl <- c(0, cumsum(rep(floor(NS/NC),NC)+c(rep(1,NS-floor(NS/NC)*NC), |
| 490 | +rep(0,NC-NS+floor(NS/NC)*NC)))) # Helps in splitting input data |
| 491 | +spl |
| 492 | +NS <- 51 |
| 493 | +spl <- c(0, cumsum(rep(floor(NS/NC),NC)+c(rep(1,NS-floor(NS/NC)*NC), |
| 494 | +rep(0,NC-NS+floor(NS/NC)*NC)))) # Helps in splitting input data |
| 495 | +spl |
| 496 | +NS <- 49 |
| 497 | +spl <- c(0, cumsum(rep(floor(NS/NC),NC)+c(rep(1,NS-floor(NS/NC)*NC), |
| 498 | +rep(0,NC-NS+floor(NS/NC)*NC)))) # Helps in splitting input data |
| 499 | +spl |
| 500 | +NC <- 40 |
| 501 | +NS <- 8592 |
| 502 | +spl |
| 503 | +spl <- c(0, cumsum(rep(floor(NS/NC),NC)+c(rep(1,NS-floor(NS/NC)*NC), |
| 504 | +rep(0,NC-NS+floor(NS/NC)*NC)))) # Helps in splitting input data |
| 505 | +spl |
| 506 | +for(bla in 1:1){ |
| 507 | +next |
| 508 | +print("bla") |
| 509 | +} |
| 510 | +for(bla in 1:1){ |
| 511 | +print("bla") |
| 512 | +} |
0 commit comments