Changes

From Genome Analysis Wiki
Jump to navigationJump to search
3,456 bytes added ,  12:30, 6 January 2014
no edit summary
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.
--params   : print the parameter settings
+
Optional Parameters For Other Operations:
--noeof     : do not expect an EOF block on a bam file.
+
--lshift        : left shift indels when writing records
 +
--excludeFlags  : Skip any records with any of the specified flags set
 +
                  (specify an integer representation of the flags)
 +
--requiredFlags : Only process records with all of the specified flags set
 +
                  (specify an integer representation of the flags)
 +
--params       : print the parameter settings
 +
--noeof         : do not expect an EOF block on a bam file.
 
</pre>
 
</pre>
 +
{{PhoneHomeParamDesc}}
 +
 +
== Required Parameters ==
 +
{{InBAMInputFile}}
 +
{{OutBAMOutputFile}}
 +
 +
== Optional Region Specifying Parameters ==
 +
{{bamIndex}}
 +
=== 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 <code>--refName</code> followed by the reference name or </code>--refID</code> followed by the reference id.
 +
 +
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.
 +
 +
== Optional Parameters For Other Operations ==
 +
=== Left Shift Indels in the CIGAR (<code>--lshift</code>) ===
   −
= Usage =
+
Left shift indels as far as they can go in the read.
 +
 
 +
=== Skip Records with any of the Specified Flags (<code>--excludeFlags</code>) ===
 +
 
 +
Use <code>--excludeFlags</code> followed by the flags (as one integer) to skip any records that has any of the specified flags set.
 +
 
 +
This parameter was added in version 1.0.10.
 +
 
 +
=== Only Process Records with the all of the Specified Flags (<code>--requiredFlags</code>) ===
 +
 
 +
Use <code>--requiredFlags</code> followed by the flags (as one integer) to only process records with all of the specified flags set.
 +
 
 +
This parameter was added in version 1.0.10.
 +
 
 +
{{paramsParameter}}
 +
{{noeofBGZFParameter}}
 +
{{PhoneHomeParameters}}
   −
./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.

Navigation menu