美文网首页数据库
target数据库初探

target数据库初探

作者: 刘伟健_5997 | 来源:发表于2020-09-21 21:33 被阅读0次

在简书上看了很多文章,有很多收获,但自己从来没写过。

生信有很久没碰了,因为需要,又一次捡了起来。

之前在TCGA数据库一直没有找到骨肉瘤的临床数据,不能把基因表达和临床预后结合起来分析。

今天偶然看到了TARGET数据库,发现有骨肉瘤的数据,下载下来整理。

给自己留一个记录,方便复习。

点击TARGET Data Matrix,获取数据

setwd("E:/scRNA seq/osteosarcoma/target/gene copy")

files <- list.files()

for (f in files){

  newname<-sub('-01A-01R.gene.quantification','',f) #将原文件中的字符"",替换为字符""

  file.rename(f,newname)

}   # 批量更改文件名,方便后面批量读取和匹配

clinical <- read.csv(file="./TARGET OS.csv",

                    head = T)

colnames(clinical)[1] <- "patients"

write.csv(clinical, file = "clinical.csv", row.names = F)

patients <- clinical$patients

ls <- list.files()[-1]

ls <- sub(".txt","",ls)

head(ls)

included <- clinical[match(ls, clinical$patients),]

aa <- na.omit(included$patients)

head(aa)

included <- included[match(aa,included$patients),]

match(aa,ls)


先把数据down下来,把gene表达信息和临床数据的患者编号匹配上

setwd("E:/scRNA seq/osteosarcoma/target/gene copy")

filenames <- list.files()

for (file in filenames) {

  if (!exists("all.data")) {

    all.data <- read.table(file, sep = "\t",

                          header = TRUE)[,4]

  }

  if (exists("all.data")) {

    new.data <- read.table(file, sep = "\t",

                          header = TRUE)[,4]

    all.data <- cbind(all.data, new.data)

  }

}

dim(all.data)

counts <- all.data[,-1]

dim(counts)

ls <- sub(".txt","",filenames)

colnames(counts) <- ls

rownames(counts) <- genes


然后循环批量读取表达量数据,这次选取读TPM数。

下次再进行分析。

相关文章

  • target数据库初探

    在简书上看了很多文章,有很多收获,但自己从来没写过。 生信有很久没碰了,因为需要,又一次捡了起来。 之前在TCGA...

  • Flask-SQLAlchemy初探

    Flask-SQLAlchemy初探 连接数据库 SQLAlchemy有多种连接数据库的方式,这里先写一下sqli...

  • python bugs

    操作mysql数据库报错Incorrect string value Django之TIME_ZONE初探 关于P...

  • 数据库 06

    第6章 初探SQL 这里讲关系数据库标准语言SQL。 SQL(Structured Query Language)...

  • 1.5-数据库认识加强

    1.需求前后数据库变化 2.索引和离线数据 3.优化和大数据初探

  • 数据库初探

    基殿码农,代码粗糙,讲话机电口音,望各路大神轻喷....................................

  • 数据库初探

    一、数据库系统的组成:系统服务器:装有数据库软件的一个电脑。数据库:软件 MySQL Oracle等数据表:一个表...

  • 6. 代码实现SQLite-DDL语句

    代码实现SQLite-DDL语句 使用数据库前的准备导入数据库的类库项目工程文件 -> TARGET -> Lin...

  • 008安全和管理2

    一、内存分配 Oracle数据库中,只需要通过参数memory_target来控制数据库占用的总体内存空间即可。 ...

  • 苹果 ARKit 初探

    苹果 ARKit 初探 苹果 ARKit 初探

网友评论

    本文标题:target数据库初探

    本文链接:https://www.haomeiwen.com/subject/vnpbyktx.html