美文网首页
structure绘图(Rscript)

structure绘图(Rscript)

作者: 曹草BioInfo | 来源:发表于2022-07-13 19:43 被阅读0次

pophelper(R 包)

#!/usr/bin/env Rscript
# parse parameter ---------------------------------------------------------
library(argparser, quietly=TRUE)
# Create a parser
p <- arg_parser("draw sturcture figure for admixture result")

# Add command line arguments
p <- add_argument(p, "dir", help="input: Q matirx dir", type="character")
p <- add_argument(p, "sample", help="input: samplefile, ie  .nosex", type="character")
p <- add_argument(p, "sample_order", help="input: sample order file, define order in output figure ", type="character")
p <- add_argument(p, "output", help="output prefix", type="character")

# Parse the command line arguments
argv <- parse_args(p)

dir <- argv$dir
samp <- argv$sample
ord  <- argv$sample_order
outpre <- argv$output


#dir <- "result/"
#samp <- "./all.fam"
#ord  <- "./all.fam"
#outpre <- "test"


library(pophelper)
library(ggplot2)

Qfiles <- list.files( dir, pattern = "Q", full.names = T )
qlist <- readQ(Qfiles,  indlabfromfile=F)
sorted排序
ordered排序

相关文章

网友评论

      本文标题:structure绘图(Rscript)

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