R/get.strains.R

Defines functions get.strains

Documented in get.strains

get.strains <-
function(file = "http://cgd.jax.org/tools/SNPtools/Build38/sanger.snps.NCBI38.txt.gz") {

  # Open the connection SNP file.
  con = TabixFile(file)
  open(con)

  # Get the column names from the last row of the header info.
  hdr = headerTabix(con)

  # Close the connection.
  close(con)

  strains = sub("^#", "", strsplit(hdr$header[[length(hdr$header)]],
                split = "\t")[[1]])
  strains = strains[-1:-5]
  qual.cols = grep("quality", strains)
  if(length(qual.cols) > 0) {
    strains = strains[-qual.cols]
  } # if(length(qual.cols) > 0)

  return(strains)

}

Try the SNPtools package in your browser

Any scripts or data that you put into this service are public.

SNPtools documentation built on May 29, 2017, 3:12 p.m.