# Class SnpSift

java.lang.Object
org.snpsift.SnpSift

All Implemented Interfaces:
  `org.snpeff.snpEffect.commandLine.CommandLine, org.snpeff.snpEffect.VcfAnnotator`

Direct Known Subclasses:
  `SnpSiftCmdAlleleMatrix, SnpSiftCmdAnnotate, SnpSiftCmdAnnotateDf, SnpSiftCmdCaseControl, SnpSiftCmdCaseControlSummary, SnpSiftCmdConcordance, SnpSiftCmdCovarianceMatrix, SnpSiftCmdDbNsfp, SnpSiftCmdExtractFields, SnpSiftCmdFilter, SnpSiftCmdFilterChrPos, SnpSiftCmdFilterGt, SnpSiftCmdGeneSets, SnpSiftCmdGt, SnpSiftCmdGwasCatalog, SnpSiftCmdHwe, SnpSiftCmdIntersect, SnpSiftCmdIntervals, SnpSiftCmdIntervalsIndex, SnpSiftCmdJoin, SnpSiftCmdPedShow, SnpSiftCmdPhastCons, SnpSiftCmdPrivate, SnpSiftCmdRemoveReferenceGenotypes, SnpSiftCmdRmInfo, SnpSiftCmdSort, SnpSiftCmdSplit, SnpSiftCmdTsTv, SnpSiftCmdVarType, SnpSiftCmdVcf2Tped, SnpSiftCmdVcfCheck, SnpSiftCmdVcfOperator`

public class SnpSift extends Object implements org.snpeff.snpEffect.VcfAnnotator
Generic SnpSift tool caller

Author:
  pablocingolani

## Field Summary

Fields
Modifier and Type
Field
Description
`protected String[]`
`args`
`static final String`
`BUILD`
`protected String`
`command`
`protected org.snpeff.snpEffect.Config`
`config`
`protected String`
`configFile`
`protected String`
`dataDir`
`protected String`
`dbFileName`
`protected boolean`
`dbTabix`
`protected String`
`dbType`
`protected boolean`
`debug`
`protected boolean`
`download`
`static final String[]`
`EMPTY_ARGS`
`protected HashMap<String,Integer>`
`errCount`
`protected String`
`genomeVersion`
`protected boolean`
`help`
`protected boolean`
`log`
`protected boolean`
`needsConfig`
`protected boolean`
`needsDb`
`protected boolean`
`needsGenome`
`protected int`
`numWorkers`
`protected StringBuilder`
`output`
`protected boolean`
`quiet`
`static final String`
`REVISION`
`protected boolean`
`saveOutput`
`protected String[]`
`shiftArgs`
`static int`
`SHOW_EVERY_VCFLINES`
`protected boolean`
`showVcfHeader`
`protected boolean`
`showVersion`
`static final String`
`SOFTWARE_NAME`
`protected boolean`
`suppressOutput`
`protected boolean`
`vcfHeaderAddProgramVersion`
`protected boolean`
`vcfHeaderProcessed`
`protected String`
`vcfInputFile`
`protected boolean`
`verbose`
`static final String`
`VERSION`
`static final String`
`VERSION_MAJOR`
`static final String`
`VERSION_NO_NAME`
`static final String`
`VERSION_SHORT`

## Constructor Summary

Constructors
Constructor
Description
`SnpSift()`
`SnpSift(String[] args)`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`addHeaders(org.snpeff.fileIterator.VcfFileIterator vcfFile)`
Add VCF headers
`boolean`
`annotate(org.snpeff.vcf.VcfEntry vcfEntry)`
`boolean`
`annotateFinish(org.snpeff.fileIterator.VcfFileIterator vcfFile)`
`boolean`
`annotateInit(org.snpeff.fileIterator.VcfFileIterator vcfFile)`
`SnpSift`
`cmd()`
Run: Executes the appropriate class
`protected String`
`commandLineStr()`
Show command line
`protected boolean`
`databaseDownload()`
Download a database
`protected String`
`databaseFind()`
Find database file name.
`void`
`error(Throwable e, String message)`
Show an error (if not 'quiet' mode)
`String[]`
`getArgs()`
`org.snpeff.snpEffect.Config`
`getConfig()`
`String`
`getConfigFile()`
`String`
`getOutput()`
`protected List<org.snpeff.vcf.VcfHeaderEntry>`
`headers()`
Headers to add
`void`
`init()`
Initialize default values
`protected boolean`
`isOpt(String arg)`
Is this a command line option (e.g.
`protected void`
`loadConfig()`
Read config file
`static void`
`main(String[] args)`
Main
`protected org.snpeff.fileIterator.VcfFileIterator`
`openVcfInputFile()`
Open VCF input file
`void`
`parseArgs(String[] args)`
Parse command line arguments
`protected String`
`processVcfHeader(org.snpeff.fileIterator.VcfFileIterator vcf)`
Process VCF header related issues
`boolean`
`run()`
`void`
`setCommand(Class clss)`
`void`
`setCommand(String command)`
`void`
`setConfig(org.snpeff.snpEffect.Config config)`
`void`
`setConfigFile(String configFile)`
`void`
`setDbFileName(String dbFileName)`
`void`
`setDebug(boolean debug)`
`void`
`setQuiet(boolean quiet)`
`void`
`setSaveOutput(boolean saveOutput)`
`void`
`setShowVcfHeader(boolean showVcfHeader)`
`void`
`setShowVersion(boolean showVersion)`
`void`
`setSuppressOutput(boolean suppressOutput)`
`void`
`setVcfHeaderAddProgramVersion(boolean vcfHeaderAddProgramVersion)`
`void`
`setVerbose(boolean verbose)`
`void`
`showCmd()`
Show command line
`void`
`showVersion()`
Show version number
`String`
`unSanitize(String str)`
Convert a sanitized expression (from Galaxy) back to the original string References: http://www.mail-archive.com/galaxy-dev@lists.bx.psu.edu/msg00530.html
`void`
`usage(String msg)`
Show usage message
`protected void`
`usageGenericAndDb()`
Options common to all commands

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### BUILD

public static final String BUILD

See Also:
  - Constant Field Values

### SOFTWARE_NAME

public static final String SOFTWARE_NAME

See Also:
  - Constant Field Values

### VERSION_MAJOR

public static final String VERSION_MAJOR

See Also:
  - Constant Field Values

### REVISION

public static final String REVISION

See Also:
  - Constant Field Values

### VERSION_SHORT

public static final String VERSION_SHORT

See Also:
  - Constant Field Values

### VERSION

public static final String VERSION

See Also:
  - Constant Field Values

### VERSION_NO_NAME

public static final String VERSION_NO_NAME

See Also:
  - Constant Field Values

### SHOW_EVERY_VCFLINES

public static int SHOW_EVERY_VCFLINES

### EMPTY_ARGS

public static final String[] EMPTY_ARGS

### dbTabix

protected boolean dbTabix

### debug

protected boolean debug

### download

protected boolean download

### help

protected boolean help

### log

protected boolean log

### needsConfig

protected boolean needsConfig

### needsDb

protected boolean needsDb

### needsGenome

protected boolean needsGenome

### quiet

protected boolean quiet

### saveOutput

protected boolean saveOutput

### showVcfHeader

protected boolean showVcfHeader

### showVersion

protected boolean showVersion

### suppressOutput

protected boolean suppressOutput

### vcfHeaderProcessed

protected boolean vcfHeaderProcessed

### vcfHeaderAddProgramVersion

protected boolean vcfHeaderAddProgramVersion

### verbose

protected boolean verbose

### args

protected String[] args

### command

protected String command

### dbFileName

protected String dbFileName

### dbType

protected String dbType

### genomeVersion

protected String genomeVersion

### vcfInputFile

protected String vcfInputFile

### numWorkers

protected int numWorkers

### output

protected StringBuilder output

### errCount

protected HashMap<String,Integer> errCount

### config

protected org.snpeff.snpEffect.Config config

### configFile

protected String configFile

### dataDir

protected String dataDir

### shiftArgs

protected String[] shiftArgs

## Constructor Details

### SnpSift

public SnpSift()

### SnpSift

public SnpSift(String[] args)

## Method Details

### main

public static void main(String[] args)
Main

### addHeaders

public boolean addHeaders(org.snpeff.fileIterator.VcfFileIterator vcfFile)
Add VCF headers

Specified by:
  `addHeaders` in interface `org.snpeff.snpEffect.VcfAnnotator`

### annotate

public boolean annotate(org.snpeff.vcf.VcfEntry vcfEntry)

Specified by:
  `annotate` in interface `org.snpeff.snpEffect.VcfAnnotator`

### annotateFinish

public boolean annotateFinish(org.snpeff.fileIterator.VcfFileIterator vcfFile)

Specified by:
  `annotateFinish` in interface `org.snpeff.snpEffect.VcfAnnotator`

### annotateInit

public boolean annotateInit(org.snpeff.fileIterator.VcfFileIterator vcfFile)

Specified by:
  `annotateInit` in interface `org.snpeff.snpEffect.VcfAnnotator`

### cmd

public SnpSift cmd()
Run: Executes the appropriate class

### commandLineStr

protected String commandLineStr()
Show command line

### databaseDownload

protected boolean databaseDownload()
Download a database

### databaseFind

protected String databaseFind()
Find database file name.

### error

public void error(Throwable e, String message)
Show an error (if not 'quiet' mode)

### getArgs

public String[] getArgs()

Specified by:
  `getArgs` in interface `org.snpeff.snpEffect.commandLine.CommandLine`

### getConfig

public org.snpeff.snpEffect.Config getConfig()

### getConfigFile

public String getConfigFile()

### getOutput

public String getOutput()

### headers

protected List<org.snpeff.vcf.VcfHeaderEntry> headers()
Headers to add

### init

public void init()
Initialize default values

### isOpt

protected boolean isOpt(String arg)
Is this a command line option (e.g. "-tfam" is a command line option, but "-" means STDIN)

### loadConfig

protected void loadConfig()
Read config file

### openVcfInputFile

protected org.snpeff.fileIterator.VcfFileIterator openVcfInputFile()
Open VCF input file

### parseArgs

public void parseArgs(String[] args)
Parse command line arguments

Specified by:
  `parseArgs` in interface `org.snpeff.snpEffect.commandLine.CommandLine`

### processVcfHeader

protected String processVcfHeader(org.snpeff.fileIterator.VcfFileIterator vcf)
Process VCF header related issues

### run

public boolean run()

Specified by:
  `run` in interface `org.snpeff.snpEffect.commandLine.CommandLine`

### setCommand

public void setCommand(Class clss)

### setCommand

public void setCommand(String command)

### setConfig

public void setConfig(org.snpeff.snpEffect.Config config)

Specified by:
  `setConfig` in interface `org.snpeff.snpEffect.VcfAnnotator`

### setConfigFile

public void setConfigFile(String configFile)

### setDbFileName

public void setDbFileName(String dbFileName)

### setDebug

public void setDebug(boolean debug)

Specified by:
  `setDebug` in interface `org.snpeff.snpEffect.VcfAnnotator`

### setQuiet

public void setQuiet(boolean quiet)

### setSaveOutput

public void setSaveOutput(boolean saveOutput)

### setShowVcfHeader

public void setShowVcfHeader(boolean showVcfHeader)

### setShowVersion

public void setShowVersion(boolean showVersion)

### setSuppressOutput

public void setSuppressOutput(boolean suppressOutput)

### setVcfHeaderAddProgramVersion

public void setVcfHeaderAddProgramVersion(boolean vcfHeaderAddProgramVersion)

### setVerbose

public void setVerbose(boolean verbose)

Specified by:
  `setVerbose` in interface `org.snpeff.snpEffect.VcfAnnotator`

### showCmd

public void showCmd()
Show command line

### showVersion

public void showVersion()
Show version number

### unSanitize

public String unSanitize(String str)
Convert a sanitized expression (from Galaxy) back to the original string References: http://www.mail-archive.com/galaxy-dev@lists.bx.psu.edu/msg00530.html

### usage

public void usage(String msg)
Show usage message

Specified by:
  `usage` in interface `org.snpeff.snpEffect.commandLine.CommandLine`

### usageGenericAndDb

protected void usageGenericAndDb()
Options common to all commands