Merge alignment data from a SAM or BAM with data in an unmapped BAM file.
java -jar picard.jar MergeBamAlignment \\ ALIGNED=aligned.bam \\ UNMAPPED=unmapped.bam \\ O=merge_alignments.bam \\ R=reference_sequence.fasta
This table summarizes the command-line arguments that are specific to this tool. For more details on each argument, see the list further down below the table or click on an argument name to jump directly to that entry in the list.
Argument name(s) | Default value | Summary | |
---|---|---|---|
Required Arguments | |||
--OUTPUT -O |
null | Merged SAM or BAM file to write to. | |
--REFERENCE_SEQUENCE -R |
null | Reference sequence file. | |
--UNMAPPED_BAM -UNMAPPED |
null | Original SAM or BAM file of unmapped reads, which must be in queryname order. | |
Optional Tool Arguments | |||
--ADD_MATE_CIGAR -MC |
true | Adds the mate CIGAR tag (MC) if true, does not if false. | |
--ALIGNED_BAM -ALIGNED |
[] | SAM or BAM file(s) with alignment data. | |
--ALIGNED_READS_ONLY |
false | Whether to output only aligned reads. | |
--ALIGNER_PROPER_PAIR_FLAGS |
false | Use the aligner's idea of what a proper pair is rather than computing in this program. | |
--arguments_file |
[] | read one or more arguments files and add them to the command line | |
--ATTRIBUTES_TO_REMOVE |
[] | Attributes from the alignment record that should be removed when merging. This overrides ATTRIBUTES_TO_RETAIN if they share common tags. | |
--ATTRIBUTES_TO_RETAIN |
[] | Reserved alignment attributes (tags starting with X, Y, or Z) that should be brought over from the alignment data when merging. | |
--ATTRIBUTES_TO_REVERSE -RV |
[OQ, U2] | Attributes on negative strand reads that need to be reversed. | |
--ATTRIBUTES_TO_REVERSE_COMPLEMENT -RC |
[E2, SQ] | Attributes on negative strand reads that need to be reverse complemented. | |
--CLIP_ADAPTERS |
true | Whether to clip adapters where identified. | |
--CLIP_OVERLAPPING_READS |
true | For paired reads, soft clip the 3' end of each read if necessary so that it does not extend past the 5' end of its mate. | |
--EXPECTED_ORIENTATIONS -ORIENTATIONS |
[] | The expected orientation of proper read pairs. Replaces JUMP_SIZE | |
--help -h |
false | display the help message | |
--INCLUDE_SECONDARY_ALIGNMENTS |
true | If false, do not write secondary alignments to output. | |
--IS_BISULFITE_SEQUENCE |
false | Whether the lane is bisulfite sequence (used when calculating the NM tag). | |
--MATCHING_DICTIONARY_TAGS |
[M5, LN] | List of Sequence Records tags that must be equal (if present) in the reference dictionary and in the aligned file. Mismatching tags will cause an error if in this list, and a warning otherwise. | |
--MAX_INSERTIONS_OR_DELETIONS -MAX_GAPS |
1 | The maximum number of insertions or deletions permitted for an alignment to be included. Alignments with more than this many insertions or deletions will be ignored. Set to -1 to allow any number of insertions or deletions. | |
--MIN_UNCLIPPED_BASES |
32 | If UNMAP_CONTAMINANT_READS is set, require this many unclipped bases or else the read will be marked as contaminant. | |
--PRIMARY_ALIGNMENT_STRATEGY |
BestMapq | Strategy for selecting primary alignment when the aligner has provided more than one alignment for a pair or fragment, and none are marked as primary, more than one is marked as primary, or the primary alignment is filtered out for some reason. For all strategies, ties are resolved arbitrarily. | |
--PROGRAM_GROUP_COMMAND_LINE -PG_COMMAND |
null | The command line of the program group (if not supplied by the aligned file). | |
--PROGRAM_GROUP_NAME -PG_NAME |
null | The name of the program group (if not supplied by the aligned file). | |
--PROGRAM_GROUP_VERSION -PG_VERSION |
null | The version of the program group (if not supplied by the aligned file). | |
--PROGRAM_RECORD_ID -PG |
null | The program group ID of the aligner (if not supplied by the aligned file). | |
--READ1_ALIGNED_BAM -R1_ALIGNED |
[] | SAM or BAM file(s) with alignment data from the first read of a pair. | |
--READ1_TRIM -R1_TRIM |
0 | The number of bases trimmed from the beginning of read 1 prior to alignment | |
--READ2_ALIGNED_BAM -R2_ALIGNED |
[] | SAM or BAM file(s) with alignment data from the second read of a pair. | |
--READ2_TRIM -R2_TRIM |
0 | The number of bases trimmed from the beginning of read 2 prior to alignment | |
--SORT_ORDER -SO |
coordinate | The order in which the merged reads should be output. | |
--UNMAP_CONTAMINANT_READS -UNMAP_CONTAM |
false | Detect reads originating from foreign organisms (e.g. bacterial DNA in a non-bacterial sample),and unmap + label those reads accordingly. | |
--UNMAPPED_READ_STRATEGY |
DO_NOT_CHANGE | How to deal with alignment information in reads that are being unmapped (e.g. due to cross-species contamination.) Currently ignored unless UNMAP_CONTAMINANT_READS = true | |
--version |
false | display the version number for this tool | |
Optional Common Arguments | |||
--ADD_PG_TAG_TO_READS |
true | Add PG tag to each read in a SAM or BAM | |
--COMPRESSION_LEVEL |
5 | Compression level for all compressed files created (e.g. BAM and VCF). | |
--CREATE_INDEX |
false | Whether to create a BAM index when writing a coordinate-sorted BAM file. | |
--CREATE_MD5_FILE |
false | Whether to create an MD5 digest for any BAM or FASTQ files created. | |
--GA4GH_CLIENT_SECRETS |
client_secrets.json | Google Genomics API client_secrets.json file path. | |
--MAX_RECORDS_IN_RAM |
500000 | When writing files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort the file, and increases the amount of RAM needed. | |
--QUIET |
false | Whether to suppress job-summary info on System.err. | |
--TMP_DIR |
[] | One or more directories with space available to be used by this program for temporary storage of working files | |
--USE_JDK_DEFLATER -use_jdk_deflater |
false | Use the JDK Deflater instead of the Intel Deflater for writing compressed output | |
--USE_JDK_INFLATER -use_jdk_inflater |
false | Use the JDK Inflater instead of the Intel Inflater for reading compressed input | |
--VALIDATION_STRINGENCY |
STRICT | Validation stringency for all SAM files read by this program. Setting stringency to SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded. | |
--VERBOSITY |
INFO | Control verbosity of logging. | |
Advanced Arguments | |||
--showHidden |
false | display hidden arguments | |
Deprecated Arguments | |||
--JUMP_SIZE -JUMP |
null | The expected jump size (required if this is a jumping library). Deprecated. Use EXPECTED_ORIENTATIONS instead | |
--PAIRED_RUN -PE |
true | DEPRECATED. This argument is ignored and will be removed. |
Arguments in this list are specific to this tool. Keep in mind that other arguments are available that are shared with other tools (e.g. command-line GATK arguments); see Inherited arguments above.
Adds the mate CIGAR tag (MC) if true, does not if false.
Boolean true
Add PG tag to each read in a SAM or BAM
Boolean true
SAM or BAM file(s) with alignment data.
Exclusion: This argument cannot be used at the same time as READ1_ALIGNED_BAM, READ2_ALIGNED_BAM, R1_ALIGNED, R2_ALIGNED
.
List[File] []
Whether to output only aligned reads.
boolean false
Use the aligner's idea of what a proper pair is rather than computing in this program.
boolean false
read one or more arguments files and add them to the command line
List[File] []
Attributes from the alignment record that should be removed when merging. This overrides ATTRIBUTES_TO_RETAIN if they share common tags.
List[String] []
Reserved alignment attributes (tags starting with X, Y, or Z) that should be brought over from the alignment data when merging.
List[String] []
Attributes on negative strand reads that need to be reversed.
Set[String] [OQ, U2]
Attributes on negative strand reads that need to be reverse complemented.
Set[String] [E2, SQ]
Whether to clip adapters where identified.
boolean true
For paired reads, soft clip the 3' end of each read if necessary so that it does not extend past the 5' end of its mate.
boolean true
Compression level for all compressed files created (e.g. BAM and VCF).
int 5 [ [ -∞ ∞ ] ]
Whether to create a BAM index when writing a coordinate-sorted BAM file.
Boolean false
Whether to create an MD5 digest for any BAM or FASTQ files created.
boolean false
The expected orientation of proper read pairs. Replaces JUMP_SIZE
Exclusion: This argument cannot be used at the same time as JUMP_SIZE
.
List[PairOrientation] []
Google Genomics API client_secrets.json file path.
String client_secrets.json
display the help message
boolean false
If false, do not write secondary alignments to output.
boolean true
Whether the lane is bisulfite sequence (used when calculating the NM tag).
boolean false
The expected jump size (required if this is a jumping library). Deprecated. Use EXPECTED_ORIENTATIONS instead
Exclusion: This argument cannot be used at the same time as EXPECTED_ORIENTATIONS, ORIENTATIONS
.
Integer null
List of Sequence Records tags that must be equal (if present) in the reference dictionary and in the aligned file. Mismatching tags will cause an error if in this list, and a warning otherwise.
List[String] [M5, LN]
The maximum number of insertions or deletions permitted for an alignment to be included. Alignments with more than this many insertions or deletions will be ignored. Set to -1 to allow any number of insertions or deletions.
int 1 [ [ -∞ ∞ ] ]
When writing files that need to be sorted, this will specify the number of records stored in RAM before spilling to disk. Increasing this number reduces the number of file handles needed to sort the file, and increases the amount of RAM needed.
Integer 500000 [ [ -∞ ∞ ] ]
If UNMAP_CONTAMINANT_READS is set, require this many unclipped bases or else the read will be marked as contaminant.
int 32 [ [ -∞ ∞ ] ]
Merged SAM or BAM file to write to.
R File null
DEPRECATED. This argument is ignored and will be removed.
Boolean true
Strategy for selecting primary alignment when the aligner has provided more than one alignment for a pair or fragment, and none are marked as primary, more than one is marked as primary, or the primary alignment is filtered out for some reason. For all strategies, ties are resolved arbitrarily.
The --PRIMARY_ALIGNMENT_STRATEGY argument is an enumerated type (PrimaryAlignmentStrategy), which can have one of the following values:
PrimaryAlignmentStrategy BestMapq
The command line of the program group (if not supplied by the aligned file).
String null
The name of the program group (if not supplied by the aligned file).
String null
The version of the program group (if not supplied by the aligned file).
String null
The program group ID of the aligner (if not supplied by the aligned file).
String null
Whether to suppress job-summary info on System.err.
Boolean false
SAM or BAM file(s) with alignment data from the first read of a pair.
Exclusion: This argument cannot be used at the same time as ALIGNED_BAM
.
List[File] []
The number of bases trimmed from the beginning of read 1 prior to alignment
int 0 [ [ -∞ ∞ ] ]
SAM or BAM file(s) with alignment data from the second read of a pair.
Exclusion: This argument cannot be used at the same time as ALIGNED_BAM
.
List[File] []
The number of bases trimmed from the beginning of read 2 prior to alignment
int 0 [ [ -∞ ∞ ] ]
Reference sequence file.
R File null
display hidden arguments
boolean false
The order in which the merged reads should be output.
The --SORT_ORDER argument is an enumerated type (SortOrder), which can have one of the following values:
SortOrder coordinate
One or more directories with space available to be used by this program for temporary storage of working files
List[File] []
Detect reads originating from foreign organisms (e.g. bacterial DNA in a non-bacterial sample),and unmap + label those reads accordingly.
boolean false
Original SAM or BAM file of unmapped reads, which must be in queryname order.
R File null
How to deal with alignment information in reads that are being unmapped (e.g. due to cross-species contamination.) Currently ignored unless UNMAP_CONTAMINANT_READS = true
The --UNMAPPED_READ_STRATEGY argument is an enumerated type (UnmappingReadStrategy), which can have one of the following values:
UnmappingReadStrategy DO_NOT_CHANGE
Use the JDK Deflater instead of the Intel Deflater for writing compressed output
Boolean false
Use the JDK Inflater instead of the Intel Inflater for reading compressed input
Boolean false
Validation stringency for all SAM files read by this program. Setting stringency to SILENT can improve performance when processing a BAM file in which variable-length data (read, qualities, tags) do not otherwise need to be decoded.
The --VALIDATION_STRINGENCY argument is an enumerated type (ValidationStringency), which can have one of the following values:
ValidationStringency STRICT
Control verbosity of logging.
The --VERBOSITY argument is an enumerated type (LogLevel), which can have one of the following values:
LogLevel INFO
display the version number for this tool
boolean false
See also General Documentation | Tool Docs Index Tool Documentation Index | Support Forum
GATK version 4.0.11.0 built at 23-11-2018 02:11:49.