library(dplyr)
data=read.table("all.pNpS.tsv",row.names=1,header=1)
head(data)
source('new.cbind.R')
nd=as.data.frame(matrix(NA,0,0))
for (i in 1:ncol(data)){
print(i)
j=select(data,all_of(i))
j=as.matrix(na.omit(j))
sum=apply(j,1,sum)
j=as.data.frame(j[sum>1,])
nd=new.cbind(nd,j)
}
colnames(nd)=colnames(data)
ncol(nd)
write.table(nd,"positive_select_gene.tsv",quote=F,row.names=T)
