void getBamBlocks(const BamAlignment &bam, const RefVector &refs, 
                   BedVec &blocks, bool breakOnDeletionOps) {
 
 	CHRPOS currPosition = bam.Position;
     CHRPOS blockStart   = bam.Position;
     string chrom        = refs.at(bam.RefID).RefName;
     string name         = bam.Name;
     string strand       = "+";
     float  score        = bam.MapQuality;
     if (bam.IsReverseStrand()) strand = "-"; 
 	
 	vector<CigarOp>::const_iterator cigItr = bam.CigarData.begin();
 	vector<CigarOp>::const_iterator cigEnd = bam.CigarData.end();
     for ( ; cigItr != cigEnd; ++cigItr ) {
         if (cigItr->Type == 'M') {
             currPosition += cigItr->Length;
 			blocks.push_back( Bed(chrom, blockStart, currPosition, name, score, strand) );
 			blockStart    = currPosition;
         }
         else if (cigItr->Type == 'D') {
             if (breakOnDeletionOps == false)
                 currPosition += cigItr->Length;
             else {
                 currPosition += cigItr->Length;
                 blockStart    = currPosition;
             }
         }
         else if (cigItr->Type == 'N') {
             currPosition += cigItr->Length;
             blockStart    = currPosition;            }
         else if (cigItr->Type == 'S' || cigItr->Type == 'H' || cigItr->Type == 'P' || cigItr->Type == 'I') {
             // do nothing
         }
         else {
             cerr << "Input error: invalid CIGAR type (" << cigItr->Type
 				<< ") for: " << bam.Name << endl;
 			exit(1);
         }
 	}
 }
Exemple #2
0
    , m_bed(bed)
  {}
private:
  std::string m_building;
  std::string m_pointOfCare;
  int m_floor;
  int m_bed;
};

TEST_CASE("ctor of Location")
{
  const Location loc(
    Building("Central"),
    PointOfCare("Intensive Care"),
    Floor(3),
    Bed(12));
}

namespace My
{
template<class T1, class T2>
struct MaxSize
{
  static const int value = sizeof(T1) > sizeof(T2) ? sizeof(T1) : sizeof(T2);
};
}
typedef My::MaxSize<int, char> MaxIntChar;
typedef My::MaxSize<int, long long> MaxIntLongLong;

struct Max1
{
Exemple #3
0
Bedroom::Bed Bedroom::
        getBed()
{
    return Bed(data_);
}