Line 10: |
Line 10: |
| ** overlapping or fully within if <code>--withinReg</code> is specified | | ** overlapping or fully within if <code>--withinReg</code> is specified |
| * have a specific read name (if specified) | | * have a specific read name (if specified) |
| + | |
| + | |
| + | = Usage = |
| + | |
| + | ./bam writeRegion --in <inputFilename> --out <outputFilename> [--bamIndex <bamIndexFile>] [--refName <reference Name> | --refID <reference ID>] [--start <0-based start pos>] [--end <0-based end psoition>] [--bed <bed filename>] [--withinRegion] [--readName <readName>] [--lshift] [--params] [--noeof] |
| | | |
| | | |
Line 17: |
Line 22: |
| --in : the BAM file to be read | | --in : the BAM file to be read |
| --out : the SAM/BAM file to write to | | --out : the SAM/BAM file to write to |
− | Optional Parameters: | + | Optional Parameters for Specifying a Region: |
| --bamIndex : the path/name of the bam index file | | --bamIndex : the path/name of the bam index file |
| (if not specified, uses the --in value + ".bai") | | (if not specified, uses the --in value + ".bai") |
Line 36: |
Line 41: |
| --withinReg : only print reads fully enclosed within the region. | | --withinReg : only print reads fully enclosed within the region. |
| --readName : only print reads with this read name. | | --readName : only print reads with this read name. |
| + | Optional Parameters For Other Operations: |
| + | --lshift : left shift indels when writing records |
| --params : print the parameter settings | | --params : print the parameter settings |
| --noeof : do not expect an EOF block on a bam file. | | --noeof : do not expect an EOF block on a bam file. |
| </pre> | | </pre> |
| | | |
− | = Usage = | + | {{InBAMInputFile}} |
| + | {{OutBAMOutputFile}} |
| + | {{bamIndex}} |
| + | |
| + | == Region Specifying Parameters == |
| + | === Read only a Specific Reference/Chromosome (<code>--refName</code> or <code>--refID</code>) === |
| + | If you only want to read a specific reference (chromosome), specify either the reference name following <code>--refName</code> or the reference id following </code>--refID</code>. |
| + | |
| + | If you want to read all references, don't specify either <code>--refName</code> or <code>--refID</code>. |
| + | |
| + | The reference Name is the name specified in the <code>RNAME</code> field of the records in the SAM file or in the <code>name</code> fields of the reference information section of the BAM file. |
| + | |
| + | The reference ID is the value specified in the <code>refID</code> field of the records in the BAM file. |
| + | |
| + | If you want to read only unmapped reads, use <code>--refID -1</code> |
| + | |
| + | === Read only a Specific Region of a Chromosome (<code>--start</code> and <code>--end</code>) === |
| + | |
| + | You can only specify a specific region if you also specify a specific reference/chromosome using <code>--refName</code> or <code>--refID</code>. |
| + | |
| + | Use <code>--start</code> to specify the inclusive 0-based start position of the region you want to read. Specify <code>--start -1</code> to specify start at the beginning of the specified chromosome. |
| + | |
| + | Use <code>--end</code> to specify the exclusive 0-based end position of the region you want to read. Specify <code>--end -1</code> to specify end of the specified chromosome. |
| + | |
| + | === Bed File with Regions to Write (<code>--bed</code>) === |
| + | |
| + | If <code>--bed</code> followed by a filename is specified the regions specified in the bed file will be written. |
| + | |
| + | It is assumed that the regions in the bed file are sorted. |
| + | |
| + | === Only Write Reads Fully within the Specified Region (<code>--withinReg</code>) === |
| + | |
| + | By default reads that overlap the specified region are written. If instead you only want to write reads that are fully within the specified regions, use the <code>--withinReg</code> option. |
| + | |
| + | === Only Print Reads with a Specified Read Name (code>--readName</code>) === |
| + | |
| + | If you only want to print reads with a specific read name, use the <code>--readName</code> option followed by the read name. |
| + | |
| + | |
| + | == Left Shift Indels in the CIGAR (<code>--lshift</code>) == |
| + | |
| + | Left shift indels as far as they can go in the read. |
| + | |
| + | {{noeofBGZFParameter}} |
| + | {{paramsParameter}} |
| + | |
| | | |
− | ./bam writeRegion --in <inputFilename> --out <outputFilename> [--bamIndex <bamIndexFile>] [--refName <reference Name> | --refID <reference ID>] [--start <0-based start pos>] [--end <0-based end psoition>] [--bed <bed filename>] [--withinRegion] [--readName <readName>] [--params] [--noeof]
| |
− |
| |
| = Return Value = | | = Return Value = |
| * 0: all records are successfully read and written. | | * 0: all records are successfully read and written. |