Line 1: |
Line 1: |
− | == RGMergeBAM : Merge multiple BAM files appending ReadGroup IDs== | + | = Overview of the <code>mergeBam</code> function of <code>bamUtil</code> = |
| + | The <code>mergeBam</code> option on the [[bamUtil]] executable merges multiple BAM files appending ReadGroup IDs if necessary. |
| | | |
− | rgMergeBam merges multiple sorted BAM files into one BAM file like 'samtools merge' command, but merges BAM headers. | + | As of version 1.0.7, this program was renamed from rgMergeBam to mergeBam. |
− | * Checks that the HD and SQ tags are identical across the BAM files
| |
− | * Adds @RG headers from a tabular input file containing the fields' info
| |
− | * Adds RG:Z:[RGID] tag for each record based on the source BAM file
| |
− | * Ensures that the headers are identical across the input files and that input/output BAM records are sorted
| |
| | | |
| + | mergeBam merges multiple sorted SAM/BAM files into one BAM file like 'samtools merge' command, but merges BAM headers. |
| + | * Checks that the non RG header fields are identical across the BAM files |
| + | * Checks that the input SAM/BAM records are sorted |
| + | * If --list option is used: |
| + | ** Ensures that the headers are identical across the input files |
| + | ** Adds @RG headers from a tabular input file containing the fields' info |
| + | ** Adds RG:Z:[RGID] tag for each record based on the source BAM file |
| + | * If --in is used: |
| + | ** Merges the RG headers from the files, checking that they RG IDs are unique or if they are the same that the rest of the fields are the same |
| | | |
− | === Usage===
| + | |
| + | = Usage= |
| <pre> | | <pre> |
− | rgMergeBam [-v] [--log logFile] --list listFile --out outFile
| + | mergeBam [-v] [--log logFile] [--ignorePI] --list <listFile> --out <outFile> |
| + | </pre> |
| | | |
| + | =Parameters= |
| + | <pre> |
| Required parameters : | | Required parameters : |
| --out/-o : Output BAM file (sorted) | | --out/-o : Output BAM file (sorted) |
| + | --in/-i : BAM file to be input, must be more than one of these options. |
| + | cannot be used with --list/-l |
| --list/-l : RGAList File. Tab-delimited list consisting of following columns (with headers): | | --list/-l : RGAList File. Tab-delimited list consisting of following columns (with headers): |
| BAM* : Input BAM file name to be merged | | BAM* : Input BAM file name to be merged |
Line 27: |
Line 39: |
| * (Required fields) | | * (Required fields) |
| Optional parameters : | | Optional parameters : |
| + | --ignorePI/-I : Ignore the RG PI field when comparing headers |
| --log/-L : Log file | | --log/-L : Log file |
| --verbose/-v : Turn on verbose mode | | --verbose/-v : Turn on verbose mode |
| </pre> | | </pre> |
| + | {{PhoneHomeParamDesc}} |
| + | |
| + | == Required Parameters== |
| + | |
| + | === Input Files (<code>--in</code>, <code>--list</code>) === |
| + | |
| + | Use multiple <code>--in</code> parameters each followed by an input file name to specify the SAM/BAM input files (more than one <code>--in</code> must be specified). |
| + | |
| + | Alternatively, a RGAList file can be specified using <code>--list</code>. The specified file contains a header row with a tab delimited list of the included columns followed by a row for each BAM file with a tab-delimited list of the values for each column. |
| + | |
| + | The possible header column name are (* indicates required fields): |
| + | * BAM* : Input BAM file name to be merged |
| + | * ID* : Unique read group identifier |
| + | * SM* : Sample name |
| + | * LB : Library name |
| + | * DS : Description |
| + | * PU : Platform unit |
| + | * PI : Predicted median insert size |
| + | * CN : Name of sequencing center producing the read |
| + | * DT : Date the rn was produced |
| + | * PL : Platform/technology used to produce the read |
| + | |
| + | |
| + | The program automatically determines if your input files are SAM/BAM/uncompressed BAM. |
| + | |
| + | {{OutBAMOutputFile}} |
| + | |
| + | == Optional Parameters == |
| + | === Specify Log Filename (<code>--ignorePI</code> or <code>-I</code>) === |
| + | Use <code>--ignorePI</code> to ignore the RG PI field when comparing headers. The field from the first header will be used in the output file. |
| + | |
| + | This parameter was added in version 1.0.10. |
| + | |
| + | === Specify Log Filename (<code>--log</code>) === |
| + | Use <code>--log</code> followed by the log filename to specify the log filename. Default is the output file basename with a <code>.log</code> extension |
| + | |
| + | === Verbose (<code>--verbose</code>) === |
| + | Use <code>--verbose</code> to turn on verbose mode. |
| + | |
| + | |
| + | {{PhoneHomeParameters}} |
| + | |
| + | |
| + | = Return Value = |
| + | Returns 0 on success, non-0 on failure. |
| + | |
| + | |
| + | [[Category:BamUtil|mergeBam]] |
| + | [[Category:BAM Software]] |
| + | [[Category:Software]] |