% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gpart.R
\name{LDblockHeatmap}
\alias{LDblockHeatmap}
\title{visualization of LD block structure}
\usage{
LDblockHeatmap(geno = NULL, SNPinfo = NULL, genofile = NULL,
  SNPinfofile = NULL, geneinfo = NULL, geneinfofile = NULL,
  geneDB = c("ensembl", "ucsc", "file"), assembly = c("GRCh38",
  "GRCh37"), geneid = "hgnc_symbol", ensbversion = NULL,
  geneshow = TRUE, chrN = NULL, startbp = -Inf, endbp = Inf,
  blockresult = NULL, blocktype = c("bigld", "gpart"), minsize = 4,
  maxsize = 50, LD = c("r2", "Dprime", "Dp-str"), MAFcut = 0.05,
  CLQcut = 0.5, CLQmode = c("density", "maximal"), CLQshow = FALSE,
  type = c("png", "tif"), filename = "heatmap", res = 300,
  onlyHeatmap = FALSE)
}
\arguments{
\item{geno}{Data frame or matrix of additive genotype data, each column is additive genotype of each SNP.}

\item{SNPinfo}{Data frame or matrix of SNPs information.  1st column is rsID and 2nd column is bp position.}

\item{genofile}{Character constant; Genotype data file name (supporting format: .txt, .ped, .raw, .traw, .vcf).}

\item{SNPinfofile}{Character constant; SNPinfo data file name (supporting format: .txt, .map).}

\item{geneinfo}{Data frame or matrix of Gene info data.
(1st col : Genename, 2nd col : chromosome, 3rd col : start bp,  4th col : end bp)}

\item{geneinfofile}{A Character constant; file containing the gene information
(1st col : Genename, 2nd col : chromosome, 3rd col : start bp,  4th col : end bp)}

\item{geneDB}{A Character constant; database type for gene information. Set \code{"ensembl"} to get gene info from "Ensembl",
or set \code{"ucsc"} to get gene info from "UCSC genome browser" (See package "biomaRt" or
package "homo.sapiens"/"TxDb.Hsapiens.UCSC.hg38.knownGene"/ "TxDb.Hsapiens.UCSC.hg19.knownGene" for details.)}

\item{assembly}{A character constant; set \code{"GRCh37"} for GRCh37, or set \code{"GRCh38"} for GRCh38}

\item{geneid}{A character constant; When you use the gene information by \code{geneDB}. specity the symbol for gene name to use.
default is "hgnc_symbol".
(eg. 'ensembl_gene_id' for \code{geneDB = "ensembl"}, "ENTREZID"/"ENSEMBL"/"REFSEQ"/"TXNAME" for \code{geneDB="ucsc"}.
See package 'biomaRt' or package 'Homo.sapiens' for details)}

\item{ensbversion}{a integer constant; you can set the release version of ensembl
when you use the gene information by using \code{geneDB='emsembl'} and \code{assembly='GRCh38'}}

\item{geneshow}{logical; do not show the gene information if \code{geneshow=FALSE}.
Default is \code{geneshow=TRUE}}

\item{chrN}{Numeric(or Character) constant ; chromosome number to use.
If the data contains more than one chromosome, you need to specify the chromosome to show.}

\item{startbp}{Numeric constant; starting bp position of the \code{chrN}.}

\item{endbp}{Numeric constant; last bp position of the \code{chrN}.}

\item{blockresult}{Data frame; a result obtained by \code{BigLD} function or \code{GPART}. If \code{NULL}(default),
the function first excute \code{BigLD} or\code{GPART} to obtain block estimation result denpending on the \code{blocktype}.}

\item{blocktype}{Character constant; "bigld" for \code{Big-LD} or "gpart" for \code{GPART}. Default is \code{"gpart"}.}

\item{minsize}{Integer constant; when \code{blockresult=NULL, blocktype="gpart"}
specify the threshold for minsize of a block obtained by \code{GPART}}

\item{maxsize}{Integer constant; when \code{blockresult=NULL, blocktype="gpart"}
specify the threshold for maxsize of a block obtained by \code{GPART}}

\item{LD}{Character constant; LD measure to use, "r2" or "Dprime" or "Dp-str".
LD measures for LD heatmap (and BigLD execution when \code{BigLDresult=NULL}). When \code{LD = "Dp-str"},
heatmap shows only two cases, "weak LD or not-informative" and "strong LD". When \code{LD= Dprime} heatmap shows the estimated D' measures.}

\item{MAFcut}{Numeric constant; MAF threshold of SNPs to use.  Default 0.05}

\item{CLQcut}{Numeric constant; threshold for the correlation value |r|, between 0 to 1. Default 0.5.}

\item{CLQmode}{Character constant; the way to give priority among detected cliques.
if \code{CLQmode = "density"} then the algorithm gives priority to the clique of largest value of \eqn{(Number of SNPs)/(range of clique)},
else if \code{CLQmode = "maximal"}, then the algorithm gives priority to the largest clique. Default "density".}

\item{CLQshow}{logical; Show the LD bin structures, i.e. CLQ results, in each LD blocks.
Notice that if the region to show includes more than 200 SNPs, the function do now show LD bin structures automatically. Default false.}

\item{type}{Character constant; file format of output image file. set \code{png} for PNG format file, or \code{tif} for TIFF format file.}

\item{filename}{Character constant; filename of output image file. Default "heatmap".}

\item{res}{Numeric constant; resolution of image. Default 300.}

\item{onlyHeatmap}{logical; show the LD heatmap without the LD block boundaries. Default false.}
}
\value{
\code{GPART} returns data frame which contains 9 information of each partition
(chromosome, index number of the first SNP and last SNP, rsID of the first SNP and last SNP,
basepair position of the first SNP and last SNP, blocksize, Name of a block)
}
\description{
\code{LDblockHeatmap} visualize the LD structure or LD block results of the inputed data.
LDblockHeatmap <- function(geno=NULL, SNPinfo=NULL, genofile=NULL, SNPinfofile=NULL,geneinfo=NULL, geneinfofile = NULL,
geneDB = c("ensembl","ucsc","file"), assembly = c("GRCh38", "GRCh37"), geneid = "hgnc_symbol",
ensbversion = NULL, chrN=NULL,startbp=-Inf, endbp=Inf, blockresult=NULL, blocktype=c("bigld", "gpart"),
minsize=4, maxsize=50, LD=c("r2", "Dprime", "Dp-str"),  MAFcut=0.05,CLQcut=0.5,
CLQmode=c("density", "maximal"),  CLQshow=FALSE,
type=c("png", "tif"), filename="heatmap", res=300, onlyHeatmap=FALSE)
}
\examples{

LDblockHeatmap(geno=geno[,1:100], SNPinfo=SNPinfo[1:100,], geneinfo=geneinfo,
filename="chr21Heatmap")

}
\seealso{
\code{\link{BigLD}}
}
\author{
Sun-Ah Kim <sunny03@snu.ac.kr>, Yun Joo Yoo <yyoo@snu.ac.kr>
}
