> options(stringsAsFactors = FALSE)
> test.count<-read.table("~/rna_seq_analysis/count/merge.count",sep = "\t",col.names = c("gene_id","1","2","3","4"))
> head(test.count)
> tail(test.count)
gene_id X1 X2 X3 X4
60637 ENSG00000285513.1_1 0 0 0 NA
60638 __no_feature 8680643 8944662 10720757 NA
60639 __ambiguous 4102721 3041451 4345820 NA
60640 __too_low_aQual 1833103 1445781 1221864 NA
60641 __not_aligned 6141315 8760975 1091549 NA
60642 __alignment_not_unique 8252953 29421548 26500688 NA
> test_filter.count<-test.count[-60638:-60642,]
> test_filter2.count<-test_filter.count[,-5]
> ENSEMBL <- gsub("\\.\\d*", "", test_filter2.count$gene_id)
> test_filter2.count$gene_id <- ENSEMBL
> tail(test_filter2.count)
gene_id X1 X2 X3
60632 ENSG00000285492_1 1 1 0
60633 ENSG00000285498_1 0 0 0
60634 ENSG00000285505_1 0 0 0
60635 ENSG00000285508_1 0 0 0
60636 ENSG00000285509_1 10 11 2
60637 ENSG00000285513_1 0 0 0
> ENSEMBL <- gsub("\\_\\d*", "", test_filter2.count$gene_id)
> test_filter2.count$gene_id <- ENSEMBL
> tail(test_filter2.count)
gene_id X1 X2 X3
60632 ENSG00000285492 1 1 0
60633 ENSG00000285498 0 0 0
60634 ENSG00000285505 0 0 0
60635 ENSG00000285508 0 0 0
60636 ENSG00000285509 10 11 2
60637 ENSG00000285513 0 0 0
网友评论