<jupyter_start><jupyter_text>GSE27562 - Notebook Version 1.0This is a series specific file that makes modifications to the GSE27562 matrix imported through FIT, exporting only the data needed for FaST processing.  See [GSE27562](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE27562) for more information on series. This program is written in R.From the series data:>In total, we collected blood from **57** women with a diagnosis of breast cancer and **37** with a benign diagnosis. We also collected blood from **31** women with normal initial mammograms as negative controls and 15 breast cancer patients following surgery.We ignore patients following surgery since these may or may not have cancer tissue.  Instead we only consider three classes:  those with breast cancer (*malignant*) those with benign tumors (*benign*) and those with no cancer (*normal*).  This totals **125** samples.  Get/Create DirectoriesAssumes this notebook is in `GenClass-Stability/importTools/notebooks/`<jupyter_code>notebook_dir <- getwd() # get the working directory
main_dir <- dirname(dirname(notebook_dir)) # get two levels up
gse_dir = file.path(main_dir,"GSE","GSE27562")
setwd(gse_dir)<jupyter_output><empty_output><jupyter_text>Import MatrixAssumes this notebook is in `GenClass-Stability/importTools/notebooks/` and GSE data from SIT is stored in `GenClass-Stability/GSE`.<jupyter_code>matrix <- read.table("filteredRMA.txt",header=TRUE,row.names=1)<jupyter_output><empty_output><jupyter_text>Modify MatrixThe remaining code is specific to the GSE and the data that you want to test.  However, the format for classes and expressions should always be the same.Remove `PBMC_` from column names.<jupyter_code>classes <- gsub("PBMC_", "", colnames(matrix))<jupyter_output><empty_output><jupyter_text>Remove `_training_` from column names.<jupyter_code>toRemove <- rev(c(1:10))
toRemove <- paste(c("_training_"), toRemove, sep = '', collapse = ' ')
toRemove <- unlist(strsplit(toRemove, split=" "))
for (i in 1:length(toRemove)) {
    classes <- sub(toRemove[i][1], "", classes)
}<jupyter_output><empty_output><jupyter_text>Remove `_validation_` from column names.<jupyter_code>toRemove <- rev(c(1:47))
toRemove <- paste(c("_validation_"), toRemove, sep='', collapse=' ')
toRemove <- unlist(strsplit(toRemove, split=" "))
for (i in 1:length(toRemove))
{
    classes <- sub(toRemove[i][1], "", classes)
}<jupyter_output><empty_output><jupyter_text>Modify the column names with the classes.<jupyter_code>colnames(matrix) <- classes<jupyter_output><empty_output><jupyter_text>Get select gene expressions.<jupyter_code>patterns <- c("normal", "benign", "malignant")
expressions = matrix[ , grepl( paste(patterns, collapse="|") , names( matrix ) ) ]<jupyter_output><empty_output><jupyter_text>Write ClassesFirst remove extra numbers added by datafram.<jupyter_code>classes = gsub("\\..*","",colnames(expressions))
classes = as.matrix(classes)
classes = t(classes)
write.table(classes,file.path(gse_dir,"classes.txt"),sep = "\t", quote = FALSE, row.names=FALSE, col.names=FALSE)<jupyter_output><empty_output><jupyter_text>Write Expressions<jupyter_code>expressions = t(expressions)
write.table(expressions,file.path(gse_dir,"expressions.txt"),sep = "\t", row.names=FALSE, col.names=FALSE)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12877871825876663, 'fraction_numerical': 0.014812575574365175, 'mean_word_length': 7.031553398058253, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 38, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '624434', 'license': 'MIT', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1041, 'n_words': 280, 'path': 'importTools/notebooks/GSE27562.ipynb', 'repo_name': 'tarce/Genetic-Classifier-Stability', 'size': '3308'}