00001 // Copyright 2010 Complete Genomics, Inc. 00002 // 00003 // Licensed under the Apache License, Version 2.0 (the "License"); you 00004 // may not use this file except in compliance with the License. You 00005 // may obtain a copy of the License at 00006 // 00007 // http://www.apache.org/licenses/LICENSE-2.0 00008 // 00009 // Unless required by applicable law or agreed to in writing, software 00010 // distributed under the License is distributed on an "AS IS" BASIS, 00011 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 00012 // implied. See the License for the specific language governing 00013 // permissions and limitations under the License. 00014 00015 #ifndef CGATOOLS_VARIANTS_CALL_HPP_ 00016 #define CGATOOLS_VARIANTS_CALL_HPP_ 1 00017 00019 00020 #include "cgatools/core.hpp" 00021 #include "cgatools/reference/CrrFile.hpp" 00022 #include "cgatools/util/DelimitedFile.hpp" 00023 #include <string> 00024 00025 namespace cgatools { namespace variants { 00026 00029 struct Call 00030 { 00031 public: 00033 static const uint16_t ALL_HAPLOTYPES; 00034 00036 static const uint16_t UNKNOWN_PLOIDY; 00037 00039 Call (); 00040 00043 std::string calledSequence(const reference::CrrFile& crr) const; 00044 00047 std::string refSequence(const reference::CrrFile& crr) const; 00048 00051 bool isRefConsistent(const reference::CrrFile& crr) const; 00052 00055 bool hasNoCalls() const; 00056 00059 void addFieldParsers(util::DelimitedFile& df, const reference::CrrFile& crr); 00060 00062 std::ostream& write(std::ostream& out, 00063 const reference::CrrFile& crr, 00064 const char sep = '\t') const; 00065 00067 static std::string getHeader (const char separator = '\t'); 00068 00070 uint32_t locus_; 00071 00074 uint16_t ploidy_; 00075 00078 uint16_t haplotype_; 00079 00081 reference::Range range_; 00082 00084 std::string varType_; 00085 00087 std::string reference_; 00088 00090 std::string alleleSeq_; 00091 00093 uint32_t totalScore_; 00094 00096 std::string hapLink_; 00097 00099 std::string xRef_; 00100 }; 00101 00104 void upgradeOldFieldValues(Call& c); 00105 00106 00107 } } // cgatools::variants 00108 00109 #endif // CGATOOLS_VARIANTS_CALL_HPP_