Changes

From Genome Analysis Wiki
Jump to navigationJump to search
708 bytes added ,  12:43, 21 May 2010
no edit summary
Line 7: Line 7:  
* [[C++ Executable: bam#Read and Validate a SAM/BAM file|Read and Validate a SAM/BAM file]]
 
* [[C++ Executable: bam#Read and Validate a SAM/BAM file|Read and Validate a SAM/BAM file]]
 
* [[C++ Executable: bam#Read a SAM/BAM file and write as a SAM/BAM file|Read a SAM/BAM file and write as a SAM/BAM file]]
 
* [[C++ Executable: bam#Read a SAM/BAM file and write as a SAM/BAM file|Read a SAM/BAM file and write as a SAM/BAM file]]
 +
* [[C++ Executable: bam#Print SAM/BAM header]]
 
* [[C++ Executable: bam#Dump a BAM index file|Dump a BAM index file into an easy to read text version]]
 
* [[C++ Executable: bam#Dump a BAM index file|Dump a BAM index file into an easy to read text version]]
 
* [[C++ Executable: bam#Read & Write indexed BAM file|Read an indexed BAM file reference by reference id -1 to 22 and write it out as a SAM/BAM file]]
 
* [[C++ Executable: bam#Read & Write indexed BAM file|Read an indexed BAM file reference by reference id -1 to 22 and write it out as a SAM/BAM file]]
    
This executable is built using the [[C++ Library: bam|bam library]].
 
This executable is built using the [[C++ Library: bam|bam library]].
 +
 +
Just running ./bam will print the Usage information for the bam executable.
      Line 41: Line 44:     
  ./bam validate --in <inputFile> [--noeof] [--so_flag|--so_coord|--so_query] [--quitAfterErrorNum <numErrors>] [--maxReportedErrors <numReportedErrors>]
 
  ./bam validate --in <inputFile> [--noeof] [--so_flag|--so_coord|--so_query] [--quitAfterErrorNum <numErrors>] [--maxReportedErrors <numReportedErrors>]
      
=== Return Value ===
 
=== Return Value ===
 
*    0: all records are successfully read, are valid, and are properly sorted.
 
*    0: all records are successfully read, are valid, and are properly sorted.
 
* non-0: at least one record was not successfully read, not valid, or not properly sorted.
 
* non-0: at least one record was not successfully read, not valid, or not properly sorted.
      
=== Example Output ===
 
=== Example Output ===
Line 77: Line 78:  
=== Usage ===
 
=== Usage ===
 
  ./bam <inputFile> <outputFile.sam/bam/ubam (ubam is uncompressed bam)> [NOEOF]
 
  ./bam <inputFile> <outputFile.sam/bam/ubam (ubam is uncompressed bam)> [NOEOF]
      
=== Return Value ===
 
=== Return Value ===
 
Returns the SamStatus for the reads/writes.
 
Returns the SamStatus for the reads/writes.
      
=== Example Output ===
 
=== Example Output ===
Line 87: Line 86:  
Number of records read = 10
 
Number of records read = 10
 
Number of records written = 10
 
Number of records written = 10
 +
</pre>
 +
 +
 +
== Print SAM/BAM header==
 +
The <code>dump_header</code> option on the bam executable prints the header of the specified SAM/BAM file to cout. 
 +
 +
=== Parameters ===
 +
<pre>
 +
    Required Parameters:
 +
filename : the sam/bam filename whose header should be printed.
 +
</pre>
 +
 +
=== Usage ===
 +
 +
./bam dump_header <inputFile>
 +
 +
=== Return Value ===
 +
*    0: the header was successfully read and printed.
 +
* non-0: the header was not successfully read or was not printed.  (Returns the SamStatus.)
 +
 +
 +
=== Example Output ===
 +
<pre>
 +
@SQ SN:1 LN:247249719
 +
@SQ SN:2 LN:242951149
 +
@SQ SN:3 LN:199501827
 
</pre>
 
</pre>
  

Navigation menu