From Genome Analysis Wiki
Jump to navigationJump to search
34 bytes added
, 09:56, 6 April 2010
Line 174: |
Line 174: |
| ==== Usage Example ==== | | ==== Usage Example ==== |
| This example reads in the inputFilename bam file and writes it back out section by section to the specified outputFilename, starting with section -1. It also prints a count of the number of records in each section. | | This example reads in the inputFilename bam file and writes it back out section by section to the specified outputFilename, starting with section -1. It also prints a count of the number of records in each section. |
− | <pre> | + | <source lang="cpp"> |
| int ReadIndexedBam(const char* inputFilename, | | int ReadIndexedBam(const char* inputFilename, |
| const char* outputFilename, | | const char* outputFilename, |
Line 226: |
Line 226: |
| return(0); | | return(0); |
| } | | } |
− | </pre> | + | </source> |
| | | |
| | | |
Line 439: |
Line 439: |
| | | |
| Example of using getNextSamTag: | | Example of using getNextSamTag: |
− | <pre> | + | <source lang="cpp"> |
| // record is a previously setup SamRecord. | | // record is a previously setup SamRecord. |
| String recordString = ""; | | String recordString = ""; |
Line 474: |
Line 474: |
| | | |
| recordString += "\n"; | | recordString += "\n"; |
− | </pre> | + | </source> |
| | | |
| | | |
| == Suggested Improvements/Features == | | == Suggested Improvements/Features == |
| * Add optional user flag for checking if a file is sorted when it is read. It would report an error if it is unsorted. | | * Add optional user flag for checking if a file is sorted when it is read. It would report an error if it is unsorted. |