get_mby2_ref.r 514 B

123456789101112131415
  1. library(mclust)
  2. args<- commandArgs(TRUE)
  3. chrf<-args[1]
  4. num<- 5
  5. num<- ifelse(is.na(args[2]),num,args[2])
  6. chr.data<-read.table(file=chrf,sep="\t",row.names=1,header=TRUE,comment.char='')
  7. xydata<-chr.data[,1:2]
  8. samples<-row.names(xydata)
  9. xymod<- Mclust(xydata,num)
  10. pdf(file="FMBY2_chrXY_class.pdf")
  11. plot(xymod, what = "classification")
  12. dev.off()
  13. nclass<-which.max(table(xymod$classification))
  14. refs<-samples[xymod$classification==nclass]
  15. write.table(file="M.ref.list",refs,quote=FALSE,row.names=FALSE,col.names=FALSE)