Line 1: |
Line 1: |
| + | [[Category:libStatGen]] |
| + | [[Category:libStatGen BAM]] |
| + | |
| + | == Review Sept 20th == |
| + | === Notes === |
| + | * returning const char* |
| + | * SamFileHeader change referenceContigs, etc to private from public |
| + | * Add way to copy a SAM record. |
| + | |
| == Review Sept 17th == | | == Review Sept 17th == |
| === Topics Discussed === | | === Topics Discussed === |
Line 5: |
Line 14: |
| | | |
| === NOTES From Meeting === | | === NOTES From Meeting === |
− | *InputFile should not use <code>long int</code>. Should instead use: <code>long long</code> | + | * General Notes: |
− | *Anytime have an error could call handleError which would have a switch to return the error, throw exception, or abort. Call it with an error code and a string. Maybe an error handler class where you could use everywhere. Each class would have a member of that class type that would contain that information. | + | **InputFile should not use <code>long int</code>. Should instead use: <code>long long</code> |
| + | * Error Handling Notes: |
| + | **Anytime have an error could call handleError which would have a switch to return the error, throw exception, or abort. Call it with an error code and a string. Maybe an error handler class where you could use everywhere. Each class would have a member of that class type that would contain that information. |
| + | *Returning values of Strings Notes: |
| + | ** Problems with returning const char* |
| + | *** If the pointer is stored when returned, it becomes invalid if the class modifies the underlying string. |
| + | ** Problems with passing in std::string& as a parameter to be set. |
| + | *** people typically want to operate on the return of the method. |
| + | ** One idea was returning a reference to a string |
| + | *** Does that solve the problem? Won't the contents change when a new one is read? Is that what we want? |
| | | |
− | ==== Useful Links ====
| + | |
| + | === Useful Links === |
| BAM Library FAQs: http://genome.sph.umich.edu/wiki/SAM/BAM_Library_FAQs | | BAM Library FAQs: http://genome.sph.umich.edu/wiki/SAM/BAM_Library_FAQs |
| | | |
− | Source Code: http://www.sph.umich.edu/csg/mktrost/doxygen/html/ | + | Source Code: http://csg.sph.umich.edu//mktrost/doxygen/html/ |
| | | |
− | Test code for setting values in the library: http://www.sph.umich.edu/csg/mktrost/doxygen/html/WriteFiles_8cpp-source.html | + | Test code for setting values in the library: http://csg.sph.umich.edu//mktrost/doxygen/html/WriteFiles_8cpp-source.html |
| | | |
| === Topics for Discussion === | | === Topics for Discussion === |
Line 90: |
Line 109: |
| return mySequence.c_str(); | | return mySequence.c_str(); |
| } | | } |
− | | + | const std::string& SamRecord::getSequence() |
− | | |
− | | |
− | const char* SamRecord::getSequence(std::string& sequence) | |
| { | | { |
| myStatus = SamStatus::SUCCESS; | | myStatus = SamStatus::SUCCESS; |
Line 100: |
Line 116: |
| // 0 Length, means that it is in the buffer, but has not yet | | // 0 Length, means that it is in the buffer, but has not yet |
| // been synced to the string, so do the sync. | | // been synced to the string, so do the sync. |
− | setSequenceAndQualityFromBuffer(); // Can fail. | + | setSequenceAndQualityFromBuffer(); |
| } | | } |
− | sequence = mySequence;
| + | return &mySequence; |
− | return mySequence.c_str(); | |
| } | | } |
| + | |
| </source> | | </source> |
| and passing in references to strings, like: | | and passing in references to strings, like: |
Line 142: |
Line 158: |
| </source> | | </source> |
| | | |
− | http://www.sph.umich.edu/csg/mktrost/doxygen/html/SamRecord_8h-source.html | + | http://csg.sph.umich.edu//mktrost/doxygen/html/SamRecord_8h-source.html |
| | | |
| ==== SamFileHeader ==== | | ==== SamFileHeader ==== |
Line 189: |
Line 205: |
| ** <S>include links from the main library page and the SamFile page.</s> | | ** <S>include links from the main library page and the SamFile page.</s> |
| ** <S>look into why the one example have two if checks on SamIn status</s> <span style="color:blue">- one was printing the result and one was setting the return value - cleaned up to be in one if statement.</span> | | ** <S>look into why the one example have two if checks on SamIn status</s> <span style="color:blue">- one was printing the result and one was setting the return value - cleaned up to be in one if statement.</span> |
− | * Create 1 library for all of our library code rather than having libcsg, libbam, libfqf separated. | + | * <S>Create 1 library for all of our library code rather than having libcsg, libbam, libfqf separated.</s> |
− | ** What should this library be called? | + | ** <S>What should this library be called?</s> <span style="color:blue">- Created library: libstatgen and reorganized into a new repository: statgen.</span> |
− | *** libdna | + | *** <S>libdna</s> |
− | *** libdna++ | + | *** <S>libdna++</s> |
− | *** libsequence++ | + | *** <S>libsequence++</s> |
− | *** libDNA | + | *** <S>libDNA</s> |
− | *** libgenotype | + | *** <S>libgenotype</s> |
| * Add an option by class that says whether or not to abort on failure. (or even an option on each method) | | * Add an option by class that says whether or not to abort on failure. (or even an option on each method) |
| ** This allows calling code to set that option and then not have to check for failures since the code it calls would abort on a failure. | | ** This allows calling code to set that option and then not have to check for failures since the code it calls would abort on a failure. |