Package picard.vcf
Class MergeVcfs
java.lang.Object
picard.cmdline.CommandLineProgram
picard.vcf.MergeVcfs
Combines multiple variant files into a single variant file.
Inputs
- One or more input file in VCF format (can be gzipped, i.e. ending in ".vcf.gz", or binary compressed, i.e. ending in ".bcf").
- Optionally a sequence dictionary file (typically name ending in .dict) if the input VCF does not contain a complete contig list and if the output index is to be created (true by default).
The input variant data must adhere to the following rules:
- If there are samples, those must be the same across all input files.
- Input file headers must be contain compatible declarations for common annotations (INFO, FORMAT fields) and filters.
- Input files variant records must be sorted by their contig and position following the sequence dictionary provided or the header contig list.
You can either directly specify the list of files by specifying INPUT
multiple times, or provide a list
in a file with name ending in ".list" to INPUT
.
Outputs
A VCF sorted (i) according to the dictionary and (ii) by coordiante.Usage examples
Example 1:
We combine several variant files in different formats, where at least one of them contains the contig list in its header.java -jar picard.jar MergeVcfs \ I=input_variants.01.vcf \ I=input_variants.02.vcf.gz \ O=output_variants.vcf.gz
Example 2:
Similar to example 1 but we use an input list file to specify the input files:java -jar picard.jar MergeVcfs \ I=input_variant_files.list \ O=output_variants.vcf.gz
- Since:
- 1.0.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class picard.cmdline.CommandLineProgram
COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, MAX_ALLOWABLE_ONE_LINE_SUMMARY_LENGTH, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, SYNTAX_TRANSITION_URL, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected int
doWork()
Do the work after command line has been parsed.Methods inherited from class picard.cmdline.CommandLineProgram
checkRInstallation, customCommandLineValidation, getCommandLine, getCommandLineParser, getCommandLineParserForArgs, getDefaultHeaders, getFaqLink, getMetricsFile, getPGRecord, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser
-
Field Details
-
INPUT
@Argument(shortName="I", doc="VCF or BCF input files (File format is determined by file extension), or a file having a \'.list\' suffix containing the path to the files, one per line.", minElements=1) public List<PicardHtsPath> INPUT -
OUTPUT
@Argument(shortName="O", doc="The merged VCF or BCF file. File format is determined by file extension.") public File OUTPUT -
SEQUENCE_DICTIONARY
@Argument(shortName="D", doc="The index sequence dictionary to use instead of the sequence dictionary in the input files", optional=true) public PicardHtsPath SEQUENCE_DICTIONARY -
COMMENT
-
-
Constructor Details
-
MergeVcfs
public MergeVcfs()
-
-
Method Details
-
doWork
protected int doWork()Description copied from class:CommandLineProgram
Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.- Specified by:
doWork
in classCommandLineProgram
- Returns:
- program exit status.
-