From Genome Analysis Wiki
Jump to navigationJump to search
1,777 bytes added
, 15:39, 30 June 2010
Line 193: |
Line 193: |
| Number of records = 10 | | Number of records = 10 |
| Returning: 0 (SUCCESS) | | Returning: 0 (SUCCESS) |
| + | </pre> |
| + | |
| + | |
| + | == writeRegion == |
| + | |
| + | The <code>writeRegion</code> option on the bam executable writes the alignments in the indexed BAM file that fall into the specified region (reference id and start/end position). |
| + | |
| + | === Parameters === |
| + | <pre> |
| + | Required Parameters: |
| + | --in : the BAM file to be read |
| + | --out : the SAM/BAM file to write to |
| + | Optional Parameters: |
| + | --noeof : do not expect an EOF block on a bam file. |
| + | --bamIndex : the path/name of the bam index file |
| + | (if not specified, uses the --in value + ".bai") |
| + | --refID : the BAM reference ID to read (defaults to -1: unmapped) |
| + | --start : the 0-based start position (defaults to -1) |
| + | --end : the 0-based end position (defaults to -1: meaning til the end of the reference) |
| + | </pre> |
| + | |
| + | === Usage === |
| + | |
| + | ./bam writeRegion --in <inputFilename> --out <outputFilename> [--bamIndex <bamIndexFile>] [--noeof] |
| + | |
| + | === Return Value === |
| + | * 0: all records are successfully read and written. |
| + | * non-0: at least one record was not successfully read or written. |
| + | |
| + | === Example Output === |
| + | <pre> |
| + | The following parameters are in effect: |
| + | |
| + | Input Parameters |
| + | --in [test/testFiles/sortedBam.bam], --out [t.sam], --bamIndex [], --refID, |
| + | --start [1], --end [100], --noeof |
| + | |
| + | Wrote t.sam with 2 records. |
| </pre> | | </pre> |
| | | |
Line 198: |
Line 236: |
| == dumpIndex == | | == dumpIndex == |
| The <code>dumpIndex</code> option on the bam executable prints BAM index file in an easy to read format. | | The <code>dumpIndex</code> option on the bam executable prints BAM index file in an easy to read format. |
| + | |
| + | === Parameters === |
| + | <pre> |
| + | Required Parameters: |
| + | bamIndexFile - path/name of the index file to display |
| + | Optional Parameters: |
| + | ref# - the reference number to print (optional) defaults to print all |
| + | </pre> |
| | | |
| === Usage === | | === Usage === |
− | ./bam dumpIndex <bamIndexFile> | + | ./bam dumpIndex <bamIndexFile> <ref#> |
| | | |
| === Return Value === | | === Return Value === |
Line 209: |
Line 255: |
| == readIndexedBam == | | == readIndexedBam == |
| The <code>readIndexedBam</code> option on the bam executable reads an indexed BAM file reference id by reference id -1 to 22 and writes it out as a SAM/BAM file. | | The <code>readIndexedBam</code> option on the bam executable reads an indexed BAM file reference id by reference id -1 to 22 and writes it out as a SAM/BAM file. |
| + | |
| + | === Parameters === |
| + | <pre> |
| + | Required Parameters: |
| + | inputFilename - path/name of the input BAM file |
| + | outputFile.sam/bam - path/name of the output file |
| + | bamIndexFile - path/name of the BAM index file |
| + | Optional Parameters: |
| + | ref# - the reference number to print (optional) defaults to print all |
| + | </pre> |
| | | |
| === Usage === | | === Usage === |