## ----- global_options,包括= false ------------------------------------------------------------------------------------------------------------------------------------------ knitr :: opts_chunk $ set(警告= false,message = false)## ---- load_package ------------------------------------------------------------------------------------------------------------------------------------------- library(scoreInvHap) ## ---- eval=FALSE--------------------------------------------------------------------------------------------------#library(snpstats)####从床上#snps < - read.plink(“ example.bed”)####从pedfile#snps < - 阅读。-------------------------------------库(variantannotation)vcf_file <-System.file(“ extdata”,“ example.vcf”,package = =“ ScoreInvhap”)VCF <-ReadVCF(VCF_FILE,“ HG19”)VCF ## ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------]VCF)检查VCF < - 检查$ GENOS ## ----分类--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- res <-ScoreInvhap(snplist = vcf,inv =“ inv7_005”)res ## -- classify_par,eval = false ----------------------------------------------------------------------------------------#res <-Scoreinvhap(snplist = vcf,inv=“ Inv7_005”,#bpparam = Biocparallelal :: MulticoreParam(8))## ----------------------------------------------------------------------------------------------------------------------#获取分类头(分类(RES))#获得分数头(分数(RES))## ---- ScoreInvhap分数-------------------------------------------------------------------------------------------------------------------#获得最大得分头(MaxScores(RES))#获取差异得分头(DIFFSCORES(RES))## ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- plotScores(res, pch = 16, main = "QC based on scores") ## ----------------------------------------------------------------------------- # Get Number of scores used head(numSNPs(res)) # Get call rate head(propSNPs(res)) ## ----------------------------------------------------------------------------- plotCallRate(res, main = "Call Rate QC") ## ----------------------------------------------------------------------------- ## No filtering length(classification(res)) ## QC filtering length(classification(res, minDiff = 0.1, callRate = 0.9)) ## ----------------------------------------------------------------------------- ## Inversion classification table(classification(res)) ## Haplotype classification table(classification(res, inversion = FALSE)) ## ---- classify imputed-------------------------------------------------------- res_imp <- scoreInvHap(SNPlist = vcf, inv = "inv7_005", probs = TRUE) res_imp ## ---- compare classifications------------------------------------------------- table(PostProbs = classification(res_imp), BestGuess = classification(res)) ## ----------------------------------------------------------------------------- data(inversionGR) inversionGR ## ----------------------------------------------------------------------------- sessionInfo()