码迷,mamicode.com
首页 > 其他好文 > 详细

R which

时间:2019-09-15 19:51:54      阅读:99      评论:0      收藏:0      [点我收藏+]

标签:rom   tar   setw   nts   bio   count   vector   set   odi   

 1 setwd("E:/courses/molecular biology/homework1st")
 2 genes <- read.table(genes.txt,sep = \t,header = T)
 3 
 4 chrID<-c("chr1","chr2","chr3","chr4","chr5","chr6","chr7","chr8","chr9","chr10","chr11","chr12",
 5          "chr13","chr14","chr15","chr16","chr17","chr18","chr19","chr20","chr21","chr22","chrX","chrY")
 6 pro_counts=vector()
 7 for(chr in chrID){
 8   chr<-genes[genes$chrom==chr,]
 9   protein_coding<-chr$cdsEnd-chr$cdsStart
10   pro_counts<-c(pro_counts,length(which(protein_coding>0)))
11 }

 

R which

标签:rom   tar   setw   nts   bio   count   vector   set   odi   

原文地址:https://www.cnblogs.com/shanyr/p/11523508.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!