% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/GWASTrack.R
\docType{class}
\name{GWASTrack-class}
\alias{GWASTrack-class}
\alias{.GWASTrack}
\alias{GWASTrack}
\title{Constructor for GWASTrack}
\usage{
GWASTrack(
  trackName,
  data,
  chrom.col,
  pos.col,
  pval.col,
  chromosomeColorMap = list(),
  trackHeight = 50,
  autoscale = TRUE,
  minY = 0,
  maxY = 30
)
}
\arguments{
\item{trackName}{A character string, used as track label by igv,
we recommend unique names per track.}

\item{data}{a data.frame or a url pointing to one,
whose structure is described by chrom.col, pos.col, pval.col}

\item{chrom.col}{numeric, the column number of the chromosome column}

\item{pos.col}{numeric, the column number of the position column}

\item{pval.col}{numeric, the column number of the GWAS pvalue column}

\item{chromosomeColorMap}{a named list or character vector mapping
chromosome names, as they are spelled in the data, to colors,
e.g. \code{list("1" = "red", "2" = "blue")}. A \code{"*"} entry colors every
chromosome not named explicitly. Empty by default, which leaves the igv.js
chromosome palette in place}

\item{trackHeight}{numeric in pixels}

\item{autoscale}{logical}

\item{minY}{numeric for explicit (non-auto) scaling}

\item{maxY}{numeric for explicit (non-auto) scaling}
}
\value{
A GWASTrack object
}
\description{
\code{GWASTrack} creates an \code{IGV} manhattan track from GWAS data
}
\examples{
file <-
  # a local gwas file
  system.file(package = "igvShiny", "extdata", "gwas-5k.tsv.gz")
tbl.gwas <- read.table(file,
                       sep = "\t",
                       header = TRUE,
                       quote = "")
dim(tbl.gwas)
track <-
  GWASTrack(
    "gwas 5k",
    tbl.gwas,
    chrom.col = 12,
    pos.col = 13,
    pval.col = 28
  )
getUrl(track)

# a remote gwas file: the constructor checks that the url resolves, so this
# block reaches the network and stays out of R CMD check
\donttest{
url <- "https://gladki.pl/igvShiny/gwas_sample.tsv.gz"
track <- GWASTrack(
  "remote url gwas",
  url,
  chrom.col = 3,
  pos.col = 4,
  pval.col = 10,
  autoscale = FALSE,
  minY = 0,
  maxY = 300,
  trackHeight = 100
)
getUrl(track)
}

# colors picked per chromosome, with "*" covering the rest
track <- GWASTrack(
  "gwas 5k, custom colors",
  tbl.gwas,
  chrom.col = 12,
  pos.col = 13,
  pval.col = 28,
  chromosomeColorMap = list("1" = "red", "2" = "blue", "*" = "gray")
)


}
\keyword{GWASTrack_class}
