Skip to content

Commit

Permalink
alt cell name smouse
Browse files Browse the repository at this point in the history
  • Loading branch information
3mmaRand committed Feb 9, 2024
1 parent 95831e7 commit d946726
Show file tree
Hide file tree
Showing 8 changed files with 2,658 additions and 1,922 deletions.
82 changes: 82 additions & 0 deletions cell_types.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# 13.1 Cell types data set
# 13.1.1 ST1
cell_types <- as.matrix(read.delim("omics/all_cell_types.txt", sep =
"\t", row.names = 1))


# 13.1.2 ST2
cell_types[1:5,1:5]
dim(cell_types)


# 13.1.3 ST3
colnames(cell_types)


# 13.1.4 ST4
table(cell_types)
cell_types[,"LTHSC"]


# 13.1.5 ST5
sort(colSums(cell_types)) |> sum()


# 13.1.6 ST6




# 13.1.7 ST7
cell_labels <- sub("_.*", "", rownames(cell_types))
table(cell_labels)
# HSPC LT.HSC Prog
# 852 216 852
# 701 155 798 orginal


# 13.1.8 ST8
colSums(cell_types[grep("LT.HSC", rownames(cell_types)),])
colSums(cell_types[grep("HSPC", rownames(cell_types)),])
colSums(cell_types[grep("Prog", rownames(cell_types)),])


# 13.1.9 ST10
length(colnames(lthsc))
length(rownames(cell_types))
length(intersect(colnames(lthsc),rownames(cell_types)))
# 13.2 Combining the gene expression data with the cell type information
# Back to questions


cell_is_cmp <- clean_cell_types[,"CMP"]==1
cmp_cell_names <- rownames(clean_cell_types[cell_is_cmp,])
cmp_expression <- gene_counts[,cmp_cell_names]



# my code ---------------------------------------------------------
library(tidyverse)
# import each of the data sets
# 🐭 import the data
hspc <- read_csv("omics/week-5/data-raw/surfaceome_hspc.csv")
prog <- read_csv("omics/week-5/data-raw/surfaceome_prog.csv")

# what are the name of the cells we have data for
hspc_cells <- colnames(hspc[-1])
prog_cells <- colnames(prog[-1])
all_cells <- c(hspc_cells, prog_cells)

# import the extra cell typ info
cell_types <- read_table("omics/all_cell_types.txt")


# subset the extra cell info using only cells for for we have expression data
cell_types <- cell_types |>
filter(cell %in% all_cells)


# write that to file
write_csv(cell_types, "omics/er_cell_types.csv")

#
2 changes: 1 addition & 1 deletion omics/all_cell_types.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
LTHSC_broad LMPP_broad MPP_broad CMP_broad MEP_broad GMP_broad MPP1_broad MPP2_broad MPP3_broad STHSC_broad LTHSC LMPP MPP CMP MEP GMP MPP1 MPP2 MPP3 STHSC ESLAM HSC1 Projected
cell LTHSC_broad LMPP_broad MPP_broad CMP_broad MEP_broad GMP_broad MPP1_broad MPP2_broad MPP3_broad STHSC_broad LTHSC LMPP MPP CMP MEP GMP MPP1 MPP2 MPP3 STHSC ESLAM HSC1 Projected
HSPC_001 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
HSPC_002 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
HSPC_003 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Expand Down
Binary file removed omics/all_cell_types.xlsx
Binary file not shown.
1,921 changes: 0 additions & 1,921 deletions omics/all_cell_types_orig.txt

This file was deleted.

281 changes: 281 additions & 0 deletions omics/semester-2/data-raw/surfaceome_hspc.csv

Large diffs are not rendered by default.

281 changes: 281 additions & 0 deletions omics/semester-2/data-raw/surfaceome_prog.csv

Large diffs are not rendered by default.

1,655 changes: 1,655 additions & 0 deletions omics/semester-2/er_cell_types.csv

Large diffs are not rendered by default.

Loading

0 comments on commit d946726

Please sign in to comment.