From Genome Analysis Wiki
Jump to navigationJump to search
17 bytes added
, 09:49, 6 April 2010
Line 66: |
Line 66: |
| ==== Usage Example ==== | | ==== Usage Example ==== |
| The following example reads in a sam/bam file and writes it out as a sam/bam file. The file format of the input sam/bam is determined by the SamFile class based on reading the type from the file. The file format of the output sam/bam file is determined by the '''SamFile''' class based on the extension of the output file. A ".bam" extension indicates a BAM file. All other extensions indicate SAM files. | | The following example reads in a sam/bam file and writes it out as a sam/bam file. The file format of the input sam/bam is determined by the SamFile class based on reading the type from the file. The file format of the output sam/bam file is determined by the '''SamFile''' class based on the extension of the output file. A ".bam" extension indicates a BAM file. All other extensions indicate SAM files. |
− | <pre> | + | |
| + | <source lang="cpp"> |
| int main(int argc, char ** argv) | | int main(int argc, char ** argv) |
| { | | { |
Line 115: |
Line 116: |
| std::cout << "Number of valid records = " << numValidRecords << std::endl; | | std::cout << "Number of valid records = " << numValidRecords << std::endl; |
| } | | } |
− | </pre> | + | </source> |
− | | |
| | | |
| === Reading Indexed (and Sorted) BAM Files === | | === Reading Indexed (and Sorted) BAM Files === |