// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: Alignments.proto

#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "Alignments.pb.h"

#include <algorithm>

#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/port.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)

namespace goby {

namespace {

const ::google::protobuf::Descriptor* AlignmentCollection_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AlignmentCollection_reflection_ = NULL;
const ::google::protobuf::Descriptor* AlignmentEntry_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AlignmentEntry_reflection_ = NULL;
const ::google::protobuf::Descriptor* RelatedAlignmentEntry_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  RelatedAlignmentEntry_reflection_ = NULL;
const ::google::protobuf::Descriptor* SequenceVariation_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  SequenceVariation_reflection_ = NULL;
const ::google::protobuf::Descriptor* AlignmentHeader_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AlignmentHeader_reflection_ = NULL;
const ::google::protobuf::Descriptor* IdentifierMapping_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  IdentifierMapping_reflection_ = NULL;
const ::google::protobuf::Descriptor* IdentifierInfo_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  IdentifierInfo_reflection_ = NULL;
const ::google::protobuf::Descriptor* ReadOriginInfo_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  ReadOriginInfo_reflection_ = NULL;
const ::google::protobuf::Descriptor* AlignmentTooManyHits_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AlignmentTooManyHits_reflection_ = NULL;
const ::google::protobuf::Descriptor* AmbiguousLocation_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AmbiguousLocation_reflection_ = NULL;
const ::google::protobuf::Descriptor* AlignmentIndex_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
  AlignmentIndex_reflection_ = NULL;

}  // namespace


void protobuf_AssignDesc_Alignments_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AssignDesc_Alignments_2eproto() {
  protobuf_AddDesc_Alignments_2eproto();
  const ::google::protobuf::FileDescriptor* file =
    ::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
      "Alignments.proto");
  GOOGLE_CHECK(file != NULL);
  AlignmentCollection_descriptor_ = file->message_type(0);
  static const int AlignmentCollection_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentCollection, alignment_entries_),
  };
  AlignmentCollection_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      AlignmentCollection_descriptor_,
      AlignmentCollection::default_instance_,
      AlignmentCollection_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentCollection, _has_bits_[0]),
      -1,
      -1,
      sizeof(AlignmentCollection),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentCollection, _internal_metadata_),
      -1);
  AlignmentEntry_descriptor_ = file->message_type(1);
  static const int AlignmentEntry_offsets_[34] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, multiplicity_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, query_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, target_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, position_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, matching_reverse_strand_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, query_position_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, score_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, number_of_mismatches_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, number_of_indels_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, query_aligned_length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, target_aligned_length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, sequence_variations_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, query_length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, mapping_quality_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, pair_flags_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, pair_alignment_link_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, fragment_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, spliced_forward_alignment_link_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, spliced_backward_alignment_link_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, spliced_flags_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, insert_size_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, sample_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, query_index_occurrences_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, ambiguity_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, bam_attributes_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, read_quality_scores_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, read_origin_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, softclippedbasesleft_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, softclippedbasesright_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, softclippedqualityleft_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, softclippedqualityright_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, placedunmappedsequence_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, placedunmappedquality_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, readname_),
  };
  AlignmentEntry_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      AlignmentEntry_descriptor_,
      AlignmentEntry::default_instance_,
      AlignmentEntry_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, _has_bits_[0]),
      -1,
      -1,
      sizeof(AlignmentEntry),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentEntry, _internal_metadata_),
      -1);
  RelatedAlignmentEntry_descriptor_ = file->message_type(2);
  static const int RelatedAlignmentEntry_offsets_[4] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RelatedAlignmentEntry, target_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RelatedAlignmentEntry, position_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RelatedAlignmentEntry, fragment_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RelatedAlignmentEntry, optimized_index_),
  };
  RelatedAlignmentEntry_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      RelatedAlignmentEntry_descriptor_,
      RelatedAlignmentEntry::default_instance_,
      RelatedAlignmentEntry_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RelatedAlignmentEntry, _has_bits_[0]),
      -1,
      -1,
      sizeof(RelatedAlignmentEntry),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(RelatedAlignmentEntry, _internal_metadata_),
      -1);
  SequenceVariation_descriptor_ = file->message_type(3);
  static const int SequenceVariation_offsets_[5] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SequenceVariation, from_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SequenceVariation, to_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SequenceVariation, position_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SequenceVariation, read_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SequenceVariation, to_quality_),
  };
  SequenceVariation_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      SequenceVariation_descriptor_,
      SequenceVariation::default_instance_,
      SequenceVariation_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SequenceVariation, _has_bits_[0]),
      -1,
      -1,
      sizeof(SequenceVariation),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(SequenceVariation, _internal_metadata_),
      -1);
  AlignmentHeader_descriptor_ = file->message_type(4);
  static const int AlignmentHeader_offsets_[22] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, smallest_split_query_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, largest_split_query_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, query_name_mapping_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, target_name_mapping_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, number_of_queries_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, number_of_targets_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, number_of_aligned_reads_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, query_length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, constant_query_length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, target_length_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, sorted_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, indexed_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, query_lengths_stored_in_entries_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, aligner_name_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, aligner_version_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, version_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, sample_basename_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, query_indices_were_permuted_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, query_index_occurrences_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, ambiguity_stored_in_entries_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, all_read_quality_scores_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, read_origin_),
  };
  AlignmentHeader_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      AlignmentHeader_descriptor_,
      AlignmentHeader::default_instance_,
      AlignmentHeader_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, _has_bits_[0]),
      -1,
      -1,
      sizeof(AlignmentHeader),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentHeader, _internal_metadata_),
      -1);
  IdentifierMapping_descriptor_ = file->message_type(5);
  static const int IdentifierMapping_offsets_[1] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(IdentifierMapping, mappings_),
  };
  IdentifierMapping_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      IdentifierMapping_descriptor_,
      IdentifierMapping::default_instance_,
      IdentifierMapping_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(IdentifierMapping, _has_bits_[0]),
      -1,
      -1,
      sizeof(IdentifierMapping),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(IdentifierMapping, _internal_metadata_),
      -1);
  IdentifierInfo_descriptor_ = file->message_type(6);
  static const int IdentifierInfo_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(IdentifierInfo, name_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(IdentifierInfo, index_),
  };
  IdentifierInfo_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      IdentifierInfo_descriptor_,
      IdentifierInfo::default_instance_,
      IdentifierInfo_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(IdentifierInfo, _has_bits_[0]),
      -1,
      -1,
      sizeof(IdentifierInfo),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(IdentifierInfo, _internal_metadata_),
      -1);
  ReadOriginInfo_descriptor_ = file->message_type(7);
  static const int ReadOriginInfo_offsets_[7] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, origin_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, origin_id_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, sample_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, platform_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, library_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, platform_unit_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, run_date_),
  };
  ReadOriginInfo_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      ReadOriginInfo_descriptor_,
      ReadOriginInfo::default_instance_,
      ReadOriginInfo_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, _has_bits_[0]),
      -1,
      -1,
      sizeof(ReadOriginInfo),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(ReadOriginInfo, _internal_metadata_),
      -1);
  AlignmentTooManyHits_descriptor_ = file->message_type(8);
  static const int AlignmentTooManyHits_offsets_[2] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentTooManyHits, aligner_threshold_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentTooManyHits, hits_),
  };
  AlignmentTooManyHits_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      AlignmentTooManyHits_descriptor_,
      AlignmentTooManyHits::default_instance_,
      AlignmentTooManyHits_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentTooManyHits, _has_bits_[0]),
      -1,
      -1,
      sizeof(AlignmentTooManyHits),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentTooManyHits, _internal_metadata_),
      -1);
  AmbiguousLocation_descriptor_ = file->message_type(9);
  static const int AmbiguousLocation_offsets_[3] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AmbiguousLocation, query_index_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AmbiguousLocation, at_least_number_of_hits_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AmbiguousLocation, length_of_match_),
  };
  AmbiguousLocation_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      AmbiguousLocation_descriptor_,
      AmbiguousLocation::default_instance_,
      AmbiguousLocation_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AmbiguousLocation, _has_bits_[0]),
      -1,
      -1,
      sizeof(AmbiguousLocation),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AmbiguousLocation, _internal_metadata_),
      -1);
  AlignmentIndex_descriptor_ = file->message_type(10);
  static const int AlignmentIndex_offsets_[3] = {
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentIndex, target_position_offsets_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentIndex, offsets_),
    GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentIndex, absolute_positions_),
  };
  AlignmentIndex_reflection_ =
    ::google::protobuf::internal::GeneratedMessageReflection::NewGeneratedMessageReflection(
      AlignmentIndex_descriptor_,
      AlignmentIndex::default_instance_,
      AlignmentIndex_offsets_,
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentIndex, _has_bits_[0]),
      -1,
      -1,
      sizeof(AlignmentIndex),
      GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(AlignmentIndex, _internal_metadata_),
      -1);
}

namespace {

GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
  ::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
                 &protobuf_AssignDesc_Alignments_2eproto);
}

void protobuf_RegisterTypes(const ::std::string&) GOOGLE_ATTRIBUTE_COLD;
void protobuf_RegisterTypes(const ::std::string&) {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      AlignmentCollection_descriptor_, &AlignmentCollection::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      AlignmentEntry_descriptor_, &AlignmentEntry::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      RelatedAlignmentEntry_descriptor_, &RelatedAlignmentEntry::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      SequenceVariation_descriptor_, &SequenceVariation::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      AlignmentHeader_descriptor_, &AlignmentHeader::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      IdentifierMapping_descriptor_, &IdentifierMapping::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      IdentifierInfo_descriptor_, &IdentifierInfo::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      ReadOriginInfo_descriptor_, &ReadOriginInfo::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      AlignmentTooManyHits_descriptor_, &AlignmentTooManyHits::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      AmbiguousLocation_descriptor_, &AmbiguousLocation::default_instance());
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
      AlignmentIndex_descriptor_, &AlignmentIndex::default_instance());
}

}  // namespace

void protobuf_ShutdownFile_Alignments_2eproto() {
  delete AlignmentCollection::default_instance_;
  delete AlignmentCollection_reflection_;
  delete AlignmentEntry::default_instance_;
  delete AlignmentEntry_reflection_;
  delete RelatedAlignmentEntry::default_instance_;
  delete RelatedAlignmentEntry_reflection_;
  delete SequenceVariation::default_instance_;
  delete SequenceVariation_reflection_;
  delete AlignmentHeader::default_instance_;
  delete AlignmentHeader_reflection_;
  delete IdentifierMapping::default_instance_;
  delete IdentifierMapping_reflection_;
  delete IdentifierInfo::default_instance_;
  delete IdentifierInfo_reflection_;
  delete ReadOriginInfo::default_instance_;
  delete ReadOriginInfo_reflection_;
  delete AlignmentTooManyHits::default_instance_;
  delete AlignmentTooManyHits_reflection_;
  delete AmbiguousLocation::default_instance_;
  delete AmbiguousLocation_reflection_;
  delete AlignmentIndex::default_instance_;
  delete AlignmentIndex_reflection_;
}

void protobuf_AddDesc_Alignments_2eproto() GOOGLE_ATTRIBUTE_COLD;
void protobuf_AddDesc_Alignments_2eproto() {
  static bool already_here = false;
  if (already_here) return;
  already_here = true;
  GOOGLE_PROTOBUF_VERIFY_VERSION;

  ::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
    "\n\020Alignments.proto\022\004goby\"F\n\023AlignmentCol"
    "lection\022/\n\021alignment_entries\030\001 \003(\0132\024.gob"
    "y.AlignmentEntry\"\213\010\n\016AlignmentEntry\022\024\n\014m"
    "ultiplicity\030\007 \001(\r\022\023\n\013query_index\030\001 \001(\r\022\024"
    "\n\014target_index\030\002 \001(\r\022\020\n\010position\030\003 \001(\r\022\037"
    "\n\027matching_reverse_strand\030\006 \001(\010\022\026\n\016query"
    "_position\030\005 \001(\r\022\r\n\005score\030\004 \001(\002\022\034\n\024number"
    "_of_mismatches\030\010 \001(\r\022\030\n\020number_of_indels"
    "\030\t \001(\r\022\034\n\024query_aligned_length\030\013 \001(\r\022\035\n\025"
    "target_aligned_length\030\014 \001(\r\0224\n\023sequence_"
    "variations\030\r \003(\0132\027.goby.SequenceVariatio"
    "n\022\024\n\014query_length\030\n \001(\r\022\027\n\017mapping_quali"
    "ty\030\016 \001(\005\022\022\n\npair_flags\030\017 \001(\r\0228\n\023pair_ali"
    "gnment_link\030\020 \001(\0132\033.goby.RelatedAlignmen"
    "tEntry\022\026\n\016fragment_index\030\021 \001(\r\022C\n\036splice"
    "d_forward_alignment_link\030\022 \001(\0132\033.goby.Re"
    "latedAlignmentEntry\022D\n\037spliced_backward_"
    "alignment_link\030\026 \001(\0132\033.goby.RelatedAlign"
    "mentEntry\022\025\n\rspliced_flags\030\023 \001(\r\022\023\n\013inse"
    "rt_size\030\024 \001(\021\022\024\n\014sample_index\030\025 \001(\r\022\037\n\027q"
    "uery_index_occurrences\030\031 \001(\r\022\021\n\tambiguit"
    "y\030\033 \001(\r\022\026\n\016bam_attributes\0302 \003(\t\022\033\n\023read_"
    "quality_scores\0307 \001(\014\022\031\n\021read_origin_inde"
    "x\030\032 \001(\r\022\034\n\024softClippedBasesLeft\030\036 \001(\t\022\035\n"
    "\025softClippedBasesRight\030\037 \001(\t\022\036\n\026softClip"
    "pedQualityLeft\030  \001(\014\022\037\n\027softClippedQuali"
    "tyRight\030! \001(\014\022\036\n\026placedUnmappedSequence\030"
    "( \001(\t\022\035\n\025placedUnmappedQuality\030) \001(\014\022\020\n\010"
    "readName\030* \001(\t\"p\n\025RelatedAlignmentEntry\022"
    "\024\n\014target_index\030\001 \001(\r\022\020\n\010position\030\002 \001(\r\022"
    "\026\n\016fragment_index\030\003 \001(\r\022\027\n\017optimized_ind"
    "ex\0302 \001(\r\"g\n\021SequenceVariation\022\014\n\004from\030\002 "
    "\001(\t\022\n\n\002to\030\001 \001(\t\022\020\n\010position\030\003 \001(\r\022\022\n\nrea"
    "d_index\030\005 \001(\r\022\022\n\nto_quality\030\004 \001(\014\"\304\005\n\017Al"
    "ignmentHeader\022\"\n\032smallest_split_query_in"
    "dex\030\t \001(\r\022!\n\031largest_split_query_index\030\013"
    " \001(\r\0223\n\022query_name_mapping\030\001 \001(\0132\027.goby."
    "IdentifierMapping\0224\n\023target_name_mapping"
    "\030\002 \001(\0132\027.goby.IdentifierMapping\022\031\n\021numbe"
    "r_of_queries\030\005 \001(\r\022\031\n\021number_of_targets\030"
    "\006 \001(\r\022\037\n\027number_of_aligned_reads\030\007 \001(\r\022\030"
    "\n\014query_length\030\003 \003(\rB\002\030\001\022\035\n\025constant_que"
    "ry_length\030\n \001(\r\022\025\n\rtarget_length\030\010 \003(\r\022\016"
    "\n\006sorted\030\r \001(\010\022\017\n\007indexed\030\016 \001(\010\022\'\n\037query"
    "_lengths_stored_in_entries\030\017 \001(\010\022\024\n\014alig"
    "ner_name\030\021 \001(\t\022\027\n\017aligner_version\030\022 \001(\t\022"
    "\017\n\007version\030\031 \001(\t\022\027\n\017sample_basename\030\036 \003("
    "\t\022#\n\033query_indices_were_permuted\030\032 \001(\010\022\037"
    "\n\027query_index_occurrences\030# \001(\010\022#\n\033ambig"
    "uity_stored_in_entries\030$ \001(\010\022\037\n\027all_read"
    "_quality_scores\030( \001(\010\022)\n\013read_origin\030\033 \003"
    "(\0132\024.goby.ReadOriginInfo\";\n\021IdentifierMa"
    "pping\022&\n\010mappings\030\001 \003(\0132\024.goby.Identifie"
    "rInfo\"-\n\016IdentifierInfo\022\014\n\004name\030\001 \002(\t\022\r\n"
    "\005index\030\002 \002(\r\"\225\001\n\016ReadOriginInfo\022\024\n\014origi"
    "n_index\030\001 \002(\r\022\021\n\torigin_id\030\002 \002(\t\022\016\n\006samp"
    "le\030\004 \001(\t\022\020\n\010platform\030\005 \001(\t\022\017\n\007library\030\010 "
    "\001(\t\022\025\n\rplatform_unit\030\014 \001(\t\022\020\n\010run_date\030\006"
    " \001(\t\"X\n\024AlignmentTooManyHits\022\031\n\021aligner_"
    "threshold\030\002 \002(\r\022%\n\004hits\030\001 \003(\0132\027.goby.Amb"
    "iguousLocation\"b\n\021AmbiguousLocation\022\023\n\013q"
    "uery_index\030\001 \002(\r\022\037\n\027at_least_number_of_h"
    "its\030\002 \002(\r\022\027\n\017length_of_match\030\003 \001(\r\"j\n\016Al"
    "ignmentIndex\022#\n\027target_position_offsets\030"
    "\001 \003(\rB\002\020\001\022\023\n\007offsets\030\002 \003(\004B\002\020\001\022\036\n\022absolu"
    "te_positions\030\003 \003(\004B\002\020\001B\'\n#edu.cornell.me"
    "d.icb.goby.alignmentsH\001", 2663);
  ::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
    "Alignments.proto", &protobuf_RegisterTypes);
  AlignmentCollection::default_instance_ = new AlignmentCollection();
  AlignmentEntry::default_instance_ = new AlignmentEntry();
  RelatedAlignmentEntry::default_instance_ = new RelatedAlignmentEntry();
  SequenceVariation::default_instance_ = new SequenceVariation();
  AlignmentHeader::default_instance_ = new AlignmentHeader();
  IdentifierMapping::default_instance_ = new IdentifierMapping();
  IdentifierInfo::default_instance_ = new IdentifierInfo();
  ReadOriginInfo::default_instance_ = new ReadOriginInfo();
  AlignmentTooManyHits::default_instance_ = new AlignmentTooManyHits();
  AmbiguousLocation::default_instance_ = new AmbiguousLocation();
  AlignmentIndex::default_instance_ = new AlignmentIndex();
  AlignmentCollection::default_instance_->InitAsDefaultInstance();
  AlignmentEntry::default_instance_->InitAsDefaultInstance();
  RelatedAlignmentEntry::default_instance_->InitAsDefaultInstance();
  SequenceVariation::default_instance_->InitAsDefaultInstance();
  AlignmentHeader::default_instance_->InitAsDefaultInstance();
  IdentifierMapping::default_instance_->InitAsDefaultInstance();
  IdentifierInfo::default_instance_->InitAsDefaultInstance();
  ReadOriginInfo::default_instance_->InitAsDefaultInstance();
  AlignmentTooManyHits::default_instance_->InitAsDefaultInstance();
  AmbiguousLocation::default_instance_->InitAsDefaultInstance();
  AlignmentIndex::default_instance_->InitAsDefaultInstance();
  ::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_Alignments_2eproto);
}

// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_Alignments_2eproto {
  StaticDescriptorInitializer_Alignments_2eproto() {
    protobuf_AddDesc_Alignments_2eproto();
  }
} static_descriptor_initializer_Alignments_2eproto_;

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int AlignmentCollection::kAlignmentEntriesFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

AlignmentCollection::AlignmentCollection()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.AlignmentCollection)
}

void AlignmentCollection::InitAsDefaultInstance() {
}

AlignmentCollection::AlignmentCollection(const AlignmentCollection& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.AlignmentCollection)
}

void AlignmentCollection::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AlignmentCollection::~AlignmentCollection() {
  // @@protoc_insertion_point(destructor:goby.AlignmentCollection)
  SharedDtor();
}

void AlignmentCollection::SharedDtor() {
  if (this != default_instance_) {
  }
}

void AlignmentCollection::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AlignmentCollection::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AlignmentCollection_descriptor_;
}

const AlignmentCollection& AlignmentCollection::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

AlignmentCollection* AlignmentCollection::default_instance_ = NULL;

AlignmentCollection* AlignmentCollection::New(::google::protobuf::Arena* arena) const {
  AlignmentCollection* n = new AlignmentCollection;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void AlignmentCollection::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.AlignmentCollection)
  alignment_entries_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool AlignmentCollection::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.AlignmentCollection)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated .goby.AlignmentEntry alignment_entries = 1;
      case 1: {
        if (tag == 10) {
          DO_(input->IncrementRecursionDepth());
         parse_loop_alignment_entries:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_alignment_entries()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(10)) goto parse_loop_alignment_entries;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.AlignmentCollection)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.AlignmentCollection)
  return false;
#undef DO_
}

void AlignmentCollection::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.AlignmentCollection)
  // repeated .goby.AlignmentEntry alignment_entries = 1;
  for (unsigned int i = 0, n = this->alignment_entries_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->alignment_entries(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.AlignmentCollection)
}

::google::protobuf::uint8* AlignmentCollection::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.AlignmentCollection)
  // repeated .goby.AlignmentEntry alignment_entries = 1;
  for (unsigned int i = 0, n = this->alignment_entries_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        1, this->alignment_entries(i), false, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.AlignmentCollection)
  return target;
}

int AlignmentCollection::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.AlignmentCollection)
  int total_size = 0;

  // repeated .goby.AlignmentEntry alignment_entries = 1;
  total_size += 1 * this->alignment_entries_size();
  for (int i = 0; i < this->alignment_entries_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->alignment_entries(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AlignmentCollection::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.AlignmentCollection)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const AlignmentCollection* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const AlignmentCollection>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.AlignmentCollection)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.AlignmentCollection)
    MergeFrom(*source);
  }
}

void AlignmentCollection::MergeFrom(const AlignmentCollection& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.AlignmentCollection)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  alignment_entries_.MergeFrom(from.alignment_entries_);
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void AlignmentCollection::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.AlignmentCollection)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AlignmentCollection::CopyFrom(const AlignmentCollection& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.AlignmentCollection)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AlignmentCollection::IsInitialized() const {

  return true;
}

void AlignmentCollection::Swap(AlignmentCollection* other) {
  if (other == this) return;
  InternalSwap(other);
}
void AlignmentCollection::InternalSwap(AlignmentCollection* other) {
  alignment_entries_.UnsafeArenaSwap(&other->alignment_entries_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata AlignmentCollection::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AlignmentCollection_descriptor_;
  metadata.reflection = AlignmentCollection_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// AlignmentCollection

// repeated .goby.AlignmentEntry alignment_entries = 1;
int AlignmentCollection::alignment_entries_size() const {
  return alignment_entries_.size();
}
void AlignmentCollection::clear_alignment_entries() {
  alignment_entries_.Clear();
}
const ::goby::AlignmentEntry& AlignmentCollection::alignment_entries(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentCollection.alignment_entries)
  return alignment_entries_.Get(index);
}
::goby::AlignmentEntry* AlignmentCollection::mutable_alignment_entries(int index) {
  // @@protoc_insertion_point(field_mutable:goby.AlignmentCollection.alignment_entries)
  return alignment_entries_.Mutable(index);
}
::goby::AlignmentEntry* AlignmentCollection::add_alignment_entries() {
  // @@protoc_insertion_point(field_add:goby.AlignmentCollection.alignment_entries)
  return alignment_entries_.Add();
}
::google::protobuf::RepeatedPtrField< ::goby::AlignmentEntry >*
AlignmentCollection::mutable_alignment_entries() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentCollection.alignment_entries)
  return &alignment_entries_;
}
const ::google::protobuf::RepeatedPtrField< ::goby::AlignmentEntry >&
AlignmentCollection::alignment_entries() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentCollection.alignment_entries)
  return alignment_entries_;
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int AlignmentEntry::kMultiplicityFieldNumber;
const int AlignmentEntry::kQueryIndexFieldNumber;
const int AlignmentEntry::kTargetIndexFieldNumber;
const int AlignmentEntry::kPositionFieldNumber;
const int AlignmentEntry::kMatchingReverseStrandFieldNumber;
const int AlignmentEntry::kQueryPositionFieldNumber;
const int AlignmentEntry::kScoreFieldNumber;
const int AlignmentEntry::kNumberOfMismatchesFieldNumber;
const int AlignmentEntry::kNumberOfIndelsFieldNumber;
const int AlignmentEntry::kQueryAlignedLengthFieldNumber;
const int AlignmentEntry::kTargetAlignedLengthFieldNumber;
const int AlignmentEntry::kSequenceVariationsFieldNumber;
const int AlignmentEntry::kQueryLengthFieldNumber;
const int AlignmentEntry::kMappingQualityFieldNumber;
const int AlignmentEntry::kPairFlagsFieldNumber;
const int AlignmentEntry::kPairAlignmentLinkFieldNumber;
const int AlignmentEntry::kFragmentIndexFieldNumber;
const int AlignmentEntry::kSplicedForwardAlignmentLinkFieldNumber;
const int AlignmentEntry::kSplicedBackwardAlignmentLinkFieldNumber;
const int AlignmentEntry::kSplicedFlagsFieldNumber;
const int AlignmentEntry::kInsertSizeFieldNumber;
const int AlignmentEntry::kSampleIndexFieldNumber;
const int AlignmentEntry::kQueryIndexOccurrencesFieldNumber;
const int AlignmentEntry::kAmbiguityFieldNumber;
const int AlignmentEntry::kBamAttributesFieldNumber;
const int AlignmentEntry::kReadQualityScoresFieldNumber;
const int AlignmentEntry::kReadOriginIndexFieldNumber;
const int AlignmentEntry::kSoftClippedBasesLeftFieldNumber;
const int AlignmentEntry::kSoftClippedBasesRightFieldNumber;
const int AlignmentEntry::kSoftClippedQualityLeftFieldNumber;
const int AlignmentEntry::kSoftClippedQualityRightFieldNumber;
const int AlignmentEntry::kPlacedUnmappedSequenceFieldNumber;
const int AlignmentEntry::kPlacedUnmappedQualityFieldNumber;
const int AlignmentEntry::kReadNameFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

AlignmentEntry::AlignmentEntry()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.AlignmentEntry)
}

void AlignmentEntry::InitAsDefaultInstance() {
  pair_alignment_link_ = const_cast< ::goby::RelatedAlignmentEntry*>(&::goby::RelatedAlignmentEntry::default_instance());
  spliced_forward_alignment_link_ = const_cast< ::goby::RelatedAlignmentEntry*>(&::goby::RelatedAlignmentEntry::default_instance());
  spliced_backward_alignment_link_ = const_cast< ::goby::RelatedAlignmentEntry*>(&::goby::RelatedAlignmentEntry::default_instance());
}

AlignmentEntry::AlignmentEntry(const AlignmentEntry& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.AlignmentEntry)
}

void AlignmentEntry::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  multiplicity_ = 0u;
  query_index_ = 0u;
  target_index_ = 0u;
  position_ = 0u;
  matching_reverse_strand_ = false;
  query_position_ = 0u;
  score_ = 0;
  number_of_mismatches_ = 0u;
  number_of_indels_ = 0u;
  query_aligned_length_ = 0u;
  target_aligned_length_ = 0u;
  query_length_ = 0u;
  mapping_quality_ = 0;
  pair_flags_ = 0u;
  pair_alignment_link_ = NULL;
  fragment_index_ = 0u;
  spliced_forward_alignment_link_ = NULL;
  spliced_backward_alignment_link_ = NULL;
  spliced_flags_ = 0u;
  insert_size_ = 0;
  sample_index_ = 0u;
  query_index_occurrences_ = 0u;
  ambiguity_ = 0u;
  read_quality_scores_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  read_origin_index_ = 0u;
  softclippedbasesleft_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  softclippedbasesright_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  softclippedqualityleft_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  softclippedqualityright_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  placedunmappedsequence_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  placedunmappedquality_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  readname_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AlignmentEntry::~AlignmentEntry() {
  // @@protoc_insertion_point(destructor:goby.AlignmentEntry)
  SharedDtor();
}

void AlignmentEntry::SharedDtor() {
  read_quality_scores_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  softclippedbasesleft_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  softclippedbasesright_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  softclippedqualityleft_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  softclippedqualityright_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  placedunmappedsequence_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  placedunmappedquality_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  readname_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
    delete pair_alignment_link_;
    delete spliced_forward_alignment_link_;
    delete spliced_backward_alignment_link_;
  }
}

void AlignmentEntry::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AlignmentEntry::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AlignmentEntry_descriptor_;
}

const AlignmentEntry& AlignmentEntry::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

AlignmentEntry* AlignmentEntry::default_instance_ = NULL;

AlignmentEntry* AlignmentEntry::New(::google::protobuf::Arena* arena) const {
  AlignmentEntry* n = new AlignmentEntry;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void AlignmentEntry::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.AlignmentEntry)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(AlignmentEntry, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<AlignmentEntry*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  if (_has_bits_[0 / 32] & 255u) {
    ZR_(multiplicity_, number_of_mismatches_);
  }
  if (_has_bits_[8 / 32] & 63232u) {
    ZR_(number_of_indels_, query_aligned_length_);
    ZR_(target_aligned_length_, pair_flags_);
    if (has_pair_alignment_link()) {
      if (pair_alignment_link_ != NULL) pair_alignment_link_->::goby::RelatedAlignmentEntry::Clear();
    }
  }
  if (_has_bits_[16 / 32] & 16711680u) {
    ZR_(fragment_index_, spliced_flags_);
    ZR_(insert_size_, ambiguity_);
    if (has_spliced_forward_alignment_link()) {
      if (spliced_forward_alignment_link_ != NULL) spliced_forward_alignment_link_->::goby::RelatedAlignmentEntry::Clear();
    }
    if (has_spliced_backward_alignment_link()) {
      if (spliced_backward_alignment_link_ != NULL) spliced_backward_alignment_link_->::goby::RelatedAlignmentEntry::Clear();
    }
  }
  if (_has_bits_[24 / 32] & 4261412864u) {
    if (has_read_quality_scores()) {
      read_quality_scores_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    read_origin_index_ = 0u;
    if (has_softclippedbasesleft()) {
      softclippedbasesleft_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_softclippedbasesright()) {
      softclippedbasesright_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_softclippedqualityleft()) {
      softclippedqualityleft_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_softclippedqualityright()) {
      softclippedqualityright_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_placedunmappedsequence()) {
      placedunmappedsequence_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  if (_has_bits_[32 / 32] & 3u) {
    if (has_placedunmappedquality()) {
      placedunmappedquality_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_readname()) {
      readname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }

#undef ZR_HELPER_
#undef ZR_

  sequence_variations_.Clear();
  bam_attributes_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool AlignmentEntry::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.AlignmentEntry)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional uint32 query_index = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &query_index_)));
          set_has_query_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(16)) goto parse_target_index;
        break;
      }

      // optional uint32 target_index = 2;
      case 2: {
        if (tag == 16) {
         parse_target_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &target_index_)));
          set_has_target_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_position;
        break;
      }

      // optional uint32 position = 3;
      case 3: {
        if (tag == 24) {
         parse_position:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &position_)));
          set_has_position();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(37)) goto parse_score;
        break;
      }

      // optional float score = 4;
      case 4: {
        if (tag == 37) {
         parse_score:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   float, ::google::protobuf::internal::WireFormatLite::TYPE_FLOAT>(
                 input, &score_)));
          set_has_score();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(40)) goto parse_query_position;
        break;
      }

      // optional uint32 query_position = 5;
      case 5: {
        if (tag == 40) {
         parse_query_position:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &query_position_)));
          set_has_query_position();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(48)) goto parse_matching_reverse_strand;
        break;
      }

      // optional bool matching_reverse_strand = 6;
      case 6: {
        if (tag == 48) {
         parse_matching_reverse_strand:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &matching_reverse_strand_)));
          set_has_matching_reverse_strand();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(56)) goto parse_multiplicity;
        break;
      }

      // optional uint32 multiplicity = 7;
      case 7: {
        if (tag == 56) {
         parse_multiplicity:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &multiplicity_)));
          set_has_multiplicity();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(64)) goto parse_number_of_mismatches;
        break;
      }

      // optional uint32 number_of_mismatches = 8;
      case 8: {
        if (tag == 64) {
         parse_number_of_mismatches:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &number_of_mismatches_)));
          set_has_number_of_mismatches();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(72)) goto parse_number_of_indels;
        break;
      }

      // optional uint32 number_of_indels = 9;
      case 9: {
        if (tag == 72) {
         parse_number_of_indels:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &number_of_indels_)));
          set_has_number_of_indels();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(80)) goto parse_query_length;
        break;
      }

      // optional uint32 query_length = 10;
      case 10: {
        if (tag == 80) {
         parse_query_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &query_length_)));
          set_has_query_length();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(88)) goto parse_query_aligned_length;
        break;
      }

      // optional uint32 query_aligned_length = 11;
      case 11: {
        if (tag == 88) {
         parse_query_aligned_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &query_aligned_length_)));
          set_has_query_aligned_length();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(96)) goto parse_target_aligned_length;
        break;
      }

      // optional uint32 target_aligned_length = 12;
      case 12: {
        if (tag == 96) {
         parse_target_aligned_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &target_aligned_length_)));
          set_has_target_aligned_length();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(106)) goto parse_sequence_variations;
        break;
      }

      // repeated .goby.SequenceVariation sequence_variations = 13;
      case 13: {
        if (tag == 106) {
         parse_sequence_variations:
          DO_(input->IncrementRecursionDepth());
         parse_loop_sequence_variations:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_sequence_variations()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(106)) goto parse_loop_sequence_variations;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectTag(112)) goto parse_mapping_quality;
        break;
      }

      // optional int32 mapping_quality = 14;
      case 14: {
        if (tag == 112) {
         parse_mapping_quality:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>(
                 input, &mapping_quality_)));
          set_has_mapping_quality();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(120)) goto parse_pair_flags;
        break;
      }

      // optional uint32 pair_flags = 15;
      case 15: {
        if (tag == 120) {
         parse_pair_flags:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &pair_flags_)));
          set_has_pair_flags();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(130)) goto parse_pair_alignment_link;
        break;
      }

      // optional .goby.RelatedAlignmentEntry pair_alignment_link = 16;
      case 16: {
        if (tag == 130) {
         parse_pair_alignment_link:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_pair_alignment_link()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(136)) goto parse_fragment_index;
        break;
      }

      // optional uint32 fragment_index = 17;
      case 17: {
        if (tag == 136) {
         parse_fragment_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &fragment_index_)));
          set_has_fragment_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(146)) goto parse_spliced_forward_alignment_link;
        break;
      }

      // optional .goby.RelatedAlignmentEntry spliced_forward_alignment_link = 18;
      case 18: {
        if (tag == 146) {
         parse_spliced_forward_alignment_link:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_spliced_forward_alignment_link()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(152)) goto parse_spliced_flags;
        break;
      }

      // optional uint32 spliced_flags = 19;
      case 19: {
        if (tag == 152) {
         parse_spliced_flags:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &spliced_flags_)));
          set_has_spliced_flags();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(160)) goto parse_insert_size;
        break;
      }

      // optional sint32 insert_size = 20;
      case 20: {
        if (tag == 160) {
         parse_insert_size:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_SINT32>(
                 input, &insert_size_)));
          set_has_insert_size();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(168)) goto parse_sample_index;
        break;
      }

      // optional uint32 sample_index = 21;
      case 21: {
        if (tag == 168) {
         parse_sample_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &sample_index_)));
          set_has_sample_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(178)) goto parse_spliced_backward_alignment_link;
        break;
      }

      // optional .goby.RelatedAlignmentEntry spliced_backward_alignment_link = 22;
      case 22: {
        if (tag == 178) {
         parse_spliced_backward_alignment_link:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_spliced_backward_alignment_link()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(200)) goto parse_query_index_occurrences;
        break;
      }

      // optional uint32 query_index_occurrences = 25;
      case 25: {
        if (tag == 200) {
         parse_query_index_occurrences:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &query_index_occurrences_)));
          set_has_query_index_occurrences();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(208)) goto parse_read_origin_index;
        break;
      }

      // optional uint32 read_origin_index = 26;
      case 26: {
        if (tag == 208) {
         parse_read_origin_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &read_origin_index_)));
          set_has_read_origin_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(216)) goto parse_ambiguity;
        break;
      }

      // optional uint32 ambiguity = 27;
      case 27: {
        if (tag == 216) {
         parse_ambiguity:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &ambiguity_)));
          set_has_ambiguity();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(242)) goto parse_softClippedBasesLeft;
        break;
      }

      // optional string softClippedBasesLeft = 30;
      case 30: {
        if (tag == 242) {
         parse_softClippedBasesLeft:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_softclippedbasesleft()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->softclippedbasesleft().data(), this->softclippedbasesleft().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentEntry.softClippedBasesLeft");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(250)) goto parse_softClippedBasesRight;
        break;
      }

      // optional string softClippedBasesRight = 31;
      case 31: {
        if (tag == 250) {
         parse_softClippedBasesRight:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_softclippedbasesright()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->softclippedbasesright().data(), this->softclippedbasesright().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentEntry.softClippedBasesRight");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(258)) goto parse_softClippedQualityLeft;
        break;
      }

      // optional bytes softClippedQualityLeft = 32;
      case 32: {
        if (tag == 258) {
         parse_softClippedQualityLeft:
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_softclippedqualityleft()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(266)) goto parse_softClippedQualityRight;
        break;
      }

      // optional bytes softClippedQualityRight = 33;
      case 33: {
        if (tag == 266) {
         parse_softClippedQualityRight:
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_softclippedqualityright()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(322)) goto parse_placedUnmappedSequence;
        break;
      }

      // optional string placedUnmappedSequence = 40;
      case 40: {
        if (tag == 322) {
         parse_placedUnmappedSequence:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_placedunmappedsequence()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->placedunmappedsequence().data(), this->placedunmappedsequence().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentEntry.placedUnmappedSequence");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(330)) goto parse_placedUnmappedQuality;
        break;
      }

      // optional bytes placedUnmappedQuality = 41;
      case 41: {
        if (tag == 330) {
         parse_placedUnmappedQuality:
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_placedunmappedquality()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(338)) goto parse_readName;
        break;
      }

      // optional string readName = 42;
      case 42: {
        if (tag == 338) {
         parse_readName:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_readname()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->readname().data(), this->readname().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentEntry.readName");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(402)) goto parse_bam_attributes;
        break;
      }

      // repeated string bam_attributes = 50;
      case 50: {
        if (tag == 402) {
         parse_bam_attributes:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_bam_attributes()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->bam_attributes(this->bam_attributes_size() - 1).data(),
            this->bam_attributes(this->bam_attributes_size() - 1).length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentEntry.bam_attributes");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(402)) goto parse_bam_attributes;
        if (input->ExpectTag(442)) goto parse_read_quality_scores;
        break;
      }

      // optional bytes read_quality_scores = 55;
      case 55: {
        if (tag == 442) {
         parse_read_quality_scores:
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_read_quality_scores()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.AlignmentEntry)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.AlignmentEntry)
  return false;
#undef DO_
}

void AlignmentEntry::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.AlignmentEntry)
  // optional uint32 query_index = 1;
  if (has_query_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->query_index(), output);
  }

  // optional uint32 target_index = 2;
  if (has_target_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->target_index(), output);
  }

  // optional uint32 position = 3;
  if (has_position()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->position(), output);
  }

  // optional float score = 4;
  if (has_score()) {
    ::google::protobuf::internal::WireFormatLite::WriteFloat(4, this->score(), output);
  }

  // optional uint32 query_position = 5;
  if (has_query_position()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->query_position(), output);
  }

  // optional bool matching_reverse_strand = 6;
  if (has_matching_reverse_strand()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(6, this->matching_reverse_strand(), output);
  }

  // optional uint32 multiplicity = 7;
  if (has_multiplicity()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->multiplicity(), output);
  }

  // optional uint32 number_of_mismatches = 8;
  if (has_number_of_mismatches()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(8, this->number_of_mismatches(), output);
  }

  // optional uint32 number_of_indels = 9;
  if (has_number_of_indels()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->number_of_indels(), output);
  }

  // optional uint32 query_length = 10;
  if (has_query_length()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->query_length(), output);
  }

  // optional uint32 query_aligned_length = 11;
  if (has_query_aligned_length()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->query_aligned_length(), output);
  }

  // optional uint32 target_aligned_length = 12;
  if (has_target_aligned_length()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(12, this->target_aligned_length(), output);
  }

  // repeated .goby.SequenceVariation sequence_variations = 13;
  for (unsigned int i = 0, n = this->sequence_variations_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      13, this->sequence_variations(i), output);
  }

  // optional int32 mapping_quality = 14;
  if (has_mapping_quality()) {
    ::google::protobuf::internal::WireFormatLite::WriteInt32(14, this->mapping_quality(), output);
  }

  // optional uint32 pair_flags = 15;
  if (has_pair_flags()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(15, this->pair_flags(), output);
  }

  // optional .goby.RelatedAlignmentEntry pair_alignment_link = 16;
  if (has_pair_alignment_link()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      16, *this->pair_alignment_link_, output);
  }

  // optional uint32 fragment_index = 17;
  if (has_fragment_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(17, this->fragment_index(), output);
  }

  // optional .goby.RelatedAlignmentEntry spliced_forward_alignment_link = 18;
  if (has_spliced_forward_alignment_link()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      18, *this->spliced_forward_alignment_link_, output);
  }

  // optional uint32 spliced_flags = 19;
  if (has_spliced_flags()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(19, this->spliced_flags(), output);
  }

  // optional sint32 insert_size = 20;
  if (has_insert_size()) {
    ::google::protobuf::internal::WireFormatLite::WriteSInt32(20, this->insert_size(), output);
  }

  // optional uint32 sample_index = 21;
  if (has_sample_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(21, this->sample_index(), output);
  }

  // optional .goby.RelatedAlignmentEntry spliced_backward_alignment_link = 22;
  if (has_spliced_backward_alignment_link()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      22, *this->spliced_backward_alignment_link_, output);
  }

  // optional uint32 query_index_occurrences = 25;
  if (has_query_index_occurrences()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(25, this->query_index_occurrences(), output);
  }

  // optional uint32 read_origin_index = 26;
  if (has_read_origin_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(26, this->read_origin_index(), output);
  }

  // optional uint32 ambiguity = 27;
  if (has_ambiguity()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(27, this->ambiguity(), output);
  }

  // optional string softClippedBasesLeft = 30;
  if (has_softclippedbasesleft()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->softclippedbasesleft().data(), this->softclippedbasesleft().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.softClippedBasesLeft");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      30, this->softclippedbasesleft(), output);
  }

  // optional string softClippedBasesRight = 31;
  if (has_softclippedbasesright()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->softclippedbasesright().data(), this->softclippedbasesright().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.softClippedBasesRight");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      31, this->softclippedbasesright(), output);
  }

  // optional bytes softClippedQualityLeft = 32;
  if (has_softclippedqualityleft()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      32, this->softclippedqualityleft(), output);
  }

  // optional bytes softClippedQualityRight = 33;
  if (has_softclippedqualityright()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      33, this->softclippedqualityright(), output);
  }

  // optional string placedUnmappedSequence = 40;
  if (has_placedunmappedsequence()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->placedunmappedsequence().data(), this->placedunmappedsequence().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.placedUnmappedSequence");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      40, this->placedunmappedsequence(), output);
  }

  // optional bytes placedUnmappedQuality = 41;
  if (has_placedunmappedquality()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      41, this->placedunmappedquality(), output);
  }

  // optional string readName = 42;
  if (has_readname()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->readname().data(), this->readname().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.readName");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      42, this->readname(), output);
  }

  // repeated string bam_attributes = 50;
  for (int i = 0; i < this->bam_attributes_size(); i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->bam_attributes(i).data(), this->bam_attributes(i).length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.bam_attributes");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      50, this->bam_attributes(i), output);
  }

  // optional bytes read_quality_scores = 55;
  if (has_read_quality_scores()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      55, this->read_quality_scores(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.AlignmentEntry)
}

::google::protobuf::uint8* AlignmentEntry::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.AlignmentEntry)
  // optional uint32 query_index = 1;
  if (has_query_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->query_index(), target);
  }

  // optional uint32 target_index = 2;
  if (has_target_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->target_index(), target);
  }

  // optional uint32 position = 3;
  if (has_position()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->position(), target);
  }

  // optional float score = 4;
  if (has_score()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteFloatToArray(4, this->score(), target);
  }

  // optional uint32 query_position = 5;
  if (has_query_position()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->query_position(), target);
  }

  // optional bool matching_reverse_strand = 6;
  if (has_matching_reverse_strand()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(6, this->matching_reverse_strand(), target);
  }

  // optional uint32 multiplicity = 7;
  if (has_multiplicity()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->multiplicity(), target);
  }

  // optional uint32 number_of_mismatches = 8;
  if (has_number_of_mismatches()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(8, this->number_of_mismatches(), target);
  }

  // optional uint32 number_of_indels = 9;
  if (has_number_of_indels()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->number_of_indels(), target);
  }

  // optional uint32 query_length = 10;
  if (has_query_length()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->query_length(), target);
  }

  // optional uint32 query_aligned_length = 11;
  if (has_query_aligned_length()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->query_aligned_length(), target);
  }

  // optional uint32 target_aligned_length = 12;
  if (has_target_aligned_length()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(12, this->target_aligned_length(), target);
  }

  // repeated .goby.SequenceVariation sequence_variations = 13;
  for (unsigned int i = 0, n = this->sequence_variations_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        13, this->sequence_variations(i), false, target);
  }

  // optional int32 mapping_quality = 14;
  if (has_mapping_quality()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(14, this->mapping_quality(), target);
  }

  // optional uint32 pair_flags = 15;
  if (has_pair_flags()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(15, this->pair_flags(), target);
  }

  // optional .goby.RelatedAlignmentEntry pair_alignment_link = 16;
  if (has_pair_alignment_link()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        16, *this->pair_alignment_link_, false, target);
  }

  // optional uint32 fragment_index = 17;
  if (has_fragment_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(17, this->fragment_index(), target);
  }

  // optional .goby.RelatedAlignmentEntry spliced_forward_alignment_link = 18;
  if (has_spliced_forward_alignment_link()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        18, *this->spliced_forward_alignment_link_, false, target);
  }

  // optional uint32 spliced_flags = 19;
  if (has_spliced_flags()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(19, this->spliced_flags(), target);
  }

  // optional sint32 insert_size = 20;
  if (has_insert_size()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteSInt32ToArray(20, this->insert_size(), target);
  }

  // optional uint32 sample_index = 21;
  if (has_sample_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(21, this->sample_index(), target);
  }

  // optional .goby.RelatedAlignmentEntry spliced_backward_alignment_link = 22;
  if (has_spliced_backward_alignment_link()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        22, *this->spliced_backward_alignment_link_, false, target);
  }

  // optional uint32 query_index_occurrences = 25;
  if (has_query_index_occurrences()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(25, this->query_index_occurrences(), target);
  }

  // optional uint32 read_origin_index = 26;
  if (has_read_origin_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(26, this->read_origin_index(), target);
  }

  // optional uint32 ambiguity = 27;
  if (has_ambiguity()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(27, this->ambiguity(), target);
  }

  // optional string softClippedBasesLeft = 30;
  if (has_softclippedbasesleft()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->softclippedbasesleft().data(), this->softclippedbasesleft().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.softClippedBasesLeft");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        30, this->softclippedbasesleft(), target);
  }

  // optional string softClippedBasesRight = 31;
  if (has_softclippedbasesright()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->softclippedbasesright().data(), this->softclippedbasesright().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.softClippedBasesRight");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        31, this->softclippedbasesright(), target);
  }

  // optional bytes softClippedQualityLeft = 32;
  if (has_softclippedqualityleft()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        32, this->softclippedqualityleft(), target);
  }

  // optional bytes softClippedQualityRight = 33;
  if (has_softclippedqualityright()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        33, this->softclippedqualityright(), target);
  }

  // optional string placedUnmappedSequence = 40;
  if (has_placedunmappedsequence()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->placedunmappedsequence().data(), this->placedunmappedsequence().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.placedUnmappedSequence");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        40, this->placedunmappedsequence(), target);
  }

  // optional bytes placedUnmappedQuality = 41;
  if (has_placedunmappedquality()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        41, this->placedunmappedquality(), target);
  }

  // optional string readName = 42;
  if (has_readname()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->readname().data(), this->readname().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.readName");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        42, this->readname(), target);
  }

  // repeated string bam_attributes = 50;
  for (int i = 0; i < this->bam_attributes_size(); i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->bam_attributes(i).data(), this->bam_attributes(i).length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentEntry.bam_attributes");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(50, this->bam_attributes(i), target);
  }

  // optional bytes read_quality_scores = 55;
  if (has_read_quality_scores()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        55, this->read_quality_scores(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.AlignmentEntry)
  return target;
}

int AlignmentEntry::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.AlignmentEntry)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 255u) {
    // optional uint32 multiplicity = 7;
    if (has_multiplicity()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->multiplicity());
    }

    // optional uint32 query_index = 1;
    if (has_query_index()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->query_index());
    }

    // optional uint32 target_index = 2;
    if (has_target_index()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->target_index());
    }

    // optional uint32 position = 3;
    if (has_position()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->position());
    }

    // optional bool matching_reverse_strand = 6;
    if (has_matching_reverse_strand()) {
      total_size += 1 + 1;
    }

    // optional uint32 query_position = 5;
    if (has_query_position()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->query_position());
    }

    // optional float score = 4;
    if (has_score()) {
      total_size += 1 + 4;
    }

    // optional uint32 number_of_mismatches = 8;
    if (has_number_of_mismatches()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->number_of_mismatches());
    }

  }
  if (_has_bits_[8 / 32] & 63232u) {
    // optional uint32 number_of_indels = 9;
    if (has_number_of_indels()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->number_of_indels());
    }

    // optional uint32 query_aligned_length = 11;
    if (has_query_aligned_length()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->query_aligned_length());
    }

    // optional uint32 target_aligned_length = 12;
    if (has_target_aligned_length()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->target_aligned_length());
    }

    // optional uint32 query_length = 10;
    if (has_query_length()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->query_length());
    }

    // optional int32 mapping_quality = 14;
    if (has_mapping_quality()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(
          this->mapping_quality());
    }

    // optional uint32 pair_flags = 15;
    if (has_pair_flags()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->pair_flags());
    }

    // optional .goby.RelatedAlignmentEntry pair_alignment_link = 16;
    if (has_pair_alignment_link()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->pair_alignment_link_);
    }

  }
  if (_has_bits_[16 / 32] & 16711680u) {
    // optional uint32 fragment_index = 17;
    if (has_fragment_index()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->fragment_index());
    }

    // optional .goby.RelatedAlignmentEntry spliced_forward_alignment_link = 18;
    if (has_spliced_forward_alignment_link()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->spliced_forward_alignment_link_);
    }

    // optional .goby.RelatedAlignmentEntry spliced_backward_alignment_link = 22;
    if (has_spliced_backward_alignment_link()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->spliced_backward_alignment_link_);
    }

    // optional uint32 spliced_flags = 19;
    if (has_spliced_flags()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->spliced_flags());
    }

    // optional sint32 insert_size = 20;
    if (has_insert_size()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::SInt32Size(
          this->insert_size());
    }

    // optional uint32 sample_index = 21;
    if (has_sample_index()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->sample_index());
    }

    // optional uint32 query_index_occurrences = 25;
    if (has_query_index_occurrences()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->query_index_occurrences());
    }

    // optional uint32 ambiguity = 27;
    if (has_ambiguity()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->ambiguity());
    }

  }
  if (_has_bits_[25 / 32] & 4261412864u) {
    // optional bytes read_quality_scores = 55;
    if (has_read_quality_scores()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->read_quality_scores());
    }

    // optional uint32 read_origin_index = 26;
    if (has_read_origin_index()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->read_origin_index());
    }

    // optional string softClippedBasesLeft = 30;
    if (has_softclippedbasesleft()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->softclippedbasesleft());
    }

    // optional string softClippedBasesRight = 31;
    if (has_softclippedbasesright()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->softclippedbasesright());
    }

    // optional bytes softClippedQualityLeft = 32;
    if (has_softclippedqualityleft()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->softclippedqualityleft());
    }

    // optional bytes softClippedQualityRight = 33;
    if (has_softclippedqualityright()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->softclippedqualityright());
    }

    // optional string placedUnmappedSequence = 40;
    if (has_placedunmappedsequence()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->placedunmappedsequence());
    }

  }
  if (_has_bits_[32 / 32] & 3u) {
    // optional bytes placedUnmappedQuality = 41;
    if (has_placedunmappedquality()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->placedunmappedquality());
    }

    // optional string readName = 42;
    if (has_readname()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->readname());
    }

  }
  // repeated .goby.SequenceVariation sequence_variations = 13;
  total_size += 1 * this->sequence_variations_size();
  for (int i = 0; i < this->sequence_variations_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->sequence_variations(i));
  }

  // repeated string bam_attributes = 50;
  total_size += 2 * this->bam_attributes_size();
  for (int i = 0; i < this->bam_attributes_size(); i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->bam_attributes(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AlignmentEntry::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.AlignmentEntry)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const AlignmentEntry* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const AlignmentEntry>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.AlignmentEntry)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.AlignmentEntry)
    MergeFrom(*source);
  }
}

void AlignmentEntry::MergeFrom(const AlignmentEntry& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.AlignmentEntry)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  sequence_variations_.MergeFrom(from.sequence_variations_);
  bam_attributes_.MergeFrom(from.bam_attributes_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_multiplicity()) {
      set_multiplicity(from.multiplicity());
    }
    if (from.has_query_index()) {
      set_query_index(from.query_index());
    }
    if (from.has_target_index()) {
      set_target_index(from.target_index());
    }
    if (from.has_position()) {
      set_position(from.position());
    }
    if (from.has_matching_reverse_strand()) {
      set_matching_reverse_strand(from.matching_reverse_strand());
    }
    if (from.has_query_position()) {
      set_query_position(from.query_position());
    }
    if (from.has_score()) {
      set_score(from.score());
    }
    if (from.has_number_of_mismatches()) {
      set_number_of_mismatches(from.number_of_mismatches());
    }
  }
  if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
    if (from.has_number_of_indels()) {
      set_number_of_indels(from.number_of_indels());
    }
    if (from.has_query_aligned_length()) {
      set_query_aligned_length(from.query_aligned_length());
    }
    if (from.has_target_aligned_length()) {
      set_target_aligned_length(from.target_aligned_length());
    }
    if (from.has_query_length()) {
      set_query_length(from.query_length());
    }
    if (from.has_mapping_quality()) {
      set_mapping_quality(from.mapping_quality());
    }
    if (from.has_pair_flags()) {
      set_pair_flags(from.pair_flags());
    }
    if (from.has_pair_alignment_link()) {
      mutable_pair_alignment_link()->::goby::RelatedAlignmentEntry::MergeFrom(from.pair_alignment_link());
    }
  }
  if (from._has_bits_[16 / 32] & (0xffu << (16 % 32))) {
    if (from.has_fragment_index()) {
      set_fragment_index(from.fragment_index());
    }
    if (from.has_spliced_forward_alignment_link()) {
      mutable_spliced_forward_alignment_link()->::goby::RelatedAlignmentEntry::MergeFrom(from.spliced_forward_alignment_link());
    }
    if (from.has_spliced_backward_alignment_link()) {
      mutable_spliced_backward_alignment_link()->::goby::RelatedAlignmentEntry::MergeFrom(from.spliced_backward_alignment_link());
    }
    if (from.has_spliced_flags()) {
      set_spliced_flags(from.spliced_flags());
    }
    if (from.has_insert_size()) {
      set_insert_size(from.insert_size());
    }
    if (from.has_sample_index()) {
      set_sample_index(from.sample_index());
    }
    if (from.has_query_index_occurrences()) {
      set_query_index_occurrences(from.query_index_occurrences());
    }
    if (from.has_ambiguity()) {
      set_ambiguity(from.ambiguity());
    }
  }
  if (from._has_bits_[25 / 32] & (0xffu << (25 % 32))) {
    if (from.has_read_quality_scores()) {
      set_has_read_quality_scores();
      read_quality_scores_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.read_quality_scores_);
    }
    if (from.has_read_origin_index()) {
      set_read_origin_index(from.read_origin_index());
    }
    if (from.has_softclippedbasesleft()) {
      set_has_softclippedbasesleft();
      softclippedbasesleft_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.softclippedbasesleft_);
    }
    if (from.has_softclippedbasesright()) {
      set_has_softclippedbasesright();
      softclippedbasesright_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.softclippedbasesright_);
    }
    if (from.has_softclippedqualityleft()) {
      set_has_softclippedqualityleft();
      softclippedqualityleft_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.softclippedqualityleft_);
    }
    if (from.has_softclippedqualityright()) {
      set_has_softclippedqualityright();
      softclippedqualityright_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.softclippedqualityright_);
    }
    if (from.has_placedunmappedsequence()) {
      set_has_placedunmappedsequence();
      placedunmappedsequence_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.placedunmappedsequence_);
    }
  }
  if (from._has_bits_[32 / 32] & (0xffu << (32 % 32))) {
    if (from.has_placedunmappedquality()) {
      set_has_placedunmappedquality();
      placedunmappedquality_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.placedunmappedquality_);
    }
    if (from.has_readname()) {
      set_has_readname();
      readname_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.readname_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void AlignmentEntry::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.AlignmentEntry)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AlignmentEntry::CopyFrom(const AlignmentEntry& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.AlignmentEntry)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AlignmentEntry::IsInitialized() const {

  return true;
}

void AlignmentEntry::Swap(AlignmentEntry* other) {
  if (other == this) return;
  InternalSwap(other);
}
void AlignmentEntry::InternalSwap(AlignmentEntry* other) {
  std::swap(multiplicity_, other->multiplicity_);
  std::swap(query_index_, other->query_index_);
  std::swap(target_index_, other->target_index_);
  std::swap(position_, other->position_);
  std::swap(matching_reverse_strand_, other->matching_reverse_strand_);
  std::swap(query_position_, other->query_position_);
  std::swap(score_, other->score_);
  std::swap(number_of_mismatches_, other->number_of_mismatches_);
  std::swap(number_of_indels_, other->number_of_indels_);
  std::swap(query_aligned_length_, other->query_aligned_length_);
  std::swap(target_aligned_length_, other->target_aligned_length_);
  sequence_variations_.UnsafeArenaSwap(&other->sequence_variations_);
  std::swap(query_length_, other->query_length_);
  std::swap(mapping_quality_, other->mapping_quality_);
  std::swap(pair_flags_, other->pair_flags_);
  std::swap(pair_alignment_link_, other->pair_alignment_link_);
  std::swap(fragment_index_, other->fragment_index_);
  std::swap(spliced_forward_alignment_link_, other->spliced_forward_alignment_link_);
  std::swap(spliced_backward_alignment_link_, other->spliced_backward_alignment_link_);
  std::swap(spliced_flags_, other->spliced_flags_);
  std::swap(insert_size_, other->insert_size_);
  std::swap(sample_index_, other->sample_index_);
  std::swap(query_index_occurrences_, other->query_index_occurrences_);
  std::swap(ambiguity_, other->ambiguity_);
  bam_attributes_.UnsafeArenaSwap(&other->bam_attributes_);
  read_quality_scores_.Swap(&other->read_quality_scores_);
  std::swap(read_origin_index_, other->read_origin_index_);
  softclippedbasesleft_.Swap(&other->softclippedbasesleft_);
  softclippedbasesright_.Swap(&other->softclippedbasesright_);
  softclippedqualityleft_.Swap(&other->softclippedqualityleft_);
  softclippedqualityright_.Swap(&other->softclippedqualityright_);
  placedunmappedsequence_.Swap(&other->placedunmappedsequence_);
  placedunmappedquality_.Swap(&other->placedunmappedquality_);
  readname_.Swap(&other->readname_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  std::swap(_has_bits_[1], other->_has_bits_[1]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata AlignmentEntry::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AlignmentEntry_descriptor_;
  metadata.reflection = AlignmentEntry_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// AlignmentEntry

// optional uint32 multiplicity = 7;
bool AlignmentEntry::has_multiplicity() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void AlignmentEntry::set_has_multiplicity() {
  _has_bits_[0] |= 0x00000001u;
}
void AlignmentEntry::clear_has_multiplicity() {
  _has_bits_[0] &= ~0x00000001u;
}
void AlignmentEntry::clear_multiplicity() {
  multiplicity_ = 0u;
  clear_has_multiplicity();
}
 ::google::protobuf::uint32 AlignmentEntry::multiplicity() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.multiplicity)
  return multiplicity_;
}
 void AlignmentEntry::set_multiplicity(::google::protobuf::uint32 value) {
  set_has_multiplicity();
  multiplicity_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.multiplicity)
}

// optional uint32 query_index = 1;
bool AlignmentEntry::has_query_index() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void AlignmentEntry::set_has_query_index() {
  _has_bits_[0] |= 0x00000002u;
}
void AlignmentEntry::clear_has_query_index() {
  _has_bits_[0] &= ~0x00000002u;
}
void AlignmentEntry::clear_query_index() {
  query_index_ = 0u;
  clear_has_query_index();
}
 ::google::protobuf::uint32 AlignmentEntry::query_index() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.query_index)
  return query_index_;
}
 void AlignmentEntry::set_query_index(::google::protobuf::uint32 value) {
  set_has_query_index();
  query_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.query_index)
}

// optional uint32 target_index = 2;
bool AlignmentEntry::has_target_index() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void AlignmentEntry::set_has_target_index() {
  _has_bits_[0] |= 0x00000004u;
}
void AlignmentEntry::clear_has_target_index() {
  _has_bits_[0] &= ~0x00000004u;
}
void AlignmentEntry::clear_target_index() {
  target_index_ = 0u;
  clear_has_target_index();
}
 ::google::protobuf::uint32 AlignmentEntry::target_index() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.target_index)
  return target_index_;
}
 void AlignmentEntry::set_target_index(::google::protobuf::uint32 value) {
  set_has_target_index();
  target_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.target_index)
}

// optional uint32 position = 3;
bool AlignmentEntry::has_position() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void AlignmentEntry::set_has_position() {
  _has_bits_[0] |= 0x00000008u;
}
void AlignmentEntry::clear_has_position() {
  _has_bits_[0] &= ~0x00000008u;
}
void AlignmentEntry::clear_position() {
  position_ = 0u;
  clear_has_position();
}
 ::google::protobuf::uint32 AlignmentEntry::position() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.position)
  return position_;
}
 void AlignmentEntry::set_position(::google::protobuf::uint32 value) {
  set_has_position();
  position_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.position)
}

// optional bool matching_reverse_strand = 6;
bool AlignmentEntry::has_matching_reverse_strand() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void AlignmentEntry::set_has_matching_reverse_strand() {
  _has_bits_[0] |= 0x00000010u;
}
void AlignmentEntry::clear_has_matching_reverse_strand() {
  _has_bits_[0] &= ~0x00000010u;
}
void AlignmentEntry::clear_matching_reverse_strand() {
  matching_reverse_strand_ = false;
  clear_has_matching_reverse_strand();
}
 bool AlignmentEntry::matching_reverse_strand() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.matching_reverse_strand)
  return matching_reverse_strand_;
}
 void AlignmentEntry::set_matching_reverse_strand(bool value) {
  set_has_matching_reverse_strand();
  matching_reverse_strand_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.matching_reverse_strand)
}

// optional uint32 query_position = 5;
bool AlignmentEntry::has_query_position() const {
  return (_has_bits_[0] & 0x00000020u) != 0;
}
void AlignmentEntry::set_has_query_position() {
  _has_bits_[0] |= 0x00000020u;
}
void AlignmentEntry::clear_has_query_position() {
  _has_bits_[0] &= ~0x00000020u;
}
void AlignmentEntry::clear_query_position() {
  query_position_ = 0u;
  clear_has_query_position();
}
 ::google::protobuf::uint32 AlignmentEntry::query_position() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.query_position)
  return query_position_;
}
 void AlignmentEntry::set_query_position(::google::protobuf::uint32 value) {
  set_has_query_position();
  query_position_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.query_position)
}

// optional float score = 4;
bool AlignmentEntry::has_score() const {
  return (_has_bits_[0] & 0x00000040u) != 0;
}
void AlignmentEntry::set_has_score() {
  _has_bits_[0] |= 0x00000040u;
}
void AlignmentEntry::clear_has_score() {
  _has_bits_[0] &= ~0x00000040u;
}
void AlignmentEntry::clear_score() {
  score_ = 0;
  clear_has_score();
}
 float AlignmentEntry::score() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.score)
  return score_;
}
 void AlignmentEntry::set_score(float value) {
  set_has_score();
  score_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.score)
}

// optional uint32 number_of_mismatches = 8;
bool AlignmentEntry::has_number_of_mismatches() const {
  return (_has_bits_[0] & 0x00000080u) != 0;
}
void AlignmentEntry::set_has_number_of_mismatches() {
  _has_bits_[0] |= 0x00000080u;
}
void AlignmentEntry::clear_has_number_of_mismatches() {
  _has_bits_[0] &= ~0x00000080u;
}
void AlignmentEntry::clear_number_of_mismatches() {
  number_of_mismatches_ = 0u;
  clear_has_number_of_mismatches();
}
 ::google::protobuf::uint32 AlignmentEntry::number_of_mismatches() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.number_of_mismatches)
  return number_of_mismatches_;
}
 void AlignmentEntry::set_number_of_mismatches(::google::protobuf::uint32 value) {
  set_has_number_of_mismatches();
  number_of_mismatches_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.number_of_mismatches)
}

// optional uint32 number_of_indels = 9;
bool AlignmentEntry::has_number_of_indels() const {
  return (_has_bits_[0] & 0x00000100u) != 0;
}
void AlignmentEntry::set_has_number_of_indels() {
  _has_bits_[0] |= 0x00000100u;
}
void AlignmentEntry::clear_has_number_of_indels() {
  _has_bits_[0] &= ~0x00000100u;
}
void AlignmentEntry::clear_number_of_indels() {
  number_of_indels_ = 0u;
  clear_has_number_of_indels();
}
 ::google::protobuf::uint32 AlignmentEntry::number_of_indels() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.number_of_indels)
  return number_of_indels_;
}
 void AlignmentEntry::set_number_of_indels(::google::protobuf::uint32 value) {
  set_has_number_of_indels();
  number_of_indels_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.number_of_indels)
}

// optional uint32 query_aligned_length = 11;
bool AlignmentEntry::has_query_aligned_length() const {
  return (_has_bits_[0] & 0x00000200u) != 0;
}
void AlignmentEntry::set_has_query_aligned_length() {
  _has_bits_[0] |= 0x00000200u;
}
void AlignmentEntry::clear_has_query_aligned_length() {
  _has_bits_[0] &= ~0x00000200u;
}
void AlignmentEntry::clear_query_aligned_length() {
  query_aligned_length_ = 0u;
  clear_has_query_aligned_length();
}
 ::google::protobuf::uint32 AlignmentEntry::query_aligned_length() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.query_aligned_length)
  return query_aligned_length_;
}
 void AlignmentEntry::set_query_aligned_length(::google::protobuf::uint32 value) {
  set_has_query_aligned_length();
  query_aligned_length_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.query_aligned_length)
}

// optional uint32 target_aligned_length = 12;
bool AlignmentEntry::has_target_aligned_length() const {
  return (_has_bits_[0] & 0x00000400u) != 0;
}
void AlignmentEntry::set_has_target_aligned_length() {
  _has_bits_[0] |= 0x00000400u;
}
void AlignmentEntry::clear_has_target_aligned_length() {
  _has_bits_[0] &= ~0x00000400u;
}
void AlignmentEntry::clear_target_aligned_length() {
  target_aligned_length_ = 0u;
  clear_has_target_aligned_length();
}
 ::google::protobuf::uint32 AlignmentEntry::target_aligned_length() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.target_aligned_length)
  return target_aligned_length_;
}
 void AlignmentEntry::set_target_aligned_length(::google::protobuf::uint32 value) {
  set_has_target_aligned_length();
  target_aligned_length_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.target_aligned_length)
}

// repeated .goby.SequenceVariation sequence_variations = 13;
int AlignmentEntry::sequence_variations_size() const {
  return sequence_variations_.size();
}
void AlignmentEntry::clear_sequence_variations() {
  sequence_variations_.Clear();
}
const ::goby::SequenceVariation& AlignmentEntry::sequence_variations(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.sequence_variations)
  return sequence_variations_.Get(index);
}
::goby::SequenceVariation* AlignmentEntry::mutable_sequence_variations(int index) {
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.sequence_variations)
  return sequence_variations_.Mutable(index);
}
::goby::SequenceVariation* AlignmentEntry::add_sequence_variations() {
  // @@protoc_insertion_point(field_add:goby.AlignmentEntry.sequence_variations)
  return sequence_variations_.Add();
}
::google::protobuf::RepeatedPtrField< ::goby::SequenceVariation >*
AlignmentEntry::mutable_sequence_variations() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentEntry.sequence_variations)
  return &sequence_variations_;
}
const ::google::protobuf::RepeatedPtrField< ::goby::SequenceVariation >&
AlignmentEntry::sequence_variations() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentEntry.sequence_variations)
  return sequence_variations_;
}

// optional uint32 query_length = 10;
bool AlignmentEntry::has_query_length() const {
  return (_has_bits_[0] & 0x00001000u) != 0;
}
void AlignmentEntry::set_has_query_length() {
  _has_bits_[0] |= 0x00001000u;
}
void AlignmentEntry::clear_has_query_length() {
  _has_bits_[0] &= ~0x00001000u;
}
void AlignmentEntry::clear_query_length() {
  query_length_ = 0u;
  clear_has_query_length();
}
 ::google::protobuf::uint32 AlignmentEntry::query_length() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.query_length)
  return query_length_;
}
 void AlignmentEntry::set_query_length(::google::protobuf::uint32 value) {
  set_has_query_length();
  query_length_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.query_length)
}

// optional int32 mapping_quality = 14;
bool AlignmentEntry::has_mapping_quality() const {
  return (_has_bits_[0] & 0x00002000u) != 0;
}
void AlignmentEntry::set_has_mapping_quality() {
  _has_bits_[0] |= 0x00002000u;
}
void AlignmentEntry::clear_has_mapping_quality() {
  _has_bits_[0] &= ~0x00002000u;
}
void AlignmentEntry::clear_mapping_quality() {
  mapping_quality_ = 0;
  clear_has_mapping_quality();
}
 ::google::protobuf::int32 AlignmentEntry::mapping_quality() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.mapping_quality)
  return mapping_quality_;
}
 void AlignmentEntry::set_mapping_quality(::google::protobuf::int32 value) {
  set_has_mapping_quality();
  mapping_quality_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.mapping_quality)
}

// optional uint32 pair_flags = 15;
bool AlignmentEntry::has_pair_flags() const {
  return (_has_bits_[0] & 0x00004000u) != 0;
}
void AlignmentEntry::set_has_pair_flags() {
  _has_bits_[0] |= 0x00004000u;
}
void AlignmentEntry::clear_has_pair_flags() {
  _has_bits_[0] &= ~0x00004000u;
}
void AlignmentEntry::clear_pair_flags() {
  pair_flags_ = 0u;
  clear_has_pair_flags();
}
 ::google::protobuf::uint32 AlignmentEntry::pair_flags() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.pair_flags)
  return pair_flags_;
}
 void AlignmentEntry::set_pair_flags(::google::protobuf::uint32 value) {
  set_has_pair_flags();
  pair_flags_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.pair_flags)
}

// optional .goby.RelatedAlignmentEntry pair_alignment_link = 16;
bool AlignmentEntry::has_pair_alignment_link() const {
  return (_has_bits_[0] & 0x00008000u) != 0;
}
void AlignmentEntry::set_has_pair_alignment_link() {
  _has_bits_[0] |= 0x00008000u;
}
void AlignmentEntry::clear_has_pair_alignment_link() {
  _has_bits_[0] &= ~0x00008000u;
}
void AlignmentEntry::clear_pair_alignment_link() {
  if (pair_alignment_link_ != NULL) pair_alignment_link_->::goby::RelatedAlignmentEntry::Clear();
  clear_has_pair_alignment_link();
}
const ::goby::RelatedAlignmentEntry& AlignmentEntry::pair_alignment_link() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.pair_alignment_link)
  return pair_alignment_link_ != NULL ? *pair_alignment_link_ : *default_instance_->pair_alignment_link_;
}
::goby::RelatedAlignmentEntry* AlignmentEntry::mutable_pair_alignment_link() {
  set_has_pair_alignment_link();
  if (pair_alignment_link_ == NULL) {
    pair_alignment_link_ = new ::goby::RelatedAlignmentEntry;
  }
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.pair_alignment_link)
  return pair_alignment_link_;
}
::goby::RelatedAlignmentEntry* AlignmentEntry::release_pair_alignment_link() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.pair_alignment_link)
  clear_has_pair_alignment_link();
  ::goby::RelatedAlignmentEntry* temp = pair_alignment_link_;
  pair_alignment_link_ = NULL;
  return temp;
}
void AlignmentEntry::set_allocated_pair_alignment_link(::goby::RelatedAlignmentEntry* pair_alignment_link) {
  delete pair_alignment_link_;
  pair_alignment_link_ = pair_alignment_link;
  if (pair_alignment_link) {
    set_has_pair_alignment_link();
  } else {
    clear_has_pair_alignment_link();
  }
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.pair_alignment_link)
}

// optional uint32 fragment_index = 17;
bool AlignmentEntry::has_fragment_index() const {
  return (_has_bits_[0] & 0x00010000u) != 0;
}
void AlignmentEntry::set_has_fragment_index() {
  _has_bits_[0] |= 0x00010000u;
}
void AlignmentEntry::clear_has_fragment_index() {
  _has_bits_[0] &= ~0x00010000u;
}
void AlignmentEntry::clear_fragment_index() {
  fragment_index_ = 0u;
  clear_has_fragment_index();
}
 ::google::protobuf::uint32 AlignmentEntry::fragment_index() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.fragment_index)
  return fragment_index_;
}
 void AlignmentEntry::set_fragment_index(::google::protobuf::uint32 value) {
  set_has_fragment_index();
  fragment_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.fragment_index)
}

// optional .goby.RelatedAlignmentEntry spliced_forward_alignment_link = 18;
bool AlignmentEntry::has_spliced_forward_alignment_link() const {
  return (_has_bits_[0] & 0x00020000u) != 0;
}
void AlignmentEntry::set_has_spliced_forward_alignment_link() {
  _has_bits_[0] |= 0x00020000u;
}
void AlignmentEntry::clear_has_spliced_forward_alignment_link() {
  _has_bits_[0] &= ~0x00020000u;
}
void AlignmentEntry::clear_spliced_forward_alignment_link() {
  if (spliced_forward_alignment_link_ != NULL) spliced_forward_alignment_link_->::goby::RelatedAlignmentEntry::Clear();
  clear_has_spliced_forward_alignment_link();
}
const ::goby::RelatedAlignmentEntry& AlignmentEntry::spliced_forward_alignment_link() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.spliced_forward_alignment_link)
  return spliced_forward_alignment_link_ != NULL ? *spliced_forward_alignment_link_ : *default_instance_->spliced_forward_alignment_link_;
}
::goby::RelatedAlignmentEntry* AlignmentEntry::mutable_spliced_forward_alignment_link() {
  set_has_spliced_forward_alignment_link();
  if (spliced_forward_alignment_link_ == NULL) {
    spliced_forward_alignment_link_ = new ::goby::RelatedAlignmentEntry;
  }
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.spliced_forward_alignment_link)
  return spliced_forward_alignment_link_;
}
::goby::RelatedAlignmentEntry* AlignmentEntry::release_spliced_forward_alignment_link() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.spliced_forward_alignment_link)
  clear_has_spliced_forward_alignment_link();
  ::goby::RelatedAlignmentEntry* temp = spliced_forward_alignment_link_;
  spliced_forward_alignment_link_ = NULL;
  return temp;
}
void AlignmentEntry::set_allocated_spliced_forward_alignment_link(::goby::RelatedAlignmentEntry* spliced_forward_alignment_link) {
  delete spliced_forward_alignment_link_;
  spliced_forward_alignment_link_ = spliced_forward_alignment_link;
  if (spliced_forward_alignment_link) {
    set_has_spliced_forward_alignment_link();
  } else {
    clear_has_spliced_forward_alignment_link();
  }
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.spliced_forward_alignment_link)
}

// optional .goby.RelatedAlignmentEntry spliced_backward_alignment_link = 22;
bool AlignmentEntry::has_spliced_backward_alignment_link() const {
  return (_has_bits_[0] & 0x00040000u) != 0;
}
void AlignmentEntry::set_has_spliced_backward_alignment_link() {
  _has_bits_[0] |= 0x00040000u;
}
void AlignmentEntry::clear_has_spliced_backward_alignment_link() {
  _has_bits_[0] &= ~0x00040000u;
}
void AlignmentEntry::clear_spliced_backward_alignment_link() {
  if (spliced_backward_alignment_link_ != NULL) spliced_backward_alignment_link_->::goby::RelatedAlignmentEntry::Clear();
  clear_has_spliced_backward_alignment_link();
}
const ::goby::RelatedAlignmentEntry& AlignmentEntry::spliced_backward_alignment_link() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.spliced_backward_alignment_link)
  return spliced_backward_alignment_link_ != NULL ? *spliced_backward_alignment_link_ : *default_instance_->spliced_backward_alignment_link_;
}
::goby::RelatedAlignmentEntry* AlignmentEntry::mutable_spliced_backward_alignment_link() {
  set_has_spliced_backward_alignment_link();
  if (spliced_backward_alignment_link_ == NULL) {
    spliced_backward_alignment_link_ = new ::goby::RelatedAlignmentEntry;
  }
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.spliced_backward_alignment_link)
  return spliced_backward_alignment_link_;
}
::goby::RelatedAlignmentEntry* AlignmentEntry::release_spliced_backward_alignment_link() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.spliced_backward_alignment_link)
  clear_has_spliced_backward_alignment_link();
  ::goby::RelatedAlignmentEntry* temp = spliced_backward_alignment_link_;
  spliced_backward_alignment_link_ = NULL;
  return temp;
}
void AlignmentEntry::set_allocated_spliced_backward_alignment_link(::goby::RelatedAlignmentEntry* spliced_backward_alignment_link) {
  delete spliced_backward_alignment_link_;
  spliced_backward_alignment_link_ = spliced_backward_alignment_link;
  if (spliced_backward_alignment_link) {
    set_has_spliced_backward_alignment_link();
  } else {
    clear_has_spliced_backward_alignment_link();
  }
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.spliced_backward_alignment_link)
}

// optional uint32 spliced_flags = 19;
bool AlignmentEntry::has_spliced_flags() const {
  return (_has_bits_[0] & 0x00080000u) != 0;
}
void AlignmentEntry::set_has_spliced_flags() {
  _has_bits_[0] |= 0x00080000u;
}
void AlignmentEntry::clear_has_spliced_flags() {
  _has_bits_[0] &= ~0x00080000u;
}
void AlignmentEntry::clear_spliced_flags() {
  spliced_flags_ = 0u;
  clear_has_spliced_flags();
}
 ::google::protobuf::uint32 AlignmentEntry::spliced_flags() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.spliced_flags)
  return spliced_flags_;
}
 void AlignmentEntry::set_spliced_flags(::google::protobuf::uint32 value) {
  set_has_spliced_flags();
  spliced_flags_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.spliced_flags)
}

// optional sint32 insert_size = 20;
bool AlignmentEntry::has_insert_size() const {
  return (_has_bits_[0] & 0x00100000u) != 0;
}
void AlignmentEntry::set_has_insert_size() {
  _has_bits_[0] |= 0x00100000u;
}
void AlignmentEntry::clear_has_insert_size() {
  _has_bits_[0] &= ~0x00100000u;
}
void AlignmentEntry::clear_insert_size() {
  insert_size_ = 0;
  clear_has_insert_size();
}
 ::google::protobuf::int32 AlignmentEntry::insert_size() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.insert_size)
  return insert_size_;
}
 void AlignmentEntry::set_insert_size(::google::protobuf::int32 value) {
  set_has_insert_size();
  insert_size_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.insert_size)
}

// optional uint32 sample_index = 21;
bool AlignmentEntry::has_sample_index() const {
  return (_has_bits_[0] & 0x00200000u) != 0;
}
void AlignmentEntry::set_has_sample_index() {
  _has_bits_[0] |= 0x00200000u;
}
void AlignmentEntry::clear_has_sample_index() {
  _has_bits_[0] &= ~0x00200000u;
}
void AlignmentEntry::clear_sample_index() {
  sample_index_ = 0u;
  clear_has_sample_index();
}
 ::google::protobuf::uint32 AlignmentEntry::sample_index() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.sample_index)
  return sample_index_;
}
 void AlignmentEntry::set_sample_index(::google::protobuf::uint32 value) {
  set_has_sample_index();
  sample_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.sample_index)
}

// optional uint32 query_index_occurrences = 25;
bool AlignmentEntry::has_query_index_occurrences() const {
  return (_has_bits_[0] & 0x00400000u) != 0;
}
void AlignmentEntry::set_has_query_index_occurrences() {
  _has_bits_[0] |= 0x00400000u;
}
void AlignmentEntry::clear_has_query_index_occurrences() {
  _has_bits_[0] &= ~0x00400000u;
}
void AlignmentEntry::clear_query_index_occurrences() {
  query_index_occurrences_ = 0u;
  clear_has_query_index_occurrences();
}
 ::google::protobuf::uint32 AlignmentEntry::query_index_occurrences() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.query_index_occurrences)
  return query_index_occurrences_;
}
 void AlignmentEntry::set_query_index_occurrences(::google::protobuf::uint32 value) {
  set_has_query_index_occurrences();
  query_index_occurrences_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.query_index_occurrences)
}

// optional uint32 ambiguity = 27;
bool AlignmentEntry::has_ambiguity() const {
  return (_has_bits_[0] & 0x00800000u) != 0;
}
void AlignmentEntry::set_has_ambiguity() {
  _has_bits_[0] |= 0x00800000u;
}
void AlignmentEntry::clear_has_ambiguity() {
  _has_bits_[0] &= ~0x00800000u;
}
void AlignmentEntry::clear_ambiguity() {
  ambiguity_ = 0u;
  clear_has_ambiguity();
}
 ::google::protobuf::uint32 AlignmentEntry::ambiguity() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.ambiguity)
  return ambiguity_;
}
 void AlignmentEntry::set_ambiguity(::google::protobuf::uint32 value) {
  set_has_ambiguity();
  ambiguity_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.ambiguity)
}

// repeated string bam_attributes = 50;
int AlignmentEntry::bam_attributes_size() const {
  return bam_attributes_.size();
}
void AlignmentEntry::clear_bam_attributes() {
  bam_attributes_.Clear();
}
 const ::std::string& AlignmentEntry::bam_attributes(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.bam_attributes)
  return bam_attributes_.Get(index);
}
 ::std::string* AlignmentEntry::mutable_bam_attributes(int index) {
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.bam_attributes)
  return bam_attributes_.Mutable(index);
}
 void AlignmentEntry::set_bam_attributes(int index, const ::std::string& value) {
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.bam_attributes)
  bam_attributes_.Mutable(index)->assign(value);
}
 void AlignmentEntry::set_bam_attributes(int index, const char* value) {
  bam_attributes_.Mutable(index)->assign(value);
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.bam_attributes)
}
 void AlignmentEntry::set_bam_attributes(int index, const char* value, size_t size) {
  bam_attributes_.Mutable(index)->assign(
    reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.bam_attributes)
}
 ::std::string* AlignmentEntry::add_bam_attributes() {
  // @@protoc_insertion_point(field_add_mutable:goby.AlignmentEntry.bam_attributes)
  return bam_attributes_.Add();
}
 void AlignmentEntry::add_bam_attributes(const ::std::string& value) {
  bam_attributes_.Add()->assign(value);
  // @@protoc_insertion_point(field_add:goby.AlignmentEntry.bam_attributes)
}
 void AlignmentEntry::add_bam_attributes(const char* value) {
  bam_attributes_.Add()->assign(value);
  // @@protoc_insertion_point(field_add_char:goby.AlignmentEntry.bam_attributes)
}
 void AlignmentEntry::add_bam_attributes(const char* value, size_t size) {
  bam_attributes_.Add()->assign(reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_add_pointer:goby.AlignmentEntry.bam_attributes)
}
 const ::google::protobuf::RepeatedPtrField< ::std::string>&
AlignmentEntry::bam_attributes() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentEntry.bam_attributes)
  return bam_attributes_;
}
 ::google::protobuf::RepeatedPtrField< ::std::string>*
AlignmentEntry::mutable_bam_attributes() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentEntry.bam_attributes)
  return &bam_attributes_;
}

// optional bytes read_quality_scores = 55;
bool AlignmentEntry::has_read_quality_scores() const {
  return (_has_bits_[0] & 0x02000000u) != 0;
}
void AlignmentEntry::set_has_read_quality_scores() {
  _has_bits_[0] |= 0x02000000u;
}
void AlignmentEntry::clear_has_read_quality_scores() {
  _has_bits_[0] &= ~0x02000000u;
}
void AlignmentEntry::clear_read_quality_scores() {
  read_quality_scores_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_read_quality_scores();
}
 const ::std::string& AlignmentEntry::read_quality_scores() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.read_quality_scores)
  return read_quality_scores_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_read_quality_scores(const ::std::string& value) {
  set_has_read_quality_scores();
  read_quality_scores_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.read_quality_scores)
}
 void AlignmentEntry::set_read_quality_scores(const char* value) {
  set_has_read_quality_scores();
  read_quality_scores_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.read_quality_scores)
}
 void AlignmentEntry::set_read_quality_scores(const void* value, size_t size) {
  set_has_read_quality_scores();
  read_quality_scores_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.read_quality_scores)
}
 ::std::string* AlignmentEntry::mutable_read_quality_scores() {
  set_has_read_quality_scores();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.read_quality_scores)
  return read_quality_scores_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_read_quality_scores() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.read_quality_scores)
  clear_has_read_quality_scores();
  return read_quality_scores_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_read_quality_scores(::std::string* read_quality_scores) {
  if (read_quality_scores != NULL) {
    set_has_read_quality_scores();
  } else {
    clear_has_read_quality_scores();
  }
  read_quality_scores_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), read_quality_scores);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.read_quality_scores)
}

// optional uint32 read_origin_index = 26;
bool AlignmentEntry::has_read_origin_index() const {
  return (_has_bits_[0] & 0x04000000u) != 0;
}
void AlignmentEntry::set_has_read_origin_index() {
  _has_bits_[0] |= 0x04000000u;
}
void AlignmentEntry::clear_has_read_origin_index() {
  _has_bits_[0] &= ~0x04000000u;
}
void AlignmentEntry::clear_read_origin_index() {
  read_origin_index_ = 0u;
  clear_has_read_origin_index();
}
 ::google::protobuf::uint32 AlignmentEntry::read_origin_index() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.read_origin_index)
  return read_origin_index_;
}
 void AlignmentEntry::set_read_origin_index(::google::protobuf::uint32 value) {
  set_has_read_origin_index();
  read_origin_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.read_origin_index)
}

// optional string softClippedBasesLeft = 30;
bool AlignmentEntry::has_softclippedbasesleft() const {
  return (_has_bits_[0] & 0x08000000u) != 0;
}
void AlignmentEntry::set_has_softclippedbasesleft() {
  _has_bits_[0] |= 0x08000000u;
}
void AlignmentEntry::clear_has_softclippedbasesleft() {
  _has_bits_[0] &= ~0x08000000u;
}
void AlignmentEntry::clear_softclippedbasesleft() {
  softclippedbasesleft_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_softclippedbasesleft();
}
 const ::std::string& AlignmentEntry::softclippedbasesleft() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.softClippedBasesLeft)
  return softclippedbasesleft_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_softclippedbasesleft(const ::std::string& value) {
  set_has_softclippedbasesleft();
  softclippedbasesleft_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.softClippedBasesLeft)
}
 void AlignmentEntry::set_softclippedbasesleft(const char* value) {
  set_has_softclippedbasesleft();
  softclippedbasesleft_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.softClippedBasesLeft)
}
 void AlignmentEntry::set_softclippedbasesleft(const char* value, size_t size) {
  set_has_softclippedbasesleft();
  softclippedbasesleft_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.softClippedBasesLeft)
}
 ::std::string* AlignmentEntry::mutable_softclippedbasesleft() {
  set_has_softclippedbasesleft();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.softClippedBasesLeft)
  return softclippedbasesleft_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_softclippedbasesleft() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.softClippedBasesLeft)
  clear_has_softclippedbasesleft();
  return softclippedbasesleft_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_softclippedbasesleft(::std::string* softclippedbasesleft) {
  if (softclippedbasesleft != NULL) {
    set_has_softclippedbasesleft();
  } else {
    clear_has_softclippedbasesleft();
  }
  softclippedbasesleft_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), softclippedbasesleft);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.softClippedBasesLeft)
}

// optional string softClippedBasesRight = 31;
bool AlignmentEntry::has_softclippedbasesright() const {
  return (_has_bits_[0] & 0x10000000u) != 0;
}
void AlignmentEntry::set_has_softclippedbasesright() {
  _has_bits_[0] |= 0x10000000u;
}
void AlignmentEntry::clear_has_softclippedbasesright() {
  _has_bits_[0] &= ~0x10000000u;
}
void AlignmentEntry::clear_softclippedbasesright() {
  softclippedbasesright_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_softclippedbasesright();
}
 const ::std::string& AlignmentEntry::softclippedbasesright() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.softClippedBasesRight)
  return softclippedbasesright_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_softclippedbasesright(const ::std::string& value) {
  set_has_softclippedbasesright();
  softclippedbasesright_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.softClippedBasesRight)
}
 void AlignmentEntry::set_softclippedbasesright(const char* value) {
  set_has_softclippedbasesright();
  softclippedbasesright_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.softClippedBasesRight)
}
 void AlignmentEntry::set_softclippedbasesright(const char* value, size_t size) {
  set_has_softclippedbasesright();
  softclippedbasesright_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.softClippedBasesRight)
}
 ::std::string* AlignmentEntry::mutable_softclippedbasesright() {
  set_has_softclippedbasesright();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.softClippedBasesRight)
  return softclippedbasesright_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_softclippedbasesright() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.softClippedBasesRight)
  clear_has_softclippedbasesright();
  return softclippedbasesright_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_softclippedbasesright(::std::string* softclippedbasesright) {
  if (softclippedbasesright != NULL) {
    set_has_softclippedbasesright();
  } else {
    clear_has_softclippedbasesright();
  }
  softclippedbasesright_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), softclippedbasesright);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.softClippedBasesRight)
}

// optional bytes softClippedQualityLeft = 32;
bool AlignmentEntry::has_softclippedqualityleft() const {
  return (_has_bits_[0] & 0x20000000u) != 0;
}
void AlignmentEntry::set_has_softclippedqualityleft() {
  _has_bits_[0] |= 0x20000000u;
}
void AlignmentEntry::clear_has_softclippedqualityleft() {
  _has_bits_[0] &= ~0x20000000u;
}
void AlignmentEntry::clear_softclippedqualityleft() {
  softclippedqualityleft_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_softclippedqualityleft();
}
 const ::std::string& AlignmentEntry::softclippedqualityleft() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.softClippedQualityLeft)
  return softclippedqualityleft_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_softclippedqualityleft(const ::std::string& value) {
  set_has_softclippedqualityleft();
  softclippedqualityleft_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.softClippedQualityLeft)
}
 void AlignmentEntry::set_softclippedqualityleft(const char* value) {
  set_has_softclippedqualityleft();
  softclippedqualityleft_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.softClippedQualityLeft)
}
 void AlignmentEntry::set_softclippedqualityleft(const void* value, size_t size) {
  set_has_softclippedqualityleft();
  softclippedqualityleft_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.softClippedQualityLeft)
}
 ::std::string* AlignmentEntry::mutable_softclippedqualityleft() {
  set_has_softclippedqualityleft();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.softClippedQualityLeft)
  return softclippedqualityleft_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_softclippedqualityleft() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.softClippedQualityLeft)
  clear_has_softclippedqualityleft();
  return softclippedqualityleft_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_softclippedqualityleft(::std::string* softclippedqualityleft) {
  if (softclippedqualityleft != NULL) {
    set_has_softclippedqualityleft();
  } else {
    clear_has_softclippedqualityleft();
  }
  softclippedqualityleft_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), softclippedqualityleft);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.softClippedQualityLeft)
}

// optional bytes softClippedQualityRight = 33;
bool AlignmentEntry::has_softclippedqualityright() const {
  return (_has_bits_[0] & 0x40000000u) != 0;
}
void AlignmentEntry::set_has_softclippedqualityright() {
  _has_bits_[0] |= 0x40000000u;
}
void AlignmentEntry::clear_has_softclippedqualityright() {
  _has_bits_[0] &= ~0x40000000u;
}
void AlignmentEntry::clear_softclippedqualityright() {
  softclippedqualityright_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_softclippedqualityright();
}
 const ::std::string& AlignmentEntry::softclippedqualityright() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.softClippedQualityRight)
  return softclippedqualityright_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_softclippedqualityright(const ::std::string& value) {
  set_has_softclippedqualityright();
  softclippedqualityright_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.softClippedQualityRight)
}
 void AlignmentEntry::set_softclippedqualityright(const char* value) {
  set_has_softclippedqualityright();
  softclippedqualityright_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.softClippedQualityRight)
}
 void AlignmentEntry::set_softclippedqualityright(const void* value, size_t size) {
  set_has_softclippedqualityright();
  softclippedqualityright_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.softClippedQualityRight)
}
 ::std::string* AlignmentEntry::mutable_softclippedqualityright() {
  set_has_softclippedqualityright();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.softClippedQualityRight)
  return softclippedqualityright_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_softclippedqualityright() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.softClippedQualityRight)
  clear_has_softclippedqualityright();
  return softclippedqualityright_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_softclippedqualityright(::std::string* softclippedqualityright) {
  if (softclippedqualityright != NULL) {
    set_has_softclippedqualityright();
  } else {
    clear_has_softclippedqualityright();
  }
  softclippedqualityright_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), softclippedqualityright);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.softClippedQualityRight)
}

// optional string placedUnmappedSequence = 40;
bool AlignmentEntry::has_placedunmappedsequence() const {
  return (_has_bits_[0] & 0x80000000u) != 0;
}
void AlignmentEntry::set_has_placedunmappedsequence() {
  _has_bits_[0] |= 0x80000000u;
}
void AlignmentEntry::clear_has_placedunmappedsequence() {
  _has_bits_[0] &= ~0x80000000u;
}
void AlignmentEntry::clear_placedunmappedsequence() {
  placedunmappedsequence_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_placedunmappedsequence();
}
 const ::std::string& AlignmentEntry::placedunmappedsequence() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.placedUnmappedSequence)
  return placedunmappedsequence_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_placedunmappedsequence(const ::std::string& value) {
  set_has_placedunmappedsequence();
  placedunmappedsequence_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.placedUnmappedSequence)
}
 void AlignmentEntry::set_placedunmappedsequence(const char* value) {
  set_has_placedunmappedsequence();
  placedunmappedsequence_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.placedUnmappedSequence)
}
 void AlignmentEntry::set_placedunmappedsequence(const char* value, size_t size) {
  set_has_placedunmappedsequence();
  placedunmappedsequence_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.placedUnmappedSequence)
}
 ::std::string* AlignmentEntry::mutable_placedunmappedsequence() {
  set_has_placedunmappedsequence();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.placedUnmappedSequence)
  return placedunmappedsequence_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_placedunmappedsequence() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.placedUnmappedSequence)
  clear_has_placedunmappedsequence();
  return placedunmappedsequence_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_placedunmappedsequence(::std::string* placedunmappedsequence) {
  if (placedunmappedsequence != NULL) {
    set_has_placedunmappedsequence();
  } else {
    clear_has_placedunmappedsequence();
  }
  placedunmappedsequence_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placedunmappedsequence);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.placedUnmappedSequence)
}

// optional bytes placedUnmappedQuality = 41;
bool AlignmentEntry::has_placedunmappedquality() const {
  return (_has_bits_[1] & 0x00000001u) != 0;
}
void AlignmentEntry::set_has_placedunmappedquality() {
  _has_bits_[1] |= 0x00000001u;
}
void AlignmentEntry::clear_has_placedunmappedquality() {
  _has_bits_[1] &= ~0x00000001u;
}
void AlignmentEntry::clear_placedunmappedquality() {
  placedunmappedquality_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_placedunmappedquality();
}
 const ::std::string& AlignmentEntry::placedunmappedquality() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.placedUnmappedQuality)
  return placedunmappedquality_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_placedunmappedquality(const ::std::string& value) {
  set_has_placedunmappedquality();
  placedunmappedquality_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.placedUnmappedQuality)
}
 void AlignmentEntry::set_placedunmappedquality(const char* value) {
  set_has_placedunmappedquality();
  placedunmappedquality_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.placedUnmappedQuality)
}
 void AlignmentEntry::set_placedunmappedquality(const void* value, size_t size) {
  set_has_placedunmappedquality();
  placedunmappedquality_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.placedUnmappedQuality)
}
 ::std::string* AlignmentEntry::mutable_placedunmappedquality() {
  set_has_placedunmappedquality();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.placedUnmappedQuality)
  return placedunmappedquality_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_placedunmappedquality() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.placedUnmappedQuality)
  clear_has_placedunmappedquality();
  return placedunmappedquality_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_placedunmappedquality(::std::string* placedunmappedquality) {
  if (placedunmappedquality != NULL) {
    set_has_placedunmappedquality();
  } else {
    clear_has_placedunmappedquality();
  }
  placedunmappedquality_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), placedunmappedquality);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.placedUnmappedQuality)
}

// optional string readName = 42;
bool AlignmentEntry::has_readname() const {
  return (_has_bits_[1] & 0x00000002u) != 0;
}
void AlignmentEntry::set_has_readname() {
  _has_bits_[1] |= 0x00000002u;
}
void AlignmentEntry::clear_has_readname() {
  _has_bits_[1] &= ~0x00000002u;
}
void AlignmentEntry::clear_readname() {
  readname_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_readname();
}
 const ::std::string& AlignmentEntry::readname() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentEntry.readName)
  return readname_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_readname(const ::std::string& value) {
  set_has_readname();
  readname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentEntry.readName)
}
 void AlignmentEntry::set_readname(const char* value) {
  set_has_readname();
  readname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentEntry.readName)
}
 void AlignmentEntry::set_readname(const char* value, size_t size) {
  set_has_readname();
  readname_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentEntry.readName)
}
 ::std::string* AlignmentEntry::mutable_readname() {
  set_has_readname();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentEntry.readName)
  return readname_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentEntry::release_readname() {
  // @@protoc_insertion_point(field_release:goby.AlignmentEntry.readName)
  clear_has_readname();
  return readname_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentEntry::set_allocated_readname(::std::string* readname) {
  if (readname != NULL) {
    set_has_readname();
  } else {
    clear_has_readname();
  }
  readname_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), readname);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentEntry.readName)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int RelatedAlignmentEntry::kTargetIndexFieldNumber;
const int RelatedAlignmentEntry::kPositionFieldNumber;
const int RelatedAlignmentEntry::kFragmentIndexFieldNumber;
const int RelatedAlignmentEntry::kOptimizedIndexFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

RelatedAlignmentEntry::RelatedAlignmentEntry()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.RelatedAlignmentEntry)
}

void RelatedAlignmentEntry::InitAsDefaultInstance() {
}

RelatedAlignmentEntry::RelatedAlignmentEntry(const RelatedAlignmentEntry& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.RelatedAlignmentEntry)
}

void RelatedAlignmentEntry::SharedCtor() {
  _cached_size_ = 0;
  target_index_ = 0u;
  position_ = 0u;
  fragment_index_ = 0u;
  optimized_index_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

RelatedAlignmentEntry::~RelatedAlignmentEntry() {
  // @@protoc_insertion_point(destructor:goby.RelatedAlignmentEntry)
  SharedDtor();
}

void RelatedAlignmentEntry::SharedDtor() {
  if (this != default_instance_) {
  }
}

void RelatedAlignmentEntry::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* RelatedAlignmentEntry::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return RelatedAlignmentEntry_descriptor_;
}

const RelatedAlignmentEntry& RelatedAlignmentEntry::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

RelatedAlignmentEntry* RelatedAlignmentEntry::default_instance_ = NULL;

RelatedAlignmentEntry* RelatedAlignmentEntry::New(::google::protobuf::Arena* arena) const {
  RelatedAlignmentEntry* n = new RelatedAlignmentEntry;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void RelatedAlignmentEntry::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.RelatedAlignmentEntry)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(RelatedAlignmentEntry, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<RelatedAlignmentEntry*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  ZR_(target_index_, optimized_index_);

#undef ZR_HELPER_
#undef ZR_

  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool RelatedAlignmentEntry::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.RelatedAlignmentEntry)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional uint32 target_index = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &target_index_)));
          set_has_target_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(16)) goto parse_position;
        break;
      }

      // optional uint32 position = 2;
      case 2: {
        if (tag == 16) {
         parse_position:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &position_)));
          set_has_position();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_fragment_index;
        break;
      }

      // optional uint32 fragment_index = 3;
      case 3: {
        if (tag == 24) {
         parse_fragment_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &fragment_index_)));
          set_has_fragment_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(400)) goto parse_optimized_index;
        break;
      }

      // optional uint32 optimized_index = 50;
      case 50: {
        if (tag == 400) {
         parse_optimized_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &optimized_index_)));
          set_has_optimized_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.RelatedAlignmentEntry)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.RelatedAlignmentEntry)
  return false;
#undef DO_
}

void RelatedAlignmentEntry::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.RelatedAlignmentEntry)
  // optional uint32 target_index = 1;
  if (has_target_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->target_index(), output);
  }

  // optional uint32 position = 2;
  if (has_position()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->position(), output);
  }

  // optional uint32 fragment_index = 3;
  if (has_fragment_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->fragment_index(), output);
  }

  // optional uint32 optimized_index = 50;
  if (has_optimized_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(50, this->optimized_index(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.RelatedAlignmentEntry)
}

::google::protobuf::uint8* RelatedAlignmentEntry::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.RelatedAlignmentEntry)
  // optional uint32 target_index = 1;
  if (has_target_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->target_index(), target);
  }

  // optional uint32 position = 2;
  if (has_position()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->position(), target);
  }

  // optional uint32 fragment_index = 3;
  if (has_fragment_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->fragment_index(), target);
  }

  // optional uint32 optimized_index = 50;
  if (has_optimized_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(50, this->optimized_index(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.RelatedAlignmentEntry)
  return target;
}

int RelatedAlignmentEntry::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.RelatedAlignmentEntry)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 15u) {
    // optional uint32 target_index = 1;
    if (has_target_index()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->target_index());
    }

    // optional uint32 position = 2;
    if (has_position()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->position());
    }

    // optional uint32 fragment_index = 3;
    if (has_fragment_index()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->fragment_index());
    }

    // optional uint32 optimized_index = 50;
    if (has_optimized_index()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->optimized_index());
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void RelatedAlignmentEntry::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.RelatedAlignmentEntry)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const RelatedAlignmentEntry* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const RelatedAlignmentEntry>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.RelatedAlignmentEntry)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.RelatedAlignmentEntry)
    MergeFrom(*source);
  }
}

void RelatedAlignmentEntry::MergeFrom(const RelatedAlignmentEntry& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.RelatedAlignmentEntry)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_target_index()) {
      set_target_index(from.target_index());
    }
    if (from.has_position()) {
      set_position(from.position());
    }
    if (from.has_fragment_index()) {
      set_fragment_index(from.fragment_index());
    }
    if (from.has_optimized_index()) {
      set_optimized_index(from.optimized_index());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void RelatedAlignmentEntry::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.RelatedAlignmentEntry)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void RelatedAlignmentEntry::CopyFrom(const RelatedAlignmentEntry& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.RelatedAlignmentEntry)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool RelatedAlignmentEntry::IsInitialized() const {

  return true;
}

void RelatedAlignmentEntry::Swap(RelatedAlignmentEntry* other) {
  if (other == this) return;
  InternalSwap(other);
}
void RelatedAlignmentEntry::InternalSwap(RelatedAlignmentEntry* other) {
  std::swap(target_index_, other->target_index_);
  std::swap(position_, other->position_);
  std::swap(fragment_index_, other->fragment_index_);
  std::swap(optimized_index_, other->optimized_index_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata RelatedAlignmentEntry::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = RelatedAlignmentEntry_descriptor_;
  metadata.reflection = RelatedAlignmentEntry_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// RelatedAlignmentEntry

// optional uint32 target_index = 1;
bool RelatedAlignmentEntry::has_target_index() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void RelatedAlignmentEntry::set_has_target_index() {
  _has_bits_[0] |= 0x00000001u;
}
void RelatedAlignmentEntry::clear_has_target_index() {
  _has_bits_[0] &= ~0x00000001u;
}
void RelatedAlignmentEntry::clear_target_index() {
  target_index_ = 0u;
  clear_has_target_index();
}
 ::google::protobuf::uint32 RelatedAlignmentEntry::target_index() const {
  // @@protoc_insertion_point(field_get:goby.RelatedAlignmentEntry.target_index)
  return target_index_;
}
 void RelatedAlignmentEntry::set_target_index(::google::protobuf::uint32 value) {
  set_has_target_index();
  target_index_ = value;
  // @@protoc_insertion_point(field_set:goby.RelatedAlignmentEntry.target_index)
}

// optional uint32 position = 2;
bool RelatedAlignmentEntry::has_position() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void RelatedAlignmentEntry::set_has_position() {
  _has_bits_[0] |= 0x00000002u;
}
void RelatedAlignmentEntry::clear_has_position() {
  _has_bits_[0] &= ~0x00000002u;
}
void RelatedAlignmentEntry::clear_position() {
  position_ = 0u;
  clear_has_position();
}
 ::google::protobuf::uint32 RelatedAlignmentEntry::position() const {
  // @@protoc_insertion_point(field_get:goby.RelatedAlignmentEntry.position)
  return position_;
}
 void RelatedAlignmentEntry::set_position(::google::protobuf::uint32 value) {
  set_has_position();
  position_ = value;
  // @@protoc_insertion_point(field_set:goby.RelatedAlignmentEntry.position)
}

// optional uint32 fragment_index = 3;
bool RelatedAlignmentEntry::has_fragment_index() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void RelatedAlignmentEntry::set_has_fragment_index() {
  _has_bits_[0] |= 0x00000004u;
}
void RelatedAlignmentEntry::clear_has_fragment_index() {
  _has_bits_[0] &= ~0x00000004u;
}
void RelatedAlignmentEntry::clear_fragment_index() {
  fragment_index_ = 0u;
  clear_has_fragment_index();
}
 ::google::protobuf::uint32 RelatedAlignmentEntry::fragment_index() const {
  // @@protoc_insertion_point(field_get:goby.RelatedAlignmentEntry.fragment_index)
  return fragment_index_;
}
 void RelatedAlignmentEntry::set_fragment_index(::google::protobuf::uint32 value) {
  set_has_fragment_index();
  fragment_index_ = value;
  // @@protoc_insertion_point(field_set:goby.RelatedAlignmentEntry.fragment_index)
}

// optional uint32 optimized_index = 50;
bool RelatedAlignmentEntry::has_optimized_index() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void RelatedAlignmentEntry::set_has_optimized_index() {
  _has_bits_[0] |= 0x00000008u;
}
void RelatedAlignmentEntry::clear_has_optimized_index() {
  _has_bits_[0] &= ~0x00000008u;
}
void RelatedAlignmentEntry::clear_optimized_index() {
  optimized_index_ = 0u;
  clear_has_optimized_index();
}
 ::google::protobuf::uint32 RelatedAlignmentEntry::optimized_index() const {
  // @@protoc_insertion_point(field_get:goby.RelatedAlignmentEntry.optimized_index)
  return optimized_index_;
}
 void RelatedAlignmentEntry::set_optimized_index(::google::protobuf::uint32 value) {
  set_has_optimized_index();
  optimized_index_ = value;
  // @@protoc_insertion_point(field_set:goby.RelatedAlignmentEntry.optimized_index)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int SequenceVariation::kFromFieldNumber;
const int SequenceVariation::kToFieldNumber;
const int SequenceVariation::kPositionFieldNumber;
const int SequenceVariation::kReadIndexFieldNumber;
const int SequenceVariation::kToQualityFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

SequenceVariation::SequenceVariation()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.SequenceVariation)
}

void SequenceVariation::InitAsDefaultInstance() {
}

SequenceVariation::SequenceVariation(const SequenceVariation& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.SequenceVariation)
}

void SequenceVariation::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  from_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  to_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  position_ = 0u;
  read_index_ = 0u;
  to_quality_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

SequenceVariation::~SequenceVariation() {
  // @@protoc_insertion_point(destructor:goby.SequenceVariation)
  SharedDtor();
}

void SequenceVariation::SharedDtor() {
  from_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  to_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  to_quality_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
  }
}

void SequenceVariation::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* SequenceVariation::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return SequenceVariation_descriptor_;
}

const SequenceVariation& SequenceVariation::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

SequenceVariation* SequenceVariation::default_instance_ = NULL;

SequenceVariation* SequenceVariation::New(::google::protobuf::Arena* arena) const {
  SequenceVariation* n = new SequenceVariation;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void SequenceVariation::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.SequenceVariation)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(SequenceVariation, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<SequenceVariation*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  if (_has_bits_[0 / 32] & 31u) {
    ZR_(position_, read_index_);
    if (has_from()) {
      from_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_to()) {
      to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_to_quality()) {
      to_quality_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }

#undef ZR_HELPER_
#undef ZR_

  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool SequenceVariation::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.SequenceVariation)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional string to = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_to()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->to().data(), this->to().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.SequenceVariation.to");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_from;
        break;
      }

      // optional string from = 2;
      case 2: {
        if (tag == 18) {
         parse_from:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_from()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->from().data(), this->from().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.SequenceVariation.from");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_position;
        break;
      }

      // optional uint32 position = 3;
      case 3: {
        if (tag == 24) {
         parse_position:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &position_)));
          set_has_position();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_to_quality;
        break;
      }

      // optional bytes to_quality = 4;
      case 4: {
        if (tag == 34) {
         parse_to_quality:
          DO_(::google::protobuf::internal::WireFormatLite::ReadBytes(
                input, this->mutable_to_quality()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(40)) goto parse_read_index;
        break;
      }

      // optional uint32 read_index = 5;
      case 5: {
        if (tag == 40) {
         parse_read_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &read_index_)));
          set_has_read_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.SequenceVariation)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.SequenceVariation)
  return false;
#undef DO_
}

void SequenceVariation::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.SequenceVariation)
  // optional string to = 1;
  if (has_to()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->to().data(), this->to().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.SequenceVariation.to");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->to(), output);
  }

  // optional string from = 2;
  if (has_from()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->from().data(), this->from().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.SequenceVariation.from");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->from(), output);
  }

  // optional uint32 position = 3;
  if (has_position()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->position(), output);
  }

  // optional bytes to_quality = 4;
  if (has_to_quality()) {
    ::google::protobuf::internal::WireFormatLite::WriteBytesMaybeAliased(
      4, this->to_quality(), output);
  }

  // optional uint32 read_index = 5;
  if (has_read_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->read_index(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.SequenceVariation)
}

::google::protobuf::uint8* SequenceVariation::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.SequenceVariation)
  // optional string to = 1;
  if (has_to()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->to().data(), this->to().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.SequenceVariation.to");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->to(), target);
  }

  // optional string from = 2;
  if (has_from()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->from().data(), this->from().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.SequenceVariation.from");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->from(), target);
  }

  // optional uint32 position = 3;
  if (has_position()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->position(), target);
  }

  // optional bytes to_quality = 4;
  if (has_to_quality()) {
    target =
      ::google::protobuf::internal::WireFormatLite::WriteBytesToArray(
        4, this->to_quality(), target);
  }

  // optional uint32 read_index = 5;
  if (has_read_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->read_index(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.SequenceVariation)
  return target;
}

int SequenceVariation::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.SequenceVariation)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 31u) {
    // optional string from = 2;
    if (has_from()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->from());
    }

    // optional string to = 1;
    if (has_to()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->to());
    }

    // optional uint32 position = 3;
    if (has_position()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->position());
    }

    // optional uint32 read_index = 5;
    if (has_read_index()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->read_index());
    }

    // optional bytes to_quality = 4;
    if (has_to_quality()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::BytesSize(
          this->to_quality());
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void SequenceVariation::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.SequenceVariation)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const SequenceVariation* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const SequenceVariation>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.SequenceVariation)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.SequenceVariation)
    MergeFrom(*source);
  }
}

void SequenceVariation::MergeFrom(const SequenceVariation& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.SequenceVariation)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_from()) {
      set_has_from();
      from_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.from_);
    }
    if (from.has_to()) {
      set_has_to();
      to_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.to_);
    }
    if (from.has_position()) {
      set_position(from.position());
    }
    if (from.has_read_index()) {
      set_read_index(from.read_index());
    }
    if (from.has_to_quality()) {
      set_has_to_quality();
      to_quality_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.to_quality_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void SequenceVariation::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.SequenceVariation)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void SequenceVariation::CopyFrom(const SequenceVariation& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.SequenceVariation)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool SequenceVariation::IsInitialized() const {

  return true;
}

void SequenceVariation::Swap(SequenceVariation* other) {
  if (other == this) return;
  InternalSwap(other);
}
void SequenceVariation::InternalSwap(SequenceVariation* other) {
  from_.Swap(&other->from_);
  to_.Swap(&other->to_);
  std::swap(position_, other->position_);
  std::swap(read_index_, other->read_index_);
  to_quality_.Swap(&other->to_quality_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata SequenceVariation::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = SequenceVariation_descriptor_;
  metadata.reflection = SequenceVariation_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// SequenceVariation

// optional string from = 2;
bool SequenceVariation::has_from() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void SequenceVariation::set_has_from() {
  _has_bits_[0] |= 0x00000001u;
}
void SequenceVariation::clear_has_from() {
  _has_bits_[0] &= ~0x00000001u;
}
void SequenceVariation::clear_from() {
  from_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_from();
}
 const ::std::string& SequenceVariation::from() const {
  // @@protoc_insertion_point(field_get:goby.SequenceVariation.from)
  return from_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void SequenceVariation::set_from(const ::std::string& value) {
  set_has_from();
  from_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.SequenceVariation.from)
}
 void SequenceVariation::set_from(const char* value) {
  set_has_from();
  from_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.SequenceVariation.from)
}
 void SequenceVariation::set_from(const char* value, size_t size) {
  set_has_from();
  from_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.SequenceVariation.from)
}
 ::std::string* SequenceVariation::mutable_from() {
  set_has_from();
  // @@protoc_insertion_point(field_mutable:goby.SequenceVariation.from)
  return from_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* SequenceVariation::release_from() {
  // @@protoc_insertion_point(field_release:goby.SequenceVariation.from)
  clear_has_from();
  return from_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void SequenceVariation::set_allocated_from(::std::string* from) {
  if (from != NULL) {
    set_has_from();
  } else {
    clear_has_from();
  }
  from_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from);
  // @@protoc_insertion_point(field_set_allocated:goby.SequenceVariation.from)
}

// optional string to = 1;
bool SequenceVariation::has_to() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void SequenceVariation::set_has_to() {
  _has_bits_[0] |= 0x00000002u;
}
void SequenceVariation::clear_has_to() {
  _has_bits_[0] &= ~0x00000002u;
}
void SequenceVariation::clear_to() {
  to_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_to();
}
 const ::std::string& SequenceVariation::to() const {
  // @@protoc_insertion_point(field_get:goby.SequenceVariation.to)
  return to_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void SequenceVariation::set_to(const ::std::string& value) {
  set_has_to();
  to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.SequenceVariation.to)
}
 void SequenceVariation::set_to(const char* value) {
  set_has_to();
  to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.SequenceVariation.to)
}
 void SequenceVariation::set_to(const char* value, size_t size) {
  set_has_to();
  to_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.SequenceVariation.to)
}
 ::std::string* SequenceVariation::mutable_to() {
  set_has_to();
  // @@protoc_insertion_point(field_mutable:goby.SequenceVariation.to)
  return to_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* SequenceVariation::release_to() {
  // @@protoc_insertion_point(field_release:goby.SequenceVariation.to)
  clear_has_to();
  return to_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void SequenceVariation::set_allocated_to(::std::string* to) {
  if (to != NULL) {
    set_has_to();
  } else {
    clear_has_to();
  }
  to_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), to);
  // @@protoc_insertion_point(field_set_allocated:goby.SequenceVariation.to)
}

// optional uint32 position = 3;
bool SequenceVariation::has_position() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void SequenceVariation::set_has_position() {
  _has_bits_[0] |= 0x00000004u;
}
void SequenceVariation::clear_has_position() {
  _has_bits_[0] &= ~0x00000004u;
}
void SequenceVariation::clear_position() {
  position_ = 0u;
  clear_has_position();
}
 ::google::protobuf::uint32 SequenceVariation::position() const {
  // @@protoc_insertion_point(field_get:goby.SequenceVariation.position)
  return position_;
}
 void SequenceVariation::set_position(::google::protobuf::uint32 value) {
  set_has_position();
  position_ = value;
  // @@protoc_insertion_point(field_set:goby.SequenceVariation.position)
}

// optional uint32 read_index = 5;
bool SequenceVariation::has_read_index() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void SequenceVariation::set_has_read_index() {
  _has_bits_[0] |= 0x00000008u;
}
void SequenceVariation::clear_has_read_index() {
  _has_bits_[0] &= ~0x00000008u;
}
void SequenceVariation::clear_read_index() {
  read_index_ = 0u;
  clear_has_read_index();
}
 ::google::protobuf::uint32 SequenceVariation::read_index() const {
  // @@protoc_insertion_point(field_get:goby.SequenceVariation.read_index)
  return read_index_;
}
 void SequenceVariation::set_read_index(::google::protobuf::uint32 value) {
  set_has_read_index();
  read_index_ = value;
  // @@protoc_insertion_point(field_set:goby.SequenceVariation.read_index)
}

// optional bytes to_quality = 4;
bool SequenceVariation::has_to_quality() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void SequenceVariation::set_has_to_quality() {
  _has_bits_[0] |= 0x00000010u;
}
void SequenceVariation::clear_has_to_quality() {
  _has_bits_[0] &= ~0x00000010u;
}
void SequenceVariation::clear_to_quality() {
  to_quality_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_to_quality();
}
 const ::std::string& SequenceVariation::to_quality() const {
  // @@protoc_insertion_point(field_get:goby.SequenceVariation.to_quality)
  return to_quality_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void SequenceVariation::set_to_quality(const ::std::string& value) {
  set_has_to_quality();
  to_quality_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.SequenceVariation.to_quality)
}
 void SequenceVariation::set_to_quality(const char* value) {
  set_has_to_quality();
  to_quality_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.SequenceVariation.to_quality)
}
 void SequenceVariation::set_to_quality(const void* value, size_t size) {
  set_has_to_quality();
  to_quality_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.SequenceVariation.to_quality)
}
 ::std::string* SequenceVariation::mutable_to_quality() {
  set_has_to_quality();
  // @@protoc_insertion_point(field_mutable:goby.SequenceVariation.to_quality)
  return to_quality_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* SequenceVariation::release_to_quality() {
  // @@protoc_insertion_point(field_release:goby.SequenceVariation.to_quality)
  clear_has_to_quality();
  return to_quality_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void SequenceVariation::set_allocated_to_quality(::std::string* to_quality) {
  if (to_quality != NULL) {
    set_has_to_quality();
  } else {
    clear_has_to_quality();
  }
  to_quality_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), to_quality);
  // @@protoc_insertion_point(field_set_allocated:goby.SequenceVariation.to_quality)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int AlignmentHeader::kSmallestSplitQueryIndexFieldNumber;
const int AlignmentHeader::kLargestSplitQueryIndexFieldNumber;
const int AlignmentHeader::kQueryNameMappingFieldNumber;
const int AlignmentHeader::kTargetNameMappingFieldNumber;
const int AlignmentHeader::kNumberOfQueriesFieldNumber;
const int AlignmentHeader::kNumberOfTargetsFieldNumber;
const int AlignmentHeader::kNumberOfAlignedReadsFieldNumber;
const int AlignmentHeader::kQueryLengthFieldNumber;
const int AlignmentHeader::kConstantQueryLengthFieldNumber;
const int AlignmentHeader::kTargetLengthFieldNumber;
const int AlignmentHeader::kSortedFieldNumber;
const int AlignmentHeader::kIndexedFieldNumber;
const int AlignmentHeader::kQueryLengthsStoredInEntriesFieldNumber;
const int AlignmentHeader::kAlignerNameFieldNumber;
const int AlignmentHeader::kAlignerVersionFieldNumber;
const int AlignmentHeader::kVersionFieldNumber;
const int AlignmentHeader::kSampleBasenameFieldNumber;
const int AlignmentHeader::kQueryIndicesWerePermutedFieldNumber;
const int AlignmentHeader::kQueryIndexOccurrencesFieldNumber;
const int AlignmentHeader::kAmbiguityStoredInEntriesFieldNumber;
const int AlignmentHeader::kAllReadQualityScoresFieldNumber;
const int AlignmentHeader::kReadOriginFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

AlignmentHeader::AlignmentHeader()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.AlignmentHeader)
}

void AlignmentHeader::InitAsDefaultInstance() {
  query_name_mapping_ = const_cast< ::goby::IdentifierMapping*>(&::goby::IdentifierMapping::default_instance());
  target_name_mapping_ = const_cast< ::goby::IdentifierMapping*>(&::goby::IdentifierMapping::default_instance());
}

AlignmentHeader::AlignmentHeader(const AlignmentHeader& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.AlignmentHeader)
}

void AlignmentHeader::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  smallest_split_query_index_ = 0u;
  largest_split_query_index_ = 0u;
  query_name_mapping_ = NULL;
  target_name_mapping_ = NULL;
  number_of_queries_ = 0u;
  number_of_targets_ = 0u;
  number_of_aligned_reads_ = 0u;
  constant_query_length_ = 0u;
  sorted_ = false;
  indexed_ = false;
  query_lengths_stored_in_entries_ = false;
  aligner_name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  aligner_version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  version_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  query_indices_were_permuted_ = false;
  query_index_occurrences_ = false;
  ambiguity_stored_in_entries_ = false;
  all_read_quality_scores_ = false;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AlignmentHeader::~AlignmentHeader() {
  // @@protoc_insertion_point(destructor:goby.AlignmentHeader)
  SharedDtor();
}

void AlignmentHeader::SharedDtor() {
  aligner_name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  aligner_version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  version_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
    delete query_name_mapping_;
    delete target_name_mapping_;
  }
}

void AlignmentHeader::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AlignmentHeader::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AlignmentHeader_descriptor_;
}

const AlignmentHeader& AlignmentHeader::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

AlignmentHeader* AlignmentHeader::default_instance_ = NULL;

AlignmentHeader* AlignmentHeader::New(::google::protobuf::Arena* arena) const {
  AlignmentHeader* n = new AlignmentHeader;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void AlignmentHeader::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.AlignmentHeader)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(AlignmentHeader, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<AlignmentHeader*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  if (_has_bits_[0 / 32] & 127u) {
    ZR_(smallest_split_query_index_, largest_split_query_index_);
    ZR_(number_of_queries_, number_of_targets_);
    if (has_query_name_mapping()) {
      if (query_name_mapping_ != NULL) query_name_mapping_->::goby::IdentifierMapping::Clear();
    }
    if (has_target_name_mapping()) {
      if (target_name_mapping_ != NULL) target_name_mapping_->::goby::IdentifierMapping::Clear();
    }
    number_of_aligned_reads_ = 0u;
  }
  if (_has_bits_[8 / 32] & 64768u) {
    ZR_(sorted_, query_lengths_stored_in_entries_);
    constant_query_length_ = 0u;
    if (has_aligner_name()) {
      aligner_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_aligner_version()) {
      aligner_version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_version()) {
      version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ZR_(query_indices_were_permuted_, all_read_quality_scores_);

#undef ZR_HELPER_
#undef ZR_

  query_length_.Clear();
  target_length_.Clear();
  sample_basename_.Clear();
  read_origin_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool AlignmentHeader::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.AlignmentHeader)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(16383);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // optional .goby.IdentifierMapping query_name_mapping = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_query_name_mapping()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_target_name_mapping;
        break;
      }

      // optional .goby.IdentifierMapping target_name_mapping = 2;
      case 2: {
        if (tag == 18) {
         parse_target_name_mapping:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
               input, mutable_target_name_mapping()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_query_length;
        break;
      }

      // repeated uint32 query_length = 3 [deprecated = true];
      case 3: {
        if (tag == 24) {
         parse_query_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 24, input, this->mutable_query_length())));
        } else if (tag == 26) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_query_length())));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_query_length;
        if (input->ExpectTag(40)) goto parse_number_of_queries;
        break;
      }

      // optional uint32 number_of_queries = 5;
      case 5: {
        if (tag == 40) {
         parse_number_of_queries:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &number_of_queries_)));
          set_has_number_of_queries();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(48)) goto parse_number_of_targets;
        break;
      }

      // optional uint32 number_of_targets = 6;
      case 6: {
        if (tag == 48) {
         parse_number_of_targets:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &number_of_targets_)));
          set_has_number_of_targets();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(56)) goto parse_number_of_aligned_reads;
        break;
      }

      // optional uint32 number_of_aligned_reads = 7;
      case 7: {
        if (tag == 56) {
         parse_number_of_aligned_reads:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &number_of_aligned_reads_)));
          set_has_number_of_aligned_reads();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(64)) goto parse_target_length;
        break;
      }

      // repeated uint32 target_length = 8;
      case 8: {
        if (tag == 64) {
         parse_target_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 64, input, this->mutable_target_length())));
        } else if (tag == 66) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_target_length())));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(64)) goto parse_target_length;
        if (input->ExpectTag(72)) goto parse_smallest_split_query_index;
        break;
      }

      // optional uint32 smallest_split_query_index = 9;
      case 9: {
        if (tag == 72) {
         parse_smallest_split_query_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &smallest_split_query_index_)));
          set_has_smallest_split_query_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(80)) goto parse_constant_query_length;
        break;
      }

      // optional uint32 constant_query_length = 10;
      case 10: {
        if (tag == 80) {
         parse_constant_query_length:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &constant_query_length_)));
          set_has_constant_query_length();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(88)) goto parse_largest_split_query_index;
        break;
      }

      // optional uint32 largest_split_query_index = 11;
      case 11: {
        if (tag == 88) {
         parse_largest_split_query_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &largest_split_query_index_)));
          set_has_largest_split_query_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(104)) goto parse_sorted;
        break;
      }

      // optional bool sorted = 13;
      case 13: {
        if (tag == 104) {
         parse_sorted:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &sorted_)));
          set_has_sorted();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(112)) goto parse_indexed;
        break;
      }

      // optional bool indexed = 14;
      case 14: {
        if (tag == 112) {
         parse_indexed:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &indexed_)));
          set_has_indexed();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(120)) goto parse_query_lengths_stored_in_entries;
        break;
      }

      // optional bool query_lengths_stored_in_entries = 15;
      case 15: {
        if (tag == 120) {
         parse_query_lengths_stored_in_entries:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &query_lengths_stored_in_entries_)));
          set_has_query_lengths_stored_in_entries();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(138)) goto parse_aligner_name;
        break;
      }

      // optional string aligner_name = 17;
      case 17: {
        if (tag == 138) {
         parse_aligner_name:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_aligner_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->aligner_name().data(), this->aligner_name().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentHeader.aligner_name");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(146)) goto parse_aligner_version;
        break;
      }

      // optional string aligner_version = 18;
      case 18: {
        if (tag == 146) {
         parse_aligner_version:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_aligner_version()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->aligner_version().data(), this->aligner_version().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentHeader.aligner_version");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(202)) goto parse_version;
        break;
      }

      // optional string version = 25;
      case 25: {
        if (tag == 202) {
         parse_version:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_version()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->version().data(), this->version().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentHeader.version");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(208)) goto parse_query_indices_were_permuted;
        break;
      }

      // optional bool query_indices_were_permuted = 26;
      case 26: {
        if (tag == 208) {
         parse_query_indices_were_permuted:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &query_indices_were_permuted_)));
          set_has_query_indices_were_permuted();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(218)) goto parse_read_origin;
        break;
      }

      // repeated .goby.ReadOriginInfo read_origin = 27;
      case 27: {
        if (tag == 218) {
         parse_read_origin:
          DO_(input->IncrementRecursionDepth());
         parse_loop_read_origin:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_read_origin()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(218)) goto parse_loop_read_origin;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectTag(242)) goto parse_sample_basename;
        break;
      }

      // repeated string sample_basename = 30;
      case 30: {
        if (tag == 242) {
         parse_sample_basename:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->add_sample_basename()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->sample_basename(this->sample_basename_size() - 1).data(),
            this->sample_basename(this->sample_basename_size() - 1).length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.AlignmentHeader.sample_basename");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(242)) goto parse_sample_basename;
        if (input->ExpectTag(280)) goto parse_query_index_occurrences;
        break;
      }

      // optional bool query_index_occurrences = 35;
      case 35: {
        if (tag == 280) {
         parse_query_index_occurrences:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &query_index_occurrences_)));
          set_has_query_index_occurrences();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(288)) goto parse_ambiguity_stored_in_entries;
        break;
      }

      // optional bool ambiguity_stored_in_entries = 36;
      case 36: {
        if (tag == 288) {
         parse_ambiguity_stored_in_entries:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &ambiguity_stored_in_entries_)));
          set_has_ambiguity_stored_in_entries();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(320)) goto parse_all_read_quality_scores;
        break;
      }

      // optional bool all_read_quality_scores = 40;
      case 40: {
        if (tag == 320) {
         parse_all_read_quality_scores:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>(
                 input, &all_read_quality_scores_)));
          set_has_all_read_quality_scores();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.AlignmentHeader)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.AlignmentHeader)
  return false;
#undef DO_
}

void AlignmentHeader::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.AlignmentHeader)
  // optional .goby.IdentifierMapping query_name_mapping = 1;
  if (has_query_name_mapping()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, *this->query_name_mapping_, output);
  }

  // optional .goby.IdentifierMapping target_name_mapping = 2;
  if (has_target_name_mapping()) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      2, *this->target_name_mapping_, output);
  }

  // repeated uint32 query_length = 3 [deprecated = true];
  for (int i = 0; i < this->query_length_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
      3, this->query_length(i), output);
  }

  // optional uint32 number_of_queries = 5;
  if (has_number_of_queries()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(5, this->number_of_queries(), output);
  }

  // optional uint32 number_of_targets = 6;
  if (has_number_of_targets()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(6, this->number_of_targets(), output);
  }

  // optional uint32 number_of_aligned_reads = 7;
  if (has_number_of_aligned_reads()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(7, this->number_of_aligned_reads(), output);
  }

  // repeated uint32 target_length = 8;
  for (int i = 0; i < this->target_length_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(
      8, this->target_length(i), output);
  }

  // optional uint32 smallest_split_query_index = 9;
  if (has_smallest_split_query_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(9, this->smallest_split_query_index(), output);
  }

  // optional uint32 constant_query_length = 10;
  if (has_constant_query_length()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(10, this->constant_query_length(), output);
  }

  // optional uint32 largest_split_query_index = 11;
  if (has_largest_split_query_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(11, this->largest_split_query_index(), output);
  }

  // optional bool sorted = 13;
  if (has_sorted()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(13, this->sorted(), output);
  }

  // optional bool indexed = 14;
  if (has_indexed()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(14, this->indexed(), output);
  }

  // optional bool query_lengths_stored_in_entries = 15;
  if (has_query_lengths_stored_in_entries()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(15, this->query_lengths_stored_in_entries(), output);
  }

  // optional string aligner_name = 17;
  if (has_aligner_name()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->aligner_name().data(), this->aligner_name().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.aligner_name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      17, this->aligner_name(), output);
  }

  // optional string aligner_version = 18;
  if (has_aligner_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->aligner_version().data(), this->aligner_version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.aligner_version");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      18, this->aligner_version(), output);
  }

  // optional string version = 25;
  if (has_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->version().data(), this->version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.version");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      25, this->version(), output);
  }

  // optional bool query_indices_were_permuted = 26;
  if (has_query_indices_were_permuted()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(26, this->query_indices_were_permuted(), output);
  }

  // repeated .goby.ReadOriginInfo read_origin = 27;
  for (unsigned int i = 0, n = this->read_origin_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      27, this->read_origin(i), output);
  }

  // repeated string sample_basename = 30;
  for (int i = 0; i < this->sample_basename_size(); i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->sample_basename(i).data(), this->sample_basename(i).length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.sample_basename");
    ::google::protobuf::internal::WireFormatLite::WriteString(
      30, this->sample_basename(i), output);
  }

  // optional bool query_index_occurrences = 35;
  if (has_query_index_occurrences()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(35, this->query_index_occurrences(), output);
  }

  // optional bool ambiguity_stored_in_entries = 36;
  if (has_ambiguity_stored_in_entries()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(36, this->ambiguity_stored_in_entries(), output);
  }

  // optional bool all_read_quality_scores = 40;
  if (has_all_read_quality_scores()) {
    ::google::protobuf::internal::WireFormatLite::WriteBool(40, this->all_read_quality_scores(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.AlignmentHeader)
}

::google::protobuf::uint8* AlignmentHeader::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.AlignmentHeader)
  // optional .goby.IdentifierMapping query_name_mapping = 1;
  if (has_query_name_mapping()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        1, *this->query_name_mapping_, false, target);
  }

  // optional .goby.IdentifierMapping target_name_mapping = 2;
  if (has_target_name_mapping()) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        2, *this->target_name_mapping_, false, target);
  }

  // repeated uint32 query_length = 3 [deprecated = true];
  for (int i = 0; i < this->query_length_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteUInt32ToArray(3, this->query_length(i), target);
  }

  // optional uint32 number_of_queries = 5;
  if (has_number_of_queries()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(5, this->number_of_queries(), target);
  }

  // optional uint32 number_of_targets = 6;
  if (has_number_of_targets()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(6, this->number_of_targets(), target);
  }

  // optional uint32 number_of_aligned_reads = 7;
  if (has_number_of_aligned_reads()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(7, this->number_of_aligned_reads(), target);
  }

  // repeated uint32 target_length = 8;
  for (int i = 0; i < this->target_length_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteUInt32ToArray(8, this->target_length(i), target);
  }

  // optional uint32 smallest_split_query_index = 9;
  if (has_smallest_split_query_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(9, this->smallest_split_query_index(), target);
  }

  // optional uint32 constant_query_length = 10;
  if (has_constant_query_length()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(10, this->constant_query_length(), target);
  }

  // optional uint32 largest_split_query_index = 11;
  if (has_largest_split_query_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(11, this->largest_split_query_index(), target);
  }

  // optional bool sorted = 13;
  if (has_sorted()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(13, this->sorted(), target);
  }

  // optional bool indexed = 14;
  if (has_indexed()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(14, this->indexed(), target);
  }

  // optional bool query_lengths_stored_in_entries = 15;
  if (has_query_lengths_stored_in_entries()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(15, this->query_lengths_stored_in_entries(), target);
  }

  // optional string aligner_name = 17;
  if (has_aligner_name()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->aligner_name().data(), this->aligner_name().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.aligner_name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        17, this->aligner_name(), target);
  }

  // optional string aligner_version = 18;
  if (has_aligner_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->aligner_version().data(), this->aligner_version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.aligner_version");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        18, this->aligner_version(), target);
  }

  // optional string version = 25;
  if (has_version()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->version().data(), this->version().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.version");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        25, this->version(), target);
  }

  // optional bool query_indices_were_permuted = 26;
  if (has_query_indices_were_permuted()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(26, this->query_indices_were_permuted(), target);
  }

  // repeated .goby.ReadOriginInfo read_origin = 27;
  for (unsigned int i = 0, n = this->read_origin_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        27, this->read_origin(i), false, target);
  }

  // repeated string sample_basename = 30;
  for (int i = 0; i < this->sample_basename_size(); i++) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->sample_basename(i).data(), this->sample_basename(i).length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.AlignmentHeader.sample_basename");
    target = ::google::protobuf::internal::WireFormatLite::
      WriteStringToArray(30, this->sample_basename(i), target);
  }

  // optional bool query_index_occurrences = 35;
  if (has_query_index_occurrences()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(35, this->query_index_occurrences(), target);
  }

  // optional bool ambiguity_stored_in_entries = 36;
  if (has_ambiguity_stored_in_entries()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(36, this->ambiguity_stored_in_entries(), target);
  }

  // optional bool all_read_quality_scores = 40;
  if (has_all_read_quality_scores()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteBoolToArray(40, this->all_read_quality_scores(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.AlignmentHeader)
  return target;
}

int AlignmentHeader::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.AlignmentHeader)
  int total_size = 0;

  if (_has_bits_[0 / 32] & 127u) {
    // optional uint32 smallest_split_query_index = 9;
    if (has_smallest_split_query_index()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->smallest_split_query_index());
    }

    // optional uint32 largest_split_query_index = 11;
    if (has_largest_split_query_index()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->largest_split_query_index());
    }

    // optional .goby.IdentifierMapping query_name_mapping = 1;
    if (has_query_name_mapping()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->query_name_mapping_);
    }

    // optional .goby.IdentifierMapping target_name_mapping = 2;
    if (has_target_name_mapping()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
          *this->target_name_mapping_);
    }

    // optional uint32 number_of_queries = 5;
    if (has_number_of_queries()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->number_of_queries());
    }

    // optional uint32 number_of_targets = 6;
    if (has_number_of_targets()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->number_of_targets());
    }

    // optional uint32 number_of_aligned_reads = 7;
    if (has_number_of_aligned_reads()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->number_of_aligned_reads());
    }

  }
  if (_has_bits_[8 / 32] & 64768u) {
    // optional uint32 constant_query_length = 10;
    if (has_constant_query_length()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::UInt32Size(
          this->constant_query_length());
    }

    // optional bool sorted = 13;
    if (has_sorted()) {
      total_size += 1 + 1;
    }

    // optional bool indexed = 14;
    if (has_indexed()) {
      total_size += 1 + 1;
    }

    // optional bool query_lengths_stored_in_entries = 15;
    if (has_query_lengths_stored_in_entries()) {
      total_size += 1 + 1;
    }

    // optional string aligner_name = 17;
    if (has_aligner_name()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->aligner_name());
    }

    // optional string aligner_version = 18;
    if (has_aligner_version()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->aligner_version());
    }

    // optional string version = 25;
    if (has_version()) {
      total_size += 2 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->version());
    }

  }
  if (_has_bits_[17 / 32] & 1966080u) {
    // optional bool query_indices_were_permuted = 26;
    if (has_query_indices_were_permuted()) {
      total_size += 2 + 1;
    }

    // optional bool query_index_occurrences = 35;
    if (has_query_index_occurrences()) {
      total_size += 2 + 1;
    }

    // optional bool ambiguity_stored_in_entries = 36;
    if (has_ambiguity_stored_in_entries()) {
      total_size += 2 + 1;
    }

    // optional bool all_read_quality_scores = 40;
    if (has_all_read_quality_scores()) {
      total_size += 2 + 1;
    }

  }
  // repeated uint32 query_length = 3 [deprecated = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->query_length_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->query_length(i));
    }
    total_size += 1 * this->query_length_size() + data_size;
  }

  // repeated uint32 target_length = 8;
  {
    int data_size = 0;
    for (int i = 0; i < this->target_length_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->target_length(i));
    }
    total_size += 1 * this->target_length_size() + data_size;
  }

  // repeated string sample_basename = 30;
  total_size += 2 * this->sample_basename_size();
  for (int i = 0; i < this->sample_basename_size(); i++) {
    total_size += ::google::protobuf::internal::WireFormatLite::StringSize(
      this->sample_basename(i));
  }

  // repeated .goby.ReadOriginInfo read_origin = 27;
  total_size += 2 * this->read_origin_size();
  for (int i = 0; i < this->read_origin_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->read_origin(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AlignmentHeader::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.AlignmentHeader)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const AlignmentHeader* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const AlignmentHeader>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.AlignmentHeader)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.AlignmentHeader)
    MergeFrom(*source);
  }
}

void AlignmentHeader::MergeFrom(const AlignmentHeader& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.AlignmentHeader)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  query_length_.MergeFrom(from.query_length_);
  target_length_.MergeFrom(from.target_length_);
  sample_basename_.MergeFrom(from.sample_basename_);
  read_origin_.MergeFrom(from.read_origin_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_smallest_split_query_index()) {
      set_smallest_split_query_index(from.smallest_split_query_index());
    }
    if (from.has_largest_split_query_index()) {
      set_largest_split_query_index(from.largest_split_query_index());
    }
    if (from.has_query_name_mapping()) {
      mutable_query_name_mapping()->::goby::IdentifierMapping::MergeFrom(from.query_name_mapping());
    }
    if (from.has_target_name_mapping()) {
      mutable_target_name_mapping()->::goby::IdentifierMapping::MergeFrom(from.target_name_mapping());
    }
    if (from.has_number_of_queries()) {
      set_number_of_queries(from.number_of_queries());
    }
    if (from.has_number_of_targets()) {
      set_number_of_targets(from.number_of_targets());
    }
    if (from.has_number_of_aligned_reads()) {
      set_number_of_aligned_reads(from.number_of_aligned_reads());
    }
  }
  if (from._has_bits_[8 / 32] & (0xffu << (8 % 32))) {
    if (from.has_constant_query_length()) {
      set_constant_query_length(from.constant_query_length());
    }
    if (from.has_sorted()) {
      set_sorted(from.sorted());
    }
    if (from.has_indexed()) {
      set_indexed(from.indexed());
    }
    if (from.has_query_lengths_stored_in_entries()) {
      set_query_lengths_stored_in_entries(from.query_lengths_stored_in_entries());
    }
    if (from.has_aligner_name()) {
      set_has_aligner_name();
      aligner_name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.aligner_name_);
    }
    if (from.has_aligner_version()) {
      set_has_aligner_version();
      aligner_version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.aligner_version_);
    }
    if (from.has_version()) {
      set_has_version();
      version_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.version_);
    }
  }
  if (from._has_bits_[17 / 32] & (0xffu << (17 % 32))) {
    if (from.has_query_indices_were_permuted()) {
      set_query_indices_were_permuted(from.query_indices_were_permuted());
    }
    if (from.has_query_index_occurrences()) {
      set_query_index_occurrences(from.query_index_occurrences());
    }
    if (from.has_ambiguity_stored_in_entries()) {
      set_ambiguity_stored_in_entries(from.ambiguity_stored_in_entries());
    }
    if (from.has_all_read_quality_scores()) {
      set_all_read_quality_scores(from.all_read_quality_scores());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void AlignmentHeader::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.AlignmentHeader)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AlignmentHeader::CopyFrom(const AlignmentHeader& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.AlignmentHeader)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AlignmentHeader::IsInitialized() const {

  if (has_query_name_mapping()) {
    if (!this->query_name_mapping_->IsInitialized()) return false;
  }
  if (has_target_name_mapping()) {
    if (!this->target_name_mapping_->IsInitialized()) return false;
  }
  if (!::google::protobuf::internal::AllAreInitialized(this->read_origin())) return false;
  return true;
}

void AlignmentHeader::Swap(AlignmentHeader* other) {
  if (other == this) return;
  InternalSwap(other);
}
void AlignmentHeader::InternalSwap(AlignmentHeader* other) {
  std::swap(smallest_split_query_index_, other->smallest_split_query_index_);
  std::swap(largest_split_query_index_, other->largest_split_query_index_);
  std::swap(query_name_mapping_, other->query_name_mapping_);
  std::swap(target_name_mapping_, other->target_name_mapping_);
  std::swap(number_of_queries_, other->number_of_queries_);
  std::swap(number_of_targets_, other->number_of_targets_);
  std::swap(number_of_aligned_reads_, other->number_of_aligned_reads_);
  query_length_.UnsafeArenaSwap(&other->query_length_);
  std::swap(constant_query_length_, other->constant_query_length_);
  target_length_.UnsafeArenaSwap(&other->target_length_);
  std::swap(sorted_, other->sorted_);
  std::swap(indexed_, other->indexed_);
  std::swap(query_lengths_stored_in_entries_, other->query_lengths_stored_in_entries_);
  aligner_name_.Swap(&other->aligner_name_);
  aligner_version_.Swap(&other->aligner_version_);
  version_.Swap(&other->version_);
  sample_basename_.UnsafeArenaSwap(&other->sample_basename_);
  std::swap(query_indices_were_permuted_, other->query_indices_were_permuted_);
  std::swap(query_index_occurrences_, other->query_index_occurrences_);
  std::swap(ambiguity_stored_in_entries_, other->ambiguity_stored_in_entries_);
  std::swap(all_read_quality_scores_, other->all_read_quality_scores_);
  read_origin_.UnsafeArenaSwap(&other->read_origin_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata AlignmentHeader::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AlignmentHeader_descriptor_;
  metadata.reflection = AlignmentHeader_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// AlignmentHeader

// optional uint32 smallest_split_query_index = 9;
bool AlignmentHeader::has_smallest_split_query_index() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void AlignmentHeader::set_has_smallest_split_query_index() {
  _has_bits_[0] |= 0x00000001u;
}
void AlignmentHeader::clear_has_smallest_split_query_index() {
  _has_bits_[0] &= ~0x00000001u;
}
void AlignmentHeader::clear_smallest_split_query_index() {
  smallest_split_query_index_ = 0u;
  clear_has_smallest_split_query_index();
}
 ::google::protobuf::uint32 AlignmentHeader::smallest_split_query_index() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.smallest_split_query_index)
  return smallest_split_query_index_;
}
 void AlignmentHeader::set_smallest_split_query_index(::google::protobuf::uint32 value) {
  set_has_smallest_split_query_index();
  smallest_split_query_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.smallest_split_query_index)
}

// optional uint32 largest_split_query_index = 11;
bool AlignmentHeader::has_largest_split_query_index() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void AlignmentHeader::set_has_largest_split_query_index() {
  _has_bits_[0] |= 0x00000002u;
}
void AlignmentHeader::clear_has_largest_split_query_index() {
  _has_bits_[0] &= ~0x00000002u;
}
void AlignmentHeader::clear_largest_split_query_index() {
  largest_split_query_index_ = 0u;
  clear_has_largest_split_query_index();
}
 ::google::protobuf::uint32 AlignmentHeader::largest_split_query_index() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.largest_split_query_index)
  return largest_split_query_index_;
}
 void AlignmentHeader::set_largest_split_query_index(::google::protobuf::uint32 value) {
  set_has_largest_split_query_index();
  largest_split_query_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.largest_split_query_index)
}

// optional .goby.IdentifierMapping query_name_mapping = 1;
bool AlignmentHeader::has_query_name_mapping() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void AlignmentHeader::set_has_query_name_mapping() {
  _has_bits_[0] |= 0x00000004u;
}
void AlignmentHeader::clear_has_query_name_mapping() {
  _has_bits_[0] &= ~0x00000004u;
}
void AlignmentHeader::clear_query_name_mapping() {
  if (query_name_mapping_ != NULL) query_name_mapping_->::goby::IdentifierMapping::Clear();
  clear_has_query_name_mapping();
}
const ::goby::IdentifierMapping& AlignmentHeader::query_name_mapping() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.query_name_mapping)
  return query_name_mapping_ != NULL ? *query_name_mapping_ : *default_instance_->query_name_mapping_;
}
::goby::IdentifierMapping* AlignmentHeader::mutable_query_name_mapping() {
  set_has_query_name_mapping();
  if (query_name_mapping_ == NULL) {
    query_name_mapping_ = new ::goby::IdentifierMapping;
  }
  // @@protoc_insertion_point(field_mutable:goby.AlignmentHeader.query_name_mapping)
  return query_name_mapping_;
}
::goby::IdentifierMapping* AlignmentHeader::release_query_name_mapping() {
  // @@protoc_insertion_point(field_release:goby.AlignmentHeader.query_name_mapping)
  clear_has_query_name_mapping();
  ::goby::IdentifierMapping* temp = query_name_mapping_;
  query_name_mapping_ = NULL;
  return temp;
}
void AlignmentHeader::set_allocated_query_name_mapping(::goby::IdentifierMapping* query_name_mapping) {
  delete query_name_mapping_;
  query_name_mapping_ = query_name_mapping;
  if (query_name_mapping) {
    set_has_query_name_mapping();
  } else {
    clear_has_query_name_mapping();
  }
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentHeader.query_name_mapping)
}

// optional .goby.IdentifierMapping target_name_mapping = 2;
bool AlignmentHeader::has_target_name_mapping() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void AlignmentHeader::set_has_target_name_mapping() {
  _has_bits_[0] |= 0x00000008u;
}
void AlignmentHeader::clear_has_target_name_mapping() {
  _has_bits_[0] &= ~0x00000008u;
}
void AlignmentHeader::clear_target_name_mapping() {
  if (target_name_mapping_ != NULL) target_name_mapping_->::goby::IdentifierMapping::Clear();
  clear_has_target_name_mapping();
}
const ::goby::IdentifierMapping& AlignmentHeader::target_name_mapping() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.target_name_mapping)
  return target_name_mapping_ != NULL ? *target_name_mapping_ : *default_instance_->target_name_mapping_;
}
::goby::IdentifierMapping* AlignmentHeader::mutable_target_name_mapping() {
  set_has_target_name_mapping();
  if (target_name_mapping_ == NULL) {
    target_name_mapping_ = new ::goby::IdentifierMapping;
  }
  // @@protoc_insertion_point(field_mutable:goby.AlignmentHeader.target_name_mapping)
  return target_name_mapping_;
}
::goby::IdentifierMapping* AlignmentHeader::release_target_name_mapping() {
  // @@protoc_insertion_point(field_release:goby.AlignmentHeader.target_name_mapping)
  clear_has_target_name_mapping();
  ::goby::IdentifierMapping* temp = target_name_mapping_;
  target_name_mapping_ = NULL;
  return temp;
}
void AlignmentHeader::set_allocated_target_name_mapping(::goby::IdentifierMapping* target_name_mapping) {
  delete target_name_mapping_;
  target_name_mapping_ = target_name_mapping;
  if (target_name_mapping) {
    set_has_target_name_mapping();
  } else {
    clear_has_target_name_mapping();
  }
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentHeader.target_name_mapping)
}

// optional uint32 number_of_queries = 5;
bool AlignmentHeader::has_number_of_queries() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void AlignmentHeader::set_has_number_of_queries() {
  _has_bits_[0] |= 0x00000010u;
}
void AlignmentHeader::clear_has_number_of_queries() {
  _has_bits_[0] &= ~0x00000010u;
}
void AlignmentHeader::clear_number_of_queries() {
  number_of_queries_ = 0u;
  clear_has_number_of_queries();
}
 ::google::protobuf::uint32 AlignmentHeader::number_of_queries() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.number_of_queries)
  return number_of_queries_;
}
 void AlignmentHeader::set_number_of_queries(::google::protobuf::uint32 value) {
  set_has_number_of_queries();
  number_of_queries_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.number_of_queries)
}

// optional uint32 number_of_targets = 6;
bool AlignmentHeader::has_number_of_targets() const {
  return (_has_bits_[0] & 0x00000020u) != 0;
}
void AlignmentHeader::set_has_number_of_targets() {
  _has_bits_[0] |= 0x00000020u;
}
void AlignmentHeader::clear_has_number_of_targets() {
  _has_bits_[0] &= ~0x00000020u;
}
void AlignmentHeader::clear_number_of_targets() {
  number_of_targets_ = 0u;
  clear_has_number_of_targets();
}
 ::google::protobuf::uint32 AlignmentHeader::number_of_targets() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.number_of_targets)
  return number_of_targets_;
}
 void AlignmentHeader::set_number_of_targets(::google::protobuf::uint32 value) {
  set_has_number_of_targets();
  number_of_targets_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.number_of_targets)
}

// optional uint32 number_of_aligned_reads = 7;
bool AlignmentHeader::has_number_of_aligned_reads() const {
  return (_has_bits_[0] & 0x00000040u) != 0;
}
void AlignmentHeader::set_has_number_of_aligned_reads() {
  _has_bits_[0] |= 0x00000040u;
}
void AlignmentHeader::clear_has_number_of_aligned_reads() {
  _has_bits_[0] &= ~0x00000040u;
}
void AlignmentHeader::clear_number_of_aligned_reads() {
  number_of_aligned_reads_ = 0u;
  clear_has_number_of_aligned_reads();
}
 ::google::protobuf::uint32 AlignmentHeader::number_of_aligned_reads() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.number_of_aligned_reads)
  return number_of_aligned_reads_;
}
 void AlignmentHeader::set_number_of_aligned_reads(::google::protobuf::uint32 value) {
  set_has_number_of_aligned_reads();
  number_of_aligned_reads_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.number_of_aligned_reads)
}

// repeated uint32 query_length = 3 [deprecated = true];
int AlignmentHeader::query_length_size() const {
  return query_length_.size();
}
void AlignmentHeader::clear_query_length() {
  query_length_.Clear();
}
 ::google::protobuf::uint32 AlignmentHeader::query_length(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.query_length)
  return query_length_.Get(index);
}
 void AlignmentHeader::set_query_length(int index, ::google::protobuf::uint32 value) {
  query_length_.Set(index, value);
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.query_length)
}
 void AlignmentHeader::add_query_length(::google::protobuf::uint32 value) {
  query_length_.Add(value);
  // @@protoc_insertion_point(field_add:goby.AlignmentHeader.query_length)
}
 const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
AlignmentHeader::query_length() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentHeader.query_length)
  return query_length_;
}
 ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
AlignmentHeader::mutable_query_length() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentHeader.query_length)
  return &query_length_;
}

// optional uint32 constant_query_length = 10;
bool AlignmentHeader::has_constant_query_length() const {
  return (_has_bits_[0] & 0x00000100u) != 0;
}
void AlignmentHeader::set_has_constant_query_length() {
  _has_bits_[0] |= 0x00000100u;
}
void AlignmentHeader::clear_has_constant_query_length() {
  _has_bits_[0] &= ~0x00000100u;
}
void AlignmentHeader::clear_constant_query_length() {
  constant_query_length_ = 0u;
  clear_has_constant_query_length();
}
 ::google::protobuf::uint32 AlignmentHeader::constant_query_length() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.constant_query_length)
  return constant_query_length_;
}
 void AlignmentHeader::set_constant_query_length(::google::protobuf::uint32 value) {
  set_has_constant_query_length();
  constant_query_length_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.constant_query_length)
}

// repeated uint32 target_length = 8;
int AlignmentHeader::target_length_size() const {
  return target_length_.size();
}
void AlignmentHeader::clear_target_length() {
  target_length_.Clear();
}
 ::google::protobuf::uint32 AlignmentHeader::target_length(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.target_length)
  return target_length_.Get(index);
}
 void AlignmentHeader::set_target_length(int index, ::google::protobuf::uint32 value) {
  target_length_.Set(index, value);
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.target_length)
}
 void AlignmentHeader::add_target_length(::google::protobuf::uint32 value) {
  target_length_.Add(value);
  // @@protoc_insertion_point(field_add:goby.AlignmentHeader.target_length)
}
 const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
AlignmentHeader::target_length() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentHeader.target_length)
  return target_length_;
}
 ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
AlignmentHeader::mutable_target_length() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentHeader.target_length)
  return &target_length_;
}

// optional bool sorted = 13;
bool AlignmentHeader::has_sorted() const {
  return (_has_bits_[0] & 0x00000400u) != 0;
}
void AlignmentHeader::set_has_sorted() {
  _has_bits_[0] |= 0x00000400u;
}
void AlignmentHeader::clear_has_sorted() {
  _has_bits_[0] &= ~0x00000400u;
}
void AlignmentHeader::clear_sorted() {
  sorted_ = false;
  clear_has_sorted();
}
 bool AlignmentHeader::sorted() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.sorted)
  return sorted_;
}
 void AlignmentHeader::set_sorted(bool value) {
  set_has_sorted();
  sorted_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.sorted)
}

// optional bool indexed = 14;
bool AlignmentHeader::has_indexed() const {
  return (_has_bits_[0] & 0x00000800u) != 0;
}
void AlignmentHeader::set_has_indexed() {
  _has_bits_[0] |= 0x00000800u;
}
void AlignmentHeader::clear_has_indexed() {
  _has_bits_[0] &= ~0x00000800u;
}
void AlignmentHeader::clear_indexed() {
  indexed_ = false;
  clear_has_indexed();
}
 bool AlignmentHeader::indexed() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.indexed)
  return indexed_;
}
 void AlignmentHeader::set_indexed(bool value) {
  set_has_indexed();
  indexed_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.indexed)
}

// optional bool query_lengths_stored_in_entries = 15;
bool AlignmentHeader::has_query_lengths_stored_in_entries() const {
  return (_has_bits_[0] & 0x00001000u) != 0;
}
void AlignmentHeader::set_has_query_lengths_stored_in_entries() {
  _has_bits_[0] |= 0x00001000u;
}
void AlignmentHeader::clear_has_query_lengths_stored_in_entries() {
  _has_bits_[0] &= ~0x00001000u;
}
void AlignmentHeader::clear_query_lengths_stored_in_entries() {
  query_lengths_stored_in_entries_ = false;
  clear_has_query_lengths_stored_in_entries();
}
 bool AlignmentHeader::query_lengths_stored_in_entries() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.query_lengths_stored_in_entries)
  return query_lengths_stored_in_entries_;
}
 void AlignmentHeader::set_query_lengths_stored_in_entries(bool value) {
  set_has_query_lengths_stored_in_entries();
  query_lengths_stored_in_entries_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.query_lengths_stored_in_entries)
}

// optional string aligner_name = 17;
bool AlignmentHeader::has_aligner_name() const {
  return (_has_bits_[0] & 0x00002000u) != 0;
}
void AlignmentHeader::set_has_aligner_name() {
  _has_bits_[0] |= 0x00002000u;
}
void AlignmentHeader::clear_has_aligner_name() {
  _has_bits_[0] &= ~0x00002000u;
}
void AlignmentHeader::clear_aligner_name() {
  aligner_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_aligner_name();
}
 const ::std::string& AlignmentHeader::aligner_name() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.aligner_name)
  return aligner_name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentHeader::set_aligner_name(const ::std::string& value) {
  set_has_aligner_name();
  aligner_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.aligner_name)
}
 void AlignmentHeader::set_aligner_name(const char* value) {
  set_has_aligner_name();
  aligner_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentHeader.aligner_name)
}
 void AlignmentHeader::set_aligner_name(const char* value, size_t size) {
  set_has_aligner_name();
  aligner_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentHeader.aligner_name)
}
 ::std::string* AlignmentHeader::mutable_aligner_name() {
  set_has_aligner_name();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentHeader.aligner_name)
  return aligner_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentHeader::release_aligner_name() {
  // @@protoc_insertion_point(field_release:goby.AlignmentHeader.aligner_name)
  clear_has_aligner_name();
  return aligner_name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentHeader::set_allocated_aligner_name(::std::string* aligner_name) {
  if (aligner_name != NULL) {
    set_has_aligner_name();
  } else {
    clear_has_aligner_name();
  }
  aligner_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aligner_name);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentHeader.aligner_name)
}

// optional string aligner_version = 18;
bool AlignmentHeader::has_aligner_version() const {
  return (_has_bits_[0] & 0x00004000u) != 0;
}
void AlignmentHeader::set_has_aligner_version() {
  _has_bits_[0] |= 0x00004000u;
}
void AlignmentHeader::clear_has_aligner_version() {
  _has_bits_[0] &= ~0x00004000u;
}
void AlignmentHeader::clear_aligner_version() {
  aligner_version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_aligner_version();
}
 const ::std::string& AlignmentHeader::aligner_version() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.aligner_version)
  return aligner_version_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentHeader::set_aligner_version(const ::std::string& value) {
  set_has_aligner_version();
  aligner_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.aligner_version)
}
 void AlignmentHeader::set_aligner_version(const char* value) {
  set_has_aligner_version();
  aligner_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentHeader.aligner_version)
}
 void AlignmentHeader::set_aligner_version(const char* value, size_t size) {
  set_has_aligner_version();
  aligner_version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentHeader.aligner_version)
}
 ::std::string* AlignmentHeader::mutable_aligner_version() {
  set_has_aligner_version();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentHeader.aligner_version)
  return aligner_version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentHeader::release_aligner_version() {
  // @@protoc_insertion_point(field_release:goby.AlignmentHeader.aligner_version)
  clear_has_aligner_version();
  return aligner_version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentHeader::set_allocated_aligner_version(::std::string* aligner_version) {
  if (aligner_version != NULL) {
    set_has_aligner_version();
  } else {
    clear_has_aligner_version();
  }
  aligner_version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), aligner_version);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentHeader.aligner_version)
}

// optional string version = 25;
bool AlignmentHeader::has_version() const {
  return (_has_bits_[0] & 0x00008000u) != 0;
}
void AlignmentHeader::set_has_version() {
  _has_bits_[0] |= 0x00008000u;
}
void AlignmentHeader::clear_has_version() {
  _has_bits_[0] &= ~0x00008000u;
}
void AlignmentHeader::clear_version() {
  version_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_version();
}
 const ::std::string& AlignmentHeader::version() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.version)
  return version_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentHeader::set_version(const ::std::string& value) {
  set_has_version();
  version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.version)
}
 void AlignmentHeader::set_version(const char* value) {
  set_has_version();
  version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.AlignmentHeader.version)
}
 void AlignmentHeader::set_version(const char* value, size_t size) {
  set_has_version();
  version_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentHeader.version)
}
 ::std::string* AlignmentHeader::mutable_version() {
  set_has_version();
  // @@protoc_insertion_point(field_mutable:goby.AlignmentHeader.version)
  return version_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* AlignmentHeader::release_version() {
  // @@protoc_insertion_point(field_release:goby.AlignmentHeader.version)
  clear_has_version();
  return version_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void AlignmentHeader::set_allocated_version(::std::string* version) {
  if (version != NULL) {
    set_has_version();
  } else {
    clear_has_version();
  }
  version_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), version);
  // @@protoc_insertion_point(field_set_allocated:goby.AlignmentHeader.version)
}

// repeated string sample_basename = 30;
int AlignmentHeader::sample_basename_size() const {
  return sample_basename_.size();
}
void AlignmentHeader::clear_sample_basename() {
  sample_basename_.Clear();
}
 const ::std::string& AlignmentHeader::sample_basename(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.sample_basename)
  return sample_basename_.Get(index);
}
 ::std::string* AlignmentHeader::mutable_sample_basename(int index) {
  // @@protoc_insertion_point(field_mutable:goby.AlignmentHeader.sample_basename)
  return sample_basename_.Mutable(index);
}
 void AlignmentHeader::set_sample_basename(int index, const ::std::string& value) {
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.sample_basename)
  sample_basename_.Mutable(index)->assign(value);
}
 void AlignmentHeader::set_sample_basename(int index, const char* value) {
  sample_basename_.Mutable(index)->assign(value);
  // @@protoc_insertion_point(field_set_char:goby.AlignmentHeader.sample_basename)
}
 void AlignmentHeader::set_sample_basename(int index, const char* value, size_t size) {
  sample_basename_.Mutable(index)->assign(
    reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_set_pointer:goby.AlignmentHeader.sample_basename)
}
 ::std::string* AlignmentHeader::add_sample_basename() {
  // @@protoc_insertion_point(field_add_mutable:goby.AlignmentHeader.sample_basename)
  return sample_basename_.Add();
}
 void AlignmentHeader::add_sample_basename(const ::std::string& value) {
  sample_basename_.Add()->assign(value);
  // @@protoc_insertion_point(field_add:goby.AlignmentHeader.sample_basename)
}
 void AlignmentHeader::add_sample_basename(const char* value) {
  sample_basename_.Add()->assign(value);
  // @@protoc_insertion_point(field_add_char:goby.AlignmentHeader.sample_basename)
}
 void AlignmentHeader::add_sample_basename(const char* value, size_t size) {
  sample_basename_.Add()->assign(reinterpret_cast<const char*>(value), size);
  // @@protoc_insertion_point(field_add_pointer:goby.AlignmentHeader.sample_basename)
}
 const ::google::protobuf::RepeatedPtrField< ::std::string>&
AlignmentHeader::sample_basename() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentHeader.sample_basename)
  return sample_basename_;
}
 ::google::protobuf::RepeatedPtrField< ::std::string>*
AlignmentHeader::mutable_sample_basename() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentHeader.sample_basename)
  return &sample_basename_;
}

// optional bool query_indices_were_permuted = 26;
bool AlignmentHeader::has_query_indices_were_permuted() const {
  return (_has_bits_[0] & 0x00020000u) != 0;
}
void AlignmentHeader::set_has_query_indices_were_permuted() {
  _has_bits_[0] |= 0x00020000u;
}
void AlignmentHeader::clear_has_query_indices_were_permuted() {
  _has_bits_[0] &= ~0x00020000u;
}
void AlignmentHeader::clear_query_indices_were_permuted() {
  query_indices_were_permuted_ = false;
  clear_has_query_indices_were_permuted();
}
 bool AlignmentHeader::query_indices_were_permuted() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.query_indices_were_permuted)
  return query_indices_were_permuted_;
}
 void AlignmentHeader::set_query_indices_were_permuted(bool value) {
  set_has_query_indices_were_permuted();
  query_indices_were_permuted_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.query_indices_were_permuted)
}

// optional bool query_index_occurrences = 35;
bool AlignmentHeader::has_query_index_occurrences() const {
  return (_has_bits_[0] & 0x00040000u) != 0;
}
void AlignmentHeader::set_has_query_index_occurrences() {
  _has_bits_[0] |= 0x00040000u;
}
void AlignmentHeader::clear_has_query_index_occurrences() {
  _has_bits_[0] &= ~0x00040000u;
}
void AlignmentHeader::clear_query_index_occurrences() {
  query_index_occurrences_ = false;
  clear_has_query_index_occurrences();
}
 bool AlignmentHeader::query_index_occurrences() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.query_index_occurrences)
  return query_index_occurrences_;
}
 void AlignmentHeader::set_query_index_occurrences(bool value) {
  set_has_query_index_occurrences();
  query_index_occurrences_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.query_index_occurrences)
}

// optional bool ambiguity_stored_in_entries = 36;
bool AlignmentHeader::has_ambiguity_stored_in_entries() const {
  return (_has_bits_[0] & 0x00080000u) != 0;
}
void AlignmentHeader::set_has_ambiguity_stored_in_entries() {
  _has_bits_[0] |= 0x00080000u;
}
void AlignmentHeader::clear_has_ambiguity_stored_in_entries() {
  _has_bits_[0] &= ~0x00080000u;
}
void AlignmentHeader::clear_ambiguity_stored_in_entries() {
  ambiguity_stored_in_entries_ = false;
  clear_has_ambiguity_stored_in_entries();
}
 bool AlignmentHeader::ambiguity_stored_in_entries() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.ambiguity_stored_in_entries)
  return ambiguity_stored_in_entries_;
}
 void AlignmentHeader::set_ambiguity_stored_in_entries(bool value) {
  set_has_ambiguity_stored_in_entries();
  ambiguity_stored_in_entries_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.ambiguity_stored_in_entries)
}

// optional bool all_read_quality_scores = 40;
bool AlignmentHeader::has_all_read_quality_scores() const {
  return (_has_bits_[0] & 0x00100000u) != 0;
}
void AlignmentHeader::set_has_all_read_quality_scores() {
  _has_bits_[0] |= 0x00100000u;
}
void AlignmentHeader::clear_has_all_read_quality_scores() {
  _has_bits_[0] &= ~0x00100000u;
}
void AlignmentHeader::clear_all_read_quality_scores() {
  all_read_quality_scores_ = false;
  clear_has_all_read_quality_scores();
}
 bool AlignmentHeader::all_read_quality_scores() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.all_read_quality_scores)
  return all_read_quality_scores_;
}
 void AlignmentHeader::set_all_read_quality_scores(bool value) {
  set_has_all_read_quality_scores();
  all_read_quality_scores_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentHeader.all_read_quality_scores)
}

// repeated .goby.ReadOriginInfo read_origin = 27;
int AlignmentHeader::read_origin_size() const {
  return read_origin_.size();
}
void AlignmentHeader::clear_read_origin() {
  read_origin_.Clear();
}
const ::goby::ReadOriginInfo& AlignmentHeader::read_origin(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentHeader.read_origin)
  return read_origin_.Get(index);
}
::goby::ReadOriginInfo* AlignmentHeader::mutable_read_origin(int index) {
  // @@protoc_insertion_point(field_mutable:goby.AlignmentHeader.read_origin)
  return read_origin_.Mutable(index);
}
::goby::ReadOriginInfo* AlignmentHeader::add_read_origin() {
  // @@protoc_insertion_point(field_add:goby.AlignmentHeader.read_origin)
  return read_origin_.Add();
}
::google::protobuf::RepeatedPtrField< ::goby::ReadOriginInfo >*
AlignmentHeader::mutable_read_origin() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentHeader.read_origin)
  return &read_origin_;
}
const ::google::protobuf::RepeatedPtrField< ::goby::ReadOriginInfo >&
AlignmentHeader::read_origin() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentHeader.read_origin)
  return read_origin_;
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int IdentifierMapping::kMappingsFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

IdentifierMapping::IdentifierMapping()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.IdentifierMapping)
}

void IdentifierMapping::InitAsDefaultInstance() {
}

IdentifierMapping::IdentifierMapping(const IdentifierMapping& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.IdentifierMapping)
}

void IdentifierMapping::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

IdentifierMapping::~IdentifierMapping() {
  // @@protoc_insertion_point(destructor:goby.IdentifierMapping)
  SharedDtor();
}

void IdentifierMapping::SharedDtor() {
  if (this != default_instance_) {
  }
}

void IdentifierMapping::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* IdentifierMapping::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return IdentifierMapping_descriptor_;
}

const IdentifierMapping& IdentifierMapping::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

IdentifierMapping* IdentifierMapping::default_instance_ = NULL;

IdentifierMapping* IdentifierMapping::New(::google::protobuf::Arena* arena) const {
  IdentifierMapping* n = new IdentifierMapping;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void IdentifierMapping::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.IdentifierMapping)
  mappings_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool IdentifierMapping::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.IdentifierMapping)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated .goby.IdentifierInfo mappings = 1;
      case 1: {
        if (tag == 10) {
          DO_(input->IncrementRecursionDepth());
         parse_loop_mappings:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_mappings()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(10)) goto parse_loop_mappings;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.IdentifierMapping)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.IdentifierMapping)
  return false;
#undef DO_
}

void IdentifierMapping::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.IdentifierMapping)
  // repeated .goby.IdentifierInfo mappings = 1;
  for (unsigned int i = 0, n = this->mappings_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->mappings(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.IdentifierMapping)
}

::google::protobuf::uint8* IdentifierMapping::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.IdentifierMapping)
  // repeated .goby.IdentifierInfo mappings = 1;
  for (unsigned int i = 0, n = this->mappings_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        1, this->mappings(i), false, target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.IdentifierMapping)
  return target;
}

int IdentifierMapping::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.IdentifierMapping)
  int total_size = 0;

  // repeated .goby.IdentifierInfo mappings = 1;
  total_size += 1 * this->mappings_size();
  for (int i = 0; i < this->mappings_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->mappings(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void IdentifierMapping::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.IdentifierMapping)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const IdentifierMapping* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const IdentifierMapping>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.IdentifierMapping)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.IdentifierMapping)
    MergeFrom(*source);
  }
}

void IdentifierMapping::MergeFrom(const IdentifierMapping& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.IdentifierMapping)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  mappings_.MergeFrom(from.mappings_);
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void IdentifierMapping::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.IdentifierMapping)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void IdentifierMapping::CopyFrom(const IdentifierMapping& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.IdentifierMapping)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool IdentifierMapping::IsInitialized() const {

  if (!::google::protobuf::internal::AllAreInitialized(this->mappings())) return false;
  return true;
}

void IdentifierMapping::Swap(IdentifierMapping* other) {
  if (other == this) return;
  InternalSwap(other);
}
void IdentifierMapping::InternalSwap(IdentifierMapping* other) {
  mappings_.UnsafeArenaSwap(&other->mappings_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata IdentifierMapping::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = IdentifierMapping_descriptor_;
  metadata.reflection = IdentifierMapping_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// IdentifierMapping

// repeated .goby.IdentifierInfo mappings = 1;
int IdentifierMapping::mappings_size() const {
  return mappings_.size();
}
void IdentifierMapping::clear_mappings() {
  mappings_.Clear();
}
const ::goby::IdentifierInfo& IdentifierMapping::mappings(int index) const {
  // @@protoc_insertion_point(field_get:goby.IdentifierMapping.mappings)
  return mappings_.Get(index);
}
::goby::IdentifierInfo* IdentifierMapping::mutable_mappings(int index) {
  // @@protoc_insertion_point(field_mutable:goby.IdentifierMapping.mappings)
  return mappings_.Mutable(index);
}
::goby::IdentifierInfo* IdentifierMapping::add_mappings() {
  // @@protoc_insertion_point(field_add:goby.IdentifierMapping.mappings)
  return mappings_.Add();
}
::google::protobuf::RepeatedPtrField< ::goby::IdentifierInfo >*
IdentifierMapping::mutable_mappings() {
  // @@protoc_insertion_point(field_mutable_list:goby.IdentifierMapping.mappings)
  return &mappings_;
}
const ::google::protobuf::RepeatedPtrField< ::goby::IdentifierInfo >&
IdentifierMapping::mappings() const {
  // @@protoc_insertion_point(field_list:goby.IdentifierMapping.mappings)
  return mappings_;
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int IdentifierInfo::kNameFieldNumber;
const int IdentifierInfo::kIndexFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

IdentifierInfo::IdentifierInfo()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.IdentifierInfo)
}

void IdentifierInfo::InitAsDefaultInstance() {
}

IdentifierInfo::IdentifierInfo(const IdentifierInfo& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.IdentifierInfo)
}

void IdentifierInfo::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  name_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  index_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

IdentifierInfo::~IdentifierInfo() {
  // @@protoc_insertion_point(destructor:goby.IdentifierInfo)
  SharedDtor();
}

void IdentifierInfo::SharedDtor() {
  name_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
  }
}

void IdentifierInfo::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* IdentifierInfo::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return IdentifierInfo_descriptor_;
}

const IdentifierInfo& IdentifierInfo::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

IdentifierInfo* IdentifierInfo::default_instance_ = NULL;

IdentifierInfo* IdentifierInfo::New(::google::protobuf::Arena* arena) const {
  IdentifierInfo* n = new IdentifierInfo;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void IdentifierInfo::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.IdentifierInfo)
  if (_has_bits_[0 / 32] & 3u) {
    if (has_name()) {
      name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    index_ = 0u;
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool IdentifierInfo::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.IdentifierInfo)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required string name = 1;
      case 1: {
        if (tag == 10) {
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_name()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->name().data(), this->name().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.IdentifierInfo.name");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(16)) goto parse_index;
        break;
      }

      // required uint32 index = 2;
      case 2: {
        if (tag == 16) {
         parse_index:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &index_)));
          set_has_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.IdentifierInfo)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.IdentifierInfo)
  return false;
#undef DO_
}

void IdentifierInfo::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.IdentifierInfo)
  // required string name = 1;
  if (has_name()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), this->name().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.IdentifierInfo.name");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      1, this->name(), output);
  }

  // required uint32 index = 2;
  if (has_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->index(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.IdentifierInfo)
}

::google::protobuf::uint8* IdentifierInfo::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.IdentifierInfo)
  // required string name = 1;
  if (has_name()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->name().data(), this->name().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.IdentifierInfo.name");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        1, this->name(), target);
  }

  // required uint32 index = 2;
  if (has_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->index(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.IdentifierInfo)
  return target;
}

int IdentifierInfo::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:goby.IdentifierInfo)
  int total_size = 0;

  if (has_name()) {
    // required string name = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->name());
  }

  if (has_index()) {
    // required uint32 index = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->index());
  }

  return total_size;
}
int IdentifierInfo::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.IdentifierInfo)
  int total_size = 0;

  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required string name = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->name());

    // required uint32 index = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->index());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void IdentifierInfo::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.IdentifierInfo)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const IdentifierInfo* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const IdentifierInfo>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.IdentifierInfo)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.IdentifierInfo)
    MergeFrom(*source);
  }
}

void IdentifierInfo::MergeFrom(const IdentifierInfo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.IdentifierInfo)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_name()) {
      set_has_name();
      name_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.name_);
    }
    if (from.has_index()) {
      set_index(from.index());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void IdentifierInfo::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.IdentifierInfo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void IdentifierInfo::CopyFrom(const IdentifierInfo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.IdentifierInfo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool IdentifierInfo::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;

  return true;
}

void IdentifierInfo::Swap(IdentifierInfo* other) {
  if (other == this) return;
  InternalSwap(other);
}
void IdentifierInfo::InternalSwap(IdentifierInfo* other) {
  name_.Swap(&other->name_);
  std::swap(index_, other->index_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata IdentifierInfo::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = IdentifierInfo_descriptor_;
  metadata.reflection = IdentifierInfo_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// IdentifierInfo

// required string name = 1;
bool IdentifierInfo::has_name() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void IdentifierInfo::set_has_name() {
  _has_bits_[0] |= 0x00000001u;
}
void IdentifierInfo::clear_has_name() {
  _has_bits_[0] &= ~0x00000001u;
}
void IdentifierInfo::clear_name() {
  name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_name();
}
 const ::std::string& IdentifierInfo::name() const {
  // @@protoc_insertion_point(field_get:goby.IdentifierInfo.name)
  return name_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void IdentifierInfo::set_name(const ::std::string& value) {
  set_has_name();
  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.IdentifierInfo.name)
}
 void IdentifierInfo::set_name(const char* value) {
  set_has_name();
  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.IdentifierInfo.name)
}
 void IdentifierInfo::set_name(const char* value, size_t size) {
  set_has_name();
  name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.IdentifierInfo.name)
}
 ::std::string* IdentifierInfo::mutable_name() {
  set_has_name();
  // @@protoc_insertion_point(field_mutable:goby.IdentifierInfo.name)
  return name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* IdentifierInfo::release_name() {
  // @@protoc_insertion_point(field_release:goby.IdentifierInfo.name)
  clear_has_name();
  return name_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void IdentifierInfo::set_allocated_name(::std::string* name) {
  if (name != NULL) {
    set_has_name();
  } else {
    clear_has_name();
  }
  name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name);
  // @@protoc_insertion_point(field_set_allocated:goby.IdentifierInfo.name)
}

// required uint32 index = 2;
bool IdentifierInfo::has_index() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void IdentifierInfo::set_has_index() {
  _has_bits_[0] |= 0x00000002u;
}
void IdentifierInfo::clear_has_index() {
  _has_bits_[0] &= ~0x00000002u;
}
void IdentifierInfo::clear_index() {
  index_ = 0u;
  clear_has_index();
}
 ::google::protobuf::uint32 IdentifierInfo::index() const {
  // @@protoc_insertion_point(field_get:goby.IdentifierInfo.index)
  return index_;
}
 void IdentifierInfo::set_index(::google::protobuf::uint32 value) {
  set_has_index();
  index_ = value;
  // @@protoc_insertion_point(field_set:goby.IdentifierInfo.index)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int ReadOriginInfo::kOriginIndexFieldNumber;
const int ReadOriginInfo::kOriginIdFieldNumber;
const int ReadOriginInfo::kSampleFieldNumber;
const int ReadOriginInfo::kPlatformFieldNumber;
const int ReadOriginInfo::kLibraryFieldNumber;
const int ReadOriginInfo::kPlatformUnitFieldNumber;
const int ReadOriginInfo::kRunDateFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

ReadOriginInfo::ReadOriginInfo()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.ReadOriginInfo)
}

void ReadOriginInfo::InitAsDefaultInstance() {
}

ReadOriginInfo::ReadOriginInfo(const ReadOriginInfo& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.ReadOriginInfo)
}

void ReadOriginInfo::SharedCtor() {
  ::google::protobuf::internal::GetEmptyString();
  _cached_size_ = 0;
  origin_index_ = 0u;
  origin_id_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  sample_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  platform_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  library_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  platform_unit_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  run_date_.UnsafeSetDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

ReadOriginInfo::~ReadOriginInfo() {
  // @@protoc_insertion_point(destructor:goby.ReadOriginInfo)
  SharedDtor();
}

void ReadOriginInfo::SharedDtor() {
  origin_id_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  sample_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  platform_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  library_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  platform_unit_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  run_date_.DestroyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  if (this != default_instance_) {
  }
}

void ReadOriginInfo::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* ReadOriginInfo::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return ReadOriginInfo_descriptor_;
}

const ReadOriginInfo& ReadOriginInfo::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

ReadOriginInfo* ReadOriginInfo::default_instance_ = NULL;

ReadOriginInfo* ReadOriginInfo::New(::google::protobuf::Arena* arena) const {
  ReadOriginInfo* n = new ReadOriginInfo;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void ReadOriginInfo::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.ReadOriginInfo)
  if (_has_bits_[0 / 32] & 127u) {
    origin_index_ = 0u;
    if (has_origin_id()) {
      origin_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_sample()) {
      sample_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_platform()) {
      platform_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_library()) {
      library_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_platform_unit()) {
      platform_unit_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
    if (has_run_date()) {
      run_date_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
    }
  }
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool ReadOriginInfo::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.ReadOriginInfo)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required uint32 origin_index = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &origin_index_)));
          set_has_origin_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_origin_id;
        break;
      }

      // required string origin_id = 2;
      case 2: {
        if (tag == 18) {
         parse_origin_id:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_origin_id()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->origin_id().data(), this->origin_id().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.ReadOriginInfo.origin_id");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(34)) goto parse_sample;
        break;
      }

      // optional string sample = 4;
      case 4: {
        if (tag == 34) {
         parse_sample:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_sample()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->sample().data(), this->sample().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.ReadOriginInfo.sample");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(42)) goto parse_platform;
        break;
      }

      // optional string platform = 5;
      case 5: {
        if (tag == 42) {
         parse_platform:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_platform()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->platform().data(), this->platform().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.ReadOriginInfo.platform");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(50)) goto parse_run_date;
        break;
      }

      // optional string run_date = 6;
      case 6: {
        if (tag == 50) {
         parse_run_date:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_run_date()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->run_date().data(), this->run_date().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.ReadOriginInfo.run_date");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(66)) goto parse_library;
        break;
      }

      // optional string library = 8;
      case 8: {
        if (tag == 66) {
         parse_library:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_library()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->library().data(), this->library().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.ReadOriginInfo.library");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(98)) goto parse_platform_unit;
        break;
      }

      // optional string platform_unit = 12;
      case 12: {
        if (tag == 98) {
         parse_platform_unit:
          DO_(::google::protobuf::internal::WireFormatLite::ReadString(
                input, this->mutable_platform_unit()));
          ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
            this->platform_unit().data(), this->platform_unit().length(),
            ::google::protobuf::internal::WireFormat::PARSE,
            "goby.ReadOriginInfo.platform_unit");
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.ReadOriginInfo)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.ReadOriginInfo)
  return false;
#undef DO_
}

void ReadOriginInfo::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.ReadOriginInfo)
  // required uint32 origin_index = 1;
  if (has_origin_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->origin_index(), output);
  }

  // required string origin_id = 2;
  if (has_origin_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->origin_id().data(), this->origin_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.origin_id");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      2, this->origin_id(), output);
  }

  // optional string sample = 4;
  if (has_sample()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->sample().data(), this->sample().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.sample");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      4, this->sample(), output);
  }

  // optional string platform = 5;
  if (has_platform()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->platform().data(), this->platform().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.platform");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      5, this->platform(), output);
  }

  // optional string run_date = 6;
  if (has_run_date()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->run_date().data(), this->run_date().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.run_date");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      6, this->run_date(), output);
  }

  // optional string library = 8;
  if (has_library()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->library().data(), this->library().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.library");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      8, this->library(), output);
  }

  // optional string platform_unit = 12;
  if (has_platform_unit()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->platform_unit().data(), this->platform_unit().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.platform_unit");
    ::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
      12, this->platform_unit(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.ReadOriginInfo)
}

::google::protobuf::uint8* ReadOriginInfo::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.ReadOriginInfo)
  // required uint32 origin_index = 1;
  if (has_origin_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->origin_index(), target);
  }

  // required string origin_id = 2;
  if (has_origin_id()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->origin_id().data(), this->origin_id().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.origin_id");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        2, this->origin_id(), target);
  }

  // optional string sample = 4;
  if (has_sample()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->sample().data(), this->sample().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.sample");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        4, this->sample(), target);
  }

  // optional string platform = 5;
  if (has_platform()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->platform().data(), this->platform().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.platform");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        5, this->platform(), target);
  }

  // optional string run_date = 6;
  if (has_run_date()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->run_date().data(), this->run_date().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.run_date");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        6, this->run_date(), target);
  }

  // optional string library = 8;
  if (has_library()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->library().data(), this->library().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.library");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        8, this->library(), target);
  }

  // optional string platform_unit = 12;
  if (has_platform_unit()) {
    ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField(
      this->platform_unit().data(), this->platform_unit().length(),
      ::google::protobuf::internal::WireFormat::SERIALIZE,
      "goby.ReadOriginInfo.platform_unit");
    target =
      ::google::protobuf::internal::WireFormatLite::WriteStringToArray(
        12, this->platform_unit(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.ReadOriginInfo)
  return target;
}

int ReadOriginInfo::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:goby.ReadOriginInfo)
  int total_size = 0;

  if (has_origin_index()) {
    // required uint32 origin_index = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->origin_index());
  }

  if (has_origin_id()) {
    // required string origin_id = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->origin_id());
  }

  return total_size;
}
int ReadOriginInfo::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.ReadOriginInfo)
  int total_size = 0;

  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required uint32 origin_index = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->origin_index());

    // required string origin_id = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::StringSize(
        this->origin_id());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  if (_has_bits_[2 / 32] & 124u) {
    // optional string sample = 4;
    if (has_sample()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->sample());
    }

    // optional string platform = 5;
    if (has_platform()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->platform());
    }

    // optional string library = 8;
    if (has_library()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->library());
    }

    // optional string platform_unit = 12;
    if (has_platform_unit()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->platform_unit());
    }

    // optional string run_date = 6;
    if (has_run_date()) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::StringSize(
          this->run_date());
    }

  }
  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void ReadOriginInfo::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.ReadOriginInfo)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const ReadOriginInfo* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const ReadOriginInfo>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.ReadOriginInfo)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.ReadOriginInfo)
    MergeFrom(*source);
  }
}

void ReadOriginInfo::MergeFrom(const ReadOriginInfo& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.ReadOriginInfo)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_origin_index()) {
      set_origin_index(from.origin_index());
    }
    if (from.has_origin_id()) {
      set_has_origin_id();
      origin_id_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.origin_id_);
    }
    if (from.has_sample()) {
      set_has_sample();
      sample_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.sample_);
    }
    if (from.has_platform()) {
      set_has_platform();
      platform_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.platform_);
    }
    if (from.has_library()) {
      set_has_library();
      library_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.library_);
    }
    if (from.has_platform_unit()) {
      set_has_platform_unit();
      platform_unit_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.platform_unit_);
    }
    if (from.has_run_date()) {
      set_has_run_date();
      run_date_.AssignWithDefault(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.run_date_);
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void ReadOriginInfo::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.ReadOriginInfo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void ReadOriginInfo::CopyFrom(const ReadOriginInfo& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.ReadOriginInfo)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool ReadOriginInfo::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;

  return true;
}

void ReadOriginInfo::Swap(ReadOriginInfo* other) {
  if (other == this) return;
  InternalSwap(other);
}
void ReadOriginInfo::InternalSwap(ReadOriginInfo* other) {
  std::swap(origin_index_, other->origin_index_);
  origin_id_.Swap(&other->origin_id_);
  sample_.Swap(&other->sample_);
  platform_.Swap(&other->platform_);
  library_.Swap(&other->library_);
  platform_unit_.Swap(&other->platform_unit_);
  run_date_.Swap(&other->run_date_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata ReadOriginInfo::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = ReadOriginInfo_descriptor_;
  metadata.reflection = ReadOriginInfo_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// ReadOriginInfo

// required uint32 origin_index = 1;
bool ReadOriginInfo::has_origin_index() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void ReadOriginInfo::set_has_origin_index() {
  _has_bits_[0] |= 0x00000001u;
}
void ReadOriginInfo::clear_has_origin_index() {
  _has_bits_[0] &= ~0x00000001u;
}
void ReadOriginInfo::clear_origin_index() {
  origin_index_ = 0u;
  clear_has_origin_index();
}
 ::google::protobuf::uint32 ReadOriginInfo::origin_index() const {
  // @@protoc_insertion_point(field_get:goby.ReadOriginInfo.origin_index)
  return origin_index_;
}
 void ReadOriginInfo::set_origin_index(::google::protobuf::uint32 value) {
  set_has_origin_index();
  origin_index_ = value;
  // @@protoc_insertion_point(field_set:goby.ReadOriginInfo.origin_index)
}

// required string origin_id = 2;
bool ReadOriginInfo::has_origin_id() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void ReadOriginInfo::set_has_origin_id() {
  _has_bits_[0] |= 0x00000002u;
}
void ReadOriginInfo::clear_has_origin_id() {
  _has_bits_[0] &= ~0x00000002u;
}
void ReadOriginInfo::clear_origin_id() {
  origin_id_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_origin_id();
}
 const ::std::string& ReadOriginInfo::origin_id() const {
  // @@protoc_insertion_point(field_get:goby.ReadOriginInfo.origin_id)
  return origin_id_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_origin_id(const ::std::string& value) {
  set_has_origin_id();
  origin_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.ReadOriginInfo.origin_id)
}
 void ReadOriginInfo::set_origin_id(const char* value) {
  set_has_origin_id();
  origin_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.ReadOriginInfo.origin_id)
}
 void ReadOriginInfo::set_origin_id(const char* value, size_t size) {
  set_has_origin_id();
  origin_id_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.ReadOriginInfo.origin_id)
}
 ::std::string* ReadOriginInfo::mutable_origin_id() {
  set_has_origin_id();
  // @@protoc_insertion_point(field_mutable:goby.ReadOriginInfo.origin_id)
  return origin_id_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* ReadOriginInfo::release_origin_id() {
  // @@protoc_insertion_point(field_release:goby.ReadOriginInfo.origin_id)
  clear_has_origin_id();
  return origin_id_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_allocated_origin_id(::std::string* origin_id) {
  if (origin_id != NULL) {
    set_has_origin_id();
  } else {
    clear_has_origin_id();
  }
  origin_id_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), origin_id);
  // @@protoc_insertion_point(field_set_allocated:goby.ReadOriginInfo.origin_id)
}

// optional string sample = 4;
bool ReadOriginInfo::has_sample() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void ReadOriginInfo::set_has_sample() {
  _has_bits_[0] |= 0x00000004u;
}
void ReadOriginInfo::clear_has_sample() {
  _has_bits_[0] &= ~0x00000004u;
}
void ReadOriginInfo::clear_sample() {
  sample_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_sample();
}
 const ::std::string& ReadOriginInfo::sample() const {
  // @@protoc_insertion_point(field_get:goby.ReadOriginInfo.sample)
  return sample_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_sample(const ::std::string& value) {
  set_has_sample();
  sample_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.ReadOriginInfo.sample)
}
 void ReadOriginInfo::set_sample(const char* value) {
  set_has_sample();
  sample_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.ReadOriginInfo.sample)
}
 void ReadOriginInfo::set_sample(const char* value, size_t size) {
  set_has_sample();
  sample_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.ReadOriginInfo.sample)
}
 ::std::string* ReadOriginInfo::mutable_sample() {
  set_has_sample();
  // @@protoc_insertion_point(field_mutable:goby.ReadOriginInfo.sample)
  return sample_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* ReadOriginInfo::release_sample() {
  // @@protoc_insertion_point(field_release:goby.ReadOriginInfo.sample)
  clear_has_sample();
  return sample_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_allocated_sample(::std::string* sample) {
  if (sample != NULL) {
    set_has_sample();
  } else {
    clear_has_sample();
  }
  sample_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), sample);
  // @@protoc_insertion_point(field_set_allocated:goby.ReadOriginInfo.sample)
}

// optional string platform = 5;
bool ReadOriginInfo::has_platform() const {
  return (_has_bits_[0] & 0x00000008u) != 0;
}
void ReadOriginInfo::set_has_platform() {
  _has_bits_[0] |= 0x00000008u;
}
void ReadOriginInfo::clear_has_platform() {
  _has_bits_[0] &= ~0x00000008u;
}
void ReadOriginInfo::clear_platform() {
  platform_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_platform();
}
 const ::std::string& ReadOriginInfo::platform() const {
  // @@protoc_insertion_point(field_get:goby.ReadOriginInfo.platform)
  return platform_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_platform(const ::std::string& value) {
  set_has_platform();
  platform_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.ReadOriginInfo.platform)
}
 void ReadOriginInfo::set_platform(const char* value) {
  set_has_platform();
  platform_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.ReadOriginInfo.platform)
}
 void ReadOriginInfo::set_platform(const char* value, size_t size) {
  set_has_platform();
  platform_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.ReadOriginInfo.platform)
}
 ::std::string* ReadOriginInfo::mutable_platform() {
  set_has_platform();
  // @@protoc_insertion_point(field_mutable:goby.ReadOriginInfo.platform)
  return platform_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* ReadOriginInfo::release_platform() {
  // @@protoc_insertion_point(field_release:goby.ReadOriginInfo.platform)
  clear_has_platform();
  return platform_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_allocated_platform(::std::string* platform) {
  if (platform != NULL) {
    set_has_platform();
  } else {
    clear_has_platform();
  }
  platform_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), platform);
  // @@protoc_insertion_point(field_set_allocated:goby.ReadOriginInfo.platform)
}

// optional string library = 8;
bool ReadOriginInfo::has_library() const {
  return (_has_bits_[0] & 0x00000010u) != 0;
}
void ReadOriginInfo::set_has_library() {
  _has_bits_[0] |= 0x00000010u;
}
void ReadOriginInfo::clear_has_library() {
  _has_bits_[0] &= ~0x00000010u;
}
void ReadOriginInfo::clear_library() {
  library_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_library();
}
 const ::std::string& ReadOriginInfo::library() const {
  // @@protoc_insertion_point(field_get:goby.ReadOriginInfo.library)
  return library_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_library(const ::std::string& value) {
  set_has_library();
  library_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.ReadOriginInfo.library)
}
 void ReadOriginInfo::set_library(const char* value) {
  set_has_library();
  library_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.ReadOriginInfo.library)
}
 void ReadOriginInfo::set_library(const char* value, size_t size) {
  set_has_library();
  library_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.ReadOriginInfo.library)
}
 ::std::string* ReadOriginInfo::mutable_library() {
  set_has_library();
  // @@protoc_insertion_point(field_mutable:goby.ReadOriginInfo.library)
  return library_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* ReadOriginInfo::release_library() {
  // @@protoc_insertion_point(field_release:goby.ReadOriginInfo.library)
  clear_has_library();
  return library_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_allocated_library(::std::string* library) {
  if (library != NULL) {
    set_has_library();
  } else {
    clear_has_library();
  }
  library_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), library);
  // @@protoc_insertion_point(field_set_allocated:goby.ReadOriginInfo.library)
}

// optional string platform_unit = 12;
bool ReadOriginInfo::has_platform_unit() const {
  return (_has_bits_[0] & 0x00000020u) != 0;
}
void ReadOriginInfo::set_has_platform_unit() {
  _has_bits_[0] |= 0x00000020u;
}
void ReadOriginInfo::clear_has_platform_unit() {
  _has_bits_[0] &= ~0x00000020u;
}
void ReadOriginInfo::clear_platform_unit() {
  platform_unit_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_platform_unit();
}
 const ::std::string& ReadOriginInfo::platform_unit() const {
  // @@protoc_insertion_point(field_get:goby.ReadOriginInfo.platform_unit)
  return platform_unit_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_platform_unit(const ::std::string& value) {
  set_has_platform_unit();
  platform_unit_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.ReadOriginInfo.platform_unit)
}
 void ReadOriginInfo::set_platform_unit(const char* value) {
  set_has_platform_unit();
  platform_unit_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.ReadOriginInfo.platform_unit)
}
 void ReadOriginInfo::set_platform_unit(const char* value, size_t size) {
  set_has_platform_unit();
  platform_unit_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.ReadOriginInfo.platform_unit)
}
 ::std::string* ReadOriginInfo::mutable_platform_unit() {
  set_has_platform_unit();
  // @@protoc_insertion_point(field_mutable:goby.ReadOriginInfo.platform_unit)
  return platform_unit_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* ReadOriginInfo::release_platform_unit() {
  // @@protoc_insertion_point(field_release:goby.ReadOriginInfo.platform_unit)
  clear_has_platform_unit();
  return platform_unit_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_allocated_platform_unit(::std::string* platform_unit) {
  if (platform_unit != NULL) {
    set_has_platform_unit();
  } else {
    clear_has_platform_unit();
  }
  platform_unit_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), platform_unit);
  // @@protoc_insertion_point(field_set_allocated:goby.ReadOriginInfo.platform_unit)
}

// optional string run_date = 6;
bool ReadOriginInfo::has_run_date() const {
  return (_has_bits_[0] & 0x00000040u) != 0;
}
void ReadOriginInfo::set_has_run_date() {
  _has_bits_[0] |= 0x00000040u;
}
void ReadOriginInfo::clear_has_run_date() {
  _has_bits_[0] &= ~0x00000040u;
}
void ReadOriginInfo::clear_run_date() {
  run_date_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
  clear_has_run_date();
}
 const ::std::string& ReadOriginInfo::run_date() const {
  // @@protoc_insertion_point(field_get:goby.ReadOriginInfo.run_date)
  return run_date_.GetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_run_date(const ::std::string& value) {
  set_has_run_date();
  run_date_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
  // @@protoc_insertion_point(field_set:goby.ReadOriginInfo.run_date)
}
 void ReadOriginInfo::set_run_date(const char* value) {
  set_has_run_date();
  run_date_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
  // @@protoc_insertion_point(field_set_char:goby.ReadOriginInfo.run_date)
}
 void ReadOriginInfo::set_run_date(const char* value, size_t size) {
  set_has_run_date();
  run_date_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
      ::std::string(reinterpret_cast<const char*>(value), size));
  // @@protoc_insertion_point(field_set_pointer:goby.ReadOriginInfo.run_date)
}
 ::std::string* ReadOriginInfo::mutable_run_date() {
  set_has_run_date();
  // @@protoc_insertion_point(field_mutable:goby.ReadOriginInfo.run_date)
  return run_date_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 ::std::string* ReadOriginInfo::release_run_date() {
  // @@protoc_insertion_point(field_release:goby.ReadOriginInfo.run_date)
  clear_has_run_date();
  return run_date_.ReleaseNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
 void ReadOriginInfo::set_allocated_run_date(::std::string* run_date) {
  if (run_date != NULL) {
    set_has_run_date();
  } else {
    clear_has_run_date();
  }
  run_date_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), run_date);
  // @@protoc_insertion_point(field_set_allocated:goby.ReadOriginInfo.run_date)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int AlignmentTooManyHits::kAlignerThresholdFieldNumber;
const int AlignmentTooManyHits::kHitsFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

AlignmentTooManyHits::AlignmentTooManyHits()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.AlignmentTooManyHits)
}

void AlignmentTooManyHits::InitAsDefaultInstance() {
}

AlignmentTooManyHits::AlignmentTooManyHits(const AlignmentTooManyHits& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.AlignmentTooManyHits)
}

void AlignmentTooManyHits::SharedCtor() {
  _cached_size_ = 0;
  aligner_threshold_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AlignmentTooManyHits::~AlignmentTooManyHits() {
  // @@protoc_insertion_point(destructor:goby.AlignmentTooManyHits)
  SharedDtor();
}

void AlignmentTooManyHits::SharedDtor() {
  if (this != default_instance_) {
  }
}

void AlignmentTooManyHits::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AlignmentTooManyHits::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AlignmentTooManyHits_descriptor_;
}

const AlignmentTooManyHits& AlignmentTooManyHits::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

AlignmentTooManyHits* AlignmentTooManyHits::default_instance_ = NULL;

AlignmentTooManyHits* AlignmentTooManyHits::New(::google::protobuf::Arena* arena) const {
  AlignmentTooManyHits* n = new AlignmentTooManyHits;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void AlignmentTooManyHits::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.AlignmentTooManyHits)
  aligner_threshold_ = 0u;
  hits_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool AlignmentTooManyHits::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.AlignmentTooManyHits)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated .goby.AmbiguousLocation hits = 1;
      case 1: {
        if (tag == 10) {
          DO_(input->IncrementRecursionDepth());
         parse_loop_hits:
          DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtualNoRecursionDepth(
                input, add_hits()));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(10)) goto parse_loop_hits;
        input->UnsafeDecrementRecursionDepth();
        if (input->ExpectTag(16)) goto parse_aligner_threshold;
        break;
      }

      // required uint32 aligner_threshold = 2;
      case 2: {
        if (tag == 16) {
         parse_aligner_threshold:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &aligner_threshold_)));
          set_has_aligner_threshold();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.AlignmentTooManyHits)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.AlignmentTooManyHits)
  return false;
#undef DO_
}

void AlignmentTooManyHits::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.AlignmentTooManyHits)
  // repeated .goby.AmbiguousLocation hits = 1;
  for (unsigned int i = 0, n = this->hits_size(); i < n; i++) {
    ::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
      1, this->hits(i), output);
  }

  // required uint32 aligner_threshold = 2;
  if (has_aligner_threshold()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->aligner_threshold(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.AlignmentTooManyHits)
}

::google::protobuf::uint8* AlignmentTooManyHits::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.AlignmentTooManyHits)
  // repeated .goby.AmbiguousLocation hits = 1;
  for (unsigned int i = 0, n = this->hits_size(); i < n; i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      InternalWriteMessageNoVirtualToArray(
        1, this->hits(i), false, target);
  }

  // required uint32 aligner_threshold = 2;
  if (has_aligner_threshold()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->aligner_threshold(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.AlignmentTooManyHits)
  return target;
}

int AlignmentTooManyHits::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.AlignmentTooManyHits)
  int total_size = 0;

  // required uint32 aligner_threshold = 2;
  if (has_aligner_threshold()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->aligner_threshold());
  }
  // repeated .goby.AmbiguousLocation hits = 1;
  total_size += 1 * this->hits_size();
  for (int i = 0; i < this->hits_size(); i++) {
    total_size +=
      ::google::protobuf::internal::WireFormatLite::MessageSizeNoVirtual(
        this->hits(i));
  }

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AlignmentTooManyHits::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.AlignmentTooManyHits)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const AlignmentTooManyHits* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const AlignmentTooManyHits>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.AlignmentTooManyHits)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.AlignmentTooManyHits)
    MergeFrom(*source);
  }
}

void AlignmentTooManyHits::MergeFrom(const AlignmentTooManyHits& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.AlignmentTooManyHits)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  hits_.MergeFrom(from.hits_);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_aligner_threshold()) {
      set_aligner_threshold(from.aligner_threshold());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void AlignmentTooManyHits::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.AlignmentTooManyHits)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AlignmentTooManyHits::CopyFrom(const AlignmentTooManyHits& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.AlignmentTooManyHits)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AlignmentTooManyHits::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000001) != 0x00000001) return false;

  if (!::google::protobuf::internal::AllAreInitialized(this->hits())) return false;
  return true;
}

void AlignmentTooManyHits::Swap(AlignmentTooManyHits* other) {
  if (other == this) return;
  InternalSwap(other);
}
void AlignmentTooManyHits::InternalSwap(AlignmentTooManyHits* other) {
  std::swap(aligner_threshold_, other->aligner_threshold_);
  hits_.UnsafeArenaSwap(&other->hits_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata AlignmentTooManyHits::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AlignmentTooManyHits_descriptor_;
  metadata.reflection = AlignmentTooManyHits_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// AlignmentTooManyHits

// required uint32 aligner_threshold = 2;
bool AlignmentTooManyHits::has_aligner_threshold() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void AlignmentTooManyHits::set_has_aligner_threshold() {
  _has_bits_[0] |= 0x00000001u;
}
void AlignmentTooManyHits::clear_has_aligner_threshold() {
  _has_bits_[0] &= ~0x00000001u;
}
void AlignmentTooManyHits::clear_aligner_threshold() {
  aligner_threshold_ = 0u;
  clear_has_aligner_threshold();
}
 ::google::protobuf::uint32 AlignmentTooManyHits::aligner_threshold() const {
  // @@protoc_insertion_point(field_get:goby.AlignmentTooManyHits.aligner_threshold)
  return aligner_threshold_;
}
 void AlignmentTooManyHits::set_aligner_threshold(::google::protobuf::uint32 value) {
  set_has_aligner_threshold();
  aligner_threshold_ = value;
  // @@protoc_insertion_point(field_set:goby.AlignmentTooManyHits.aligner_threshold)
}

// repeated .goby.AmbiguousLocation hits = 1;
int AlignmentTooManyHits::hits_size() const {
  return hits_.size();
}
void AlignmentTooManyHits::clear_hits() {
  hits_.Clear();
}
const ::goby::AmbiguousLocation& AlignmentTooManyHits::hits(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentTooManyHits.hits)
  return hits_.Get(index);
}
::goby::AmbiguousLocation* AlignmentTooManyHits::mutable_hits(int index) {
  // @@protoc_insertion_point(field_mutable:goby.AlignmentTooManyHits.hits)
  return hits_.Mutable(index);
}
::goby::AmbiguousLocation* AlignmentTooManyHits::add_hits() {
  // @@protoc_insertion_point(field_add:goby.AlignmentTooManyHits.hits)
  return hits_.Add();
}
::google::protobuf::RepeatedPtrField< ::goby::AmbiguousLocation >*
AlignmentTooManyHits::mutable_hits() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentTooManyHits.hits)
  return &hits_;
}
const ::google::protobuf::RepeatedPtrField< ::goby::AmbiguousLocation >&
AlignmentTooManyHits::hits() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentTooManyHits.hits)
  return hits_;
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int AmbiguousLocation::kQueryIndexFieldNumber;
const int AmbiguousLocation::kAtLeastNumberOfHitsFieldNumber;
const int AmbiguousLocation::kLengthOfMatchFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

AmbiguousLocation::AmbiguousLocation()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.AmbiguousLocation)
}

void AmbiguousLocation::InitAsDefaultInstance() {
}

AmbiguousLocation::AmbiguousLocation(const AmbiguousLocation& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.AmbiguousLocation)
}

void AmbiguousLocation::SharedCtor() {
  _cached_size_ = 0;
  query_index_ = 0u;
  at_least_number_of_hits_ = 0u;
  length_of_match_ = 0u;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AmbiguousLocation::~AmbiguousLocation() {
  // @@protoc_insertion_point(destructor:goby.AmbiguousLocation)
  SharedDtor();
}

void AmbiguousLocation::SharedDtor() {
  if (this != default_instance_) {
  }
}

void AmbiguousLocation::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AmbiguousLocation::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AmbiguousLocation_descriptor_;
}

const AmbiguousLocation& AmbiguousLocation::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

AmbiguousLocation* AmbiguousLocation::default_instance_ = NULL;

AmbiguousLocation* AmbiguousLocation::New(::google::protobuf::Arena* arena) const {
  AmbiguousLocation* n = new AmbiguousLocation;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void AmbiguousLocation::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.AmbiguousLocation)
#if defined(__clang__)
#define ZR_HELPER_(f) \
  _Pragma("clang diagnostic push") \
  _Pragma("clang diagnostic ignored \"-Winvalid-offsetof\"") \
  __builtin_offsetof(AmbiguousLocation, f) \
  _Pragma("clang diagnostic pop")
#else
#define ZR_HELPER_(f) reinterpret_cast<char*>(\
  &reinterpret_cast<AmbiguousLocation*>(16)->f)
#endif

#define ZR_(first, last) do {\
  ::memset(&first, 0,\
           ZR_HELPER_(last) - ZR_HELPER_(first) + sizeof(last));\
} while (0)

  ZR_(query_index_, length_of_match_);

#undef ZR_HELPER_
#undef ZR_

  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool AmbiguousLocation::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.AmbiguousLocation)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // required uint32 query_index = 1;
      case 1: {
        if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &query_index_)));
          set_has_query_index();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(16)) goto parse_at_least_number_of_hits;
        break;
      }

      // required uint32 at_least_number_of_hits = 2;
      case 2: {
        if (tag == 16) {
         parse_at_least_number_of_hits:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &at_least_number_of_hits_)));
          set_has_at_least_number_of_hits();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(24)) goto parse_length_of_match;
        break;
      }

      // optional uint32 length_of_match = 3;
      case 3: {
        if (tag == 24) {
         parse_length_of_match:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, &length_of_match_)));
          set_has_length_of_match();
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.AmbiguousLocation)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.AmbiguousLocation)
  return false;
#undef DO_
}

void AmbiguousLocation::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.AmbiguousLocation)
  // required uint32 query_index = 1;
  if (has_query_index()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(1, this->query_index(), output);
  }

  // required uint32 at_least_number_of_hits = 2;
  if (has_at_least_number_of_hits()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(2, this->at_least_number_of_hits(), output);
  }

  // optional uint32 length_of_match = 3;
  if (has_length_of_match()) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32(3, this->length_of_match(), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.AmbiguousLocation)
}

::google::protobuf::uint8* AmbiguousLocation::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.AmbiguousLocation)
  // required uint32 query_index = 1;
  if (has_query_index()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(1, this->query_index(), target);
  }

  // required uint32 at_least_number_of_hits = 2;
  if (has_at_least_number_of_hits()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(2, this->at_least_number_of_hits(), target);
  }

  // optional uint32 length_of_match = 3;
  if (has_length_of_match()) {
    target = ::google::protobuf::internal::WireFormatLite::WriteUInt32ToArray(3, this->length_of_match(), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.AmbiguousLocation)
  return target;
}

int AmbiguousLocation::RequiredFieldsByteSizeFallback() const {
// @@protoc_insertion_point(required_fields_byte_size_fallback_start:goby.AmbiguousLocation)
  int total_size = 0;

  if (has_query_index()) {
    // required uint32 query_index = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->query_index());
  }

  if (has_at_least_number_of_hits()) {
    // required uint32 at_least_number_of_hits = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->at_least_number_of_hits());
  }

  return total_size;
}
int AmbiguousLocation::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.AmbiguousLocation)
  int total_size = 0;

  if (((_has_bits_[0] & 0x00000003) ^ 0x00000003) == 0) {  // All required fields are present.
    // required uint32 query_index = 1;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->query_index());

    // required uint32 at_least_number_of_hits = 2;
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->at_least_number_of_hits());

  } else {
    total_size += RequiredFieldsByteSizeFallback();
  }
  // optional uint32 length_of_match = 3;
  if (has_length_of_match()) {
    total_size += 1 +
      ::google::protobuf::internal::WireFormatLite::UInt32Size(
        this->length_of_match());
  }

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AmbiguousLocation::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.AmbiguousLocation)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const AmbiguousLocation* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const AmbiguousLocation>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.AmbiguousLocation)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.AmbiguousLocation)
    MergeFrom(*source);
  }
}

void AmbiguousLocation::MergeFrom(const AmbiguousLocation& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.AmbiguousLocation)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_query_index()) {
      set_query_index(from.query_index());
    }
    if (from.has_at_least_number_of_hits()) {
      set_at_least_number_of_hits(from.at_least_number_of_hits());
    }
    if (from.has_length_of_match()) {
      set_length_of_match(from.length_of_match());
    }
  }
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void AmbiguousLocation::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.AmbiguousLocation)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AmbiguousLocation::CopyFrom(const AmbiguousLocation& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.AmbiguousLocation)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AmbiguousLocation::IsInitialized() const {
  if ((_has_bits_[0] & 0x00000003) != 0x00000003) return false;

  return true;
}

void AmbiguousLocation::Swap(AmbiguousLocation* other) {
  if (other == this) return;
  InternalSwap(other);
}
void AmbiguousLocation::InternalSwap(AmbiguousLocation* other) {
  std::swap(query_index_, other->query_index_);
  std::swap(at_least_number_of_hits_, other->at_least_number_of_hits_);
  std::swap(length_of_match_, other->length_of_match_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata AmbiguousLocation::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AmbiguousLocation_descriptor_;
  metadata.reflection = AmbiguousLocation_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// AmbiguousLocation

// required uint32 query_index = 1;
bool AmbiguousLocation::has_query_index() const {
  return (_has_bits_[0] & 0x00000001u) != 0;
}
void AmbiguousLocation::set_has_query_index() {
  _has_bits_[0] |= 0x00000001u;
}
void AmbiguousLocation::clear_has_query_index() {
  _has_bits_[0] &= ~0x00000001u;
}
void AmbiguousLocation::clear_query_index() {
  query_index_ = 0u;
  clear_has_query_index();
}
 ::google::protobuf::uint32 AmbiguousLocation::query_index() const {
  // @@protoc_insertion_point(field_get:goby.AmbiguousLocation.query_index)
  return query_index_;
}
 void AmbiguousLocation::set_query_index(::google::protobuf::uint32 value) {
  set_has_query_index();
  query_index_ = value;
  // @@protoc_insertion_point(field_set:goby.AmbiguousLocation.query_index)
}

// required uint32 at_least_number_of_hits = 2;
bool AmbiguousLocation::has_at_least_number_of_hits() const {
  return (_has_bits_[0] & 0x00000002u) != 0;
}
void AmbiguousLocation::set_has_at_least_number_of_hits() {
  _has_bits_[0] |= 0x00000002u;
}
void AmbiguousLocation::clear_has_at_least_number_of_hits() {
  _has_bits_[0] &= ~0x00000002u;
}
void AmbiguousLocation::clear_at_least_number_of_hits() {
  at_least_number_of_hits_ = 0u;
  clear_has_at_least_number_of_hits();
}
 ::google::protobuf::uint32 AmbiguousLocation::at_least_number_of_hits() const {
  // @@protoc_insertion_point(field_get:goby.AmbiguousLocation.at_least_number_of_hits)
  return at_least_number_of_hits_;
}
 void AmbiguousLocation::set_at_least_number_of_hits(::google::protobuf::uint32 value) {
  set_has_at_least_number_of_hits();
  at_least_number_of_hits_ = value;
  // @@protoc_insertion_point(field_set:goby.AmbiguousLocation.at_least_number_of_hits)
}

// optional uint32 length_of_match = 3;
bool AmbiguousLocation::has_length_of_match() const {
  return (_has_bits_[0] & 0x00000004u) != 0;
}
void AmbiguousLocation::set_has_length_of_match() {
  _has_bits_[0] |= 0x00000004u;
}
void AmbiguousLocation::clear_has_length_of_match() {
  _has_bits_[0] &= ~0x00000004u;
}
void AmbiguousLocation::clear_length_of_match() {
  length_of_match_ = 0u;
  clear_has_length_of_match();
}
 ::google::protobuf::uint32 AmbiguousLocation::length_of_match() const {
  // @@protoc_insertion_point(field_get:goby.AmbiguousLocation.length_of_match)
  return length_of_match_;
}
 void AmbiguousLocation::set_length_of_match(::google::protobuf::uint32 value) {
  set_has_length_of_match();
  length_of_match_ = value;
  // @@protoc_insertion_point(field_set:goby.AmbiguousLocation.length_of_match)
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// ===================================================================

#if !defined(_MSC_VER) || _MSC_VER >= 1900
const int AlignmentIndex::kTargetPositionOffsetsFieldNumber;
const int AlignmentIndex::kOffsetsFieldNumber;
const int AlignmentIndex::kAbsolutePositionsFieldNumber;
#endif  // !defined(_MSC_VER) || _MSC_VER >= 1900

AlignmentIndex::AlignmentIndex()
  : ::google::protobuf::Message(), _internal_metadata_(NULL) {
  SharedCtor();
  // @@protoc_insertion_point(constructor:goby.AlignmentIndex)
}

void AlignmentIndex::InitAsDefaultInstance() {
}

AlignmentIndex::AlignmentIndex(const AlignmentIndex& from)
  : ::google::protobuf::Message(),
    _internal_metadata_(NULL) {
  SharedCtor();
  MergeFrom(from);
  // @@protoc_insertion_point(copy_constructor:goby.AlignmentIndex)
}

void AlignmentIndex::SharedCtor() {
  _cached_size_ = 0;
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
}

AlignmentIndex::~AlignmentIndex() {
  // @@protoc_insertion_point(destructor:goby.AlignmentIndex)
  SharedDtor();
}

void AlignmentIndex::SharedDtor() {
  if (this != default_instance_) {
  }
}

void AlignmentIndex::SetCachedSize(int size) const {
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* AlignmentIndex::descriptor() {
  protobuf_AssignDescriptorsOnce();
  return AlignmentIndex_descriptor_;
}

const AlignmentIndex& AlignmentIndex::default_instance() {
  if (default_instance_ == NULL) protobuf_AddDesc_Alignments_2eproto();
  return *default_instance_;
}

AlignmentIndex* AlignmentIndex::default_instance_ = NULL;

AlignmentIndex* AlignmentIndex::New(::google::protobuf::Arena* arena) const {
  AlignmentIndex* n = new AlignmentIndex;
  if (arena != NULL) {
    arena->Own(n);
  }
  return n;
}

void AlignmentIndex::Clear() {
// @@protoc_insertion_point(message_clear_start:goby.AlignmentIndex)
  target_position_offsets_.Clear();
  offsets_.Clear();
  absolute_positions_.Clear();
  ::memset(_has_bits_, 0, sizeof(_has_bits_));
  if (_internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->Clear();
  }
}

bool AlignmentIndex::MergePartialFromCodedStream(
    ::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
  ::google::protobuf::uint32 tag;
  // @@protoc_insertion_point(parse_start:goby.AlignmentIndex)
  for (;;) {
    ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127);
    tag = p.first;
    if (!p.second) goto handle_unusual;
    switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
      // repeated uint32 target_position_offsets = 1 [packed = true];
      case 1: {
        if (tag == 10) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 input, this->mutable_target_position_offsets())));
        } else if (tag == 8) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>(
                 1, 10, input, this->mutable_target_position_offsets())));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(18)) goto parse_offsets;
        break;
      }

      // repeated uint64 offsets = 2 [packed = true];
      case 2: {
        if (tag == 18) {
         parse_offsets:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                 input, this->mutable_offsets())));
        } else if (tag == 16) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                 1, 18, input, this->mutable_offsets())));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectTag(26)) goto parse_absolute_positions;
        break;
      }

      // repeated uint64 absolute_positions = 3 [packed = true];
      case 3: {
        if (tag == 26) {
         parse_absolute_positions:
          DO_((::google::protobuf::internal::WireFormatLite::ReadPackedPrimitive<
                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                 input, this->mutable_absolute_positions())));
        } else if (tag == 24) {
          DO_((::google::protobuf::internal::WireFormatLite::ReadRepeatedPrimitiveNoInline<
                   ::google::protobuf::uint64, ::google::protobuf::internal::WireFormatLite::TYPE_UINT64>(
                 1, 26, input, this->mutable_absolute_positions())));
        } else {
          goto handle_unusual;
        }
        if (input->ExpectAtEnd()) goto success;
        break;
      }

      default: {
      handle_unusual:
        if (tag == 0 ||
            ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
            ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
          goto success;
        }
        DO_(::google::protobuf::internal::WireFormat::SkipField(
              input, tag, mutable_unknown_fields()));
        break;
      }
    }
  }
success:
  // @@protoc_insertion_point(parse_success:goby.AlignmentIndex)
  return true;
failure:
  // @@protoc_insertion_point(parse_failure:goby.AlignmentIndex)
  return false;
#undef DO_
}

void AlignmentIndex::SerializeWithCachedSizes(
    ::google::protobuf::io::CodedOutputStream* output) const {
  // @@protoc_insertion_point(serialize_start:goby.AlignmentIndex)
  // repeated uint32 target_position_offsets = 1 [packed = true];
  if (this->target_position_offsets_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(1, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_target_position_offsets_cached_byte_size_);
  }
  for (int i = 0; i < this->target_position_offsets_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt32NoTag(
      this->target_position_offsets(i), output);
  }

  // repeated uint64 offsets = 2 [packed = true];
  if (this->offsets_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(2, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_offsets_cached_byte_size_);
  }
  for (int i = 0; i < this->offsets_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag(
      this->offsets(i), output);
  }

  // repeated uint64 absolute_positions = 3 [packed = true];
  if (this->absolute_positions_size() > 0) {
    ::google::protobuf::internal::WireFormatLite::WriteTag(3, ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED, output);
    output->WriteVarint32(_absolute_positions_cached_byte_size_);
  }
  for (int i = 0; i < this->absolute_positions_size(); i++) {
    ::google::protobuf::internal::WireFormatLite::WriteUInt64NoTag(
      this->absolute_positions(i), output);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    ::google::protobuf::internal::WireFormat::SerializeUnknownFields(
        unknown_fields(), output);
  }
  // @@protoc_insertion_point(serialize_end:goby.AlignmentIndex)
}

::google::protobuf::uint8* AlignmentIndex::InternalSerializeWithCachedSizesToArray(
    bool deterministic, ::google::protobuf::uint8* target) const {
  // @@protoc_insertion_point(serialize_to_array_start:goby.AlignmentIndex)
  // repeated uint32 target_position_offsets = 1 [packed = true];
  if (this->target_position_offsets_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      1,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
      _target_position_offsets_cached_byte_size_, target);
  }
  for (int i = 0; i < this->target_position_offsets_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteUInt32NoTagToArray(this->target_position_offsets(i), target);
  }

  // repeated uint64 offsets = 2 [packed = true];
  if (this->offsets_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      2,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
      _offsets_cached_byte_size_, target);
  }
  for (int i = 0; i < this->offsets_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteUInt64NoTagToArray(this->offsets(i), target);
  }

  // repeated uint64 absolute_positions = 3 [packed = true];
  if (this->absolute_positions_size() > 0) {
    target = ::google::protobuf::internal::WireFormatLite::WriteTagToArray(
      3,
      ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED,
      target);
    target = ::google::protobuf::io::CodedOutputStream::WriteVarint32ToArray(
      _absolute_positions_cached_byte_size_, target);
  }
  for (int i = 0; i < this->absolute_positions_size(); i++) {
    target = ::google::protobuf::internal::WireFormatLite::
      WriteUInt64NoTagToArray(this->absolute_positions(i), target);
  }

  if (_internal_metadata_.have_unknown_fields()) {
    target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
        unknown_fields(), target);
  }
  // @@protoc_insertion_point(serialize_to_array_end:goby.AlignmentIndex)
  return target;
}

int AlignmentIndex::ByteSize() const {
// @@protoc_insertion_point(message_byte_size_start:goby.AlignmentIndex)
  int total_size = 0;

  // repeated uint32 target_position_offsets = 1 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->target_position_offsets_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt32Size(this->target_position_offsets(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _target_position_offsets_cached_byte_size_ = data_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  // repeated uint64 offsets = 2 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->offsets_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt64Size(this->offsets(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _offsets_cached_byte_size_ = data_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  // repeated uint64 absolute_positions = 3 [packed = true];
  {
    int data_size = 0;
    for (int i = 0; i < this->absolute_positions_size(); i++) {
      data_size += ::google::protobuf::internal::WireFormatLite::
        UInt64Size(this->absolute_positions(i));
    }
    if (data_size > 0) {
      total_size += 1 +
        ::google::protobuf::internal::WireFormatLite::Int32Size(data_size);
    }
    GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
    _absolute_positions_cached_byte_size_ = data_size;
    GOOGLE_SAFE_CONCURRENT_WRITES_END();
    total_size += data_size;
  }

  if (_internal_metadata_.have_unknown_fields()) {
    total_size +=
      ::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
        unknown_fields());
  }
  GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
  _cached_size_ = total_size;
  GOOGLE_SAFE_CONCURRENT_WRITES_END();
  return total_size;
}

void AlignmentIndex::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:goby.AlignmentIndex)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  const AlignmentIndex* source = 
      ::google::protobuf::internal::DynamicCastToGenerated<const AlignmentIndex>(
          &from);
  if (source == NULL) {
  // @@protoc_insertion_point(generalized_merge_from_cast_fail:goby.AlignmentIndex)
    ::google::protobuf::internal::ReflectionOps::Merge(from, this);
  } else {
  // @@protoc_insertion_point(generalized_merge_from_cast_success:goby.AlignmentIndex)
    MergeFrom(*source);
  }
}

void AlignmentIndex::MergeFrom(const AlignmentIndex& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:goby.AlignmentIndex)
  if (GOOGLE_PREDICT_FALSE(&from == this)) {
    ::google::protobuf::internal::MergeFromFail(__FILE__, __LINE__);
  }
  target_position_offsets_.MergeFrom(from.target_position_offsets_);
  offsets_.MergeFrom(from.offsets_);
  absolute_positions_.MergeFrom(from.absolute_positions_);
  if (from._internal_metadata_.have_unknown_fields()) {
    mutable_unknown_fields()->MergeFrom(from.unknown_fields());
  }
}

void AlignmentIndex::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:goby.AlignmentIndex)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

void AlignmentIndex::CopyFrom(const AlignmentIndex& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:goby.AlignmentIndex)
  if (&from == this) return;
  Clear();
  MergeFrom(from);
}

bool AlignmentIndex::IsInitialized() const {

  return true;
}

void AlignmentIndex::Swap(AlignmentIndex* other) {
  if (other == this) return;
  InternalSwap(other);
}
void AlignmentIndex::InternalSwap(AlignmentIndex* other) {
  target_position_offsets_.UnsafeArenaSwap(&other->target_position_offsets_);
  offsets_.UnsafeArenaSwap(&other->offsets_);
  absolute_positions_.UnsafeArenaSwap(&other->absolute_positions_);
  std::swap(_has_bits_[0], other->_has_bits_[0]);
  _internal_metadata_.Swap(&other->_internal_metadata_);
  std::swap(_cached_size_, other->_cached_size_);
}

::google::protobuf::Metadata AlignmentIndex::GetMetadata() const {
  protobuf_AssignDescriptorsOnce();
  ::google::protobuf::Metadata metadata;
  metadata.descriptor = AlignmentIndex_descriptor_;
  metadata.reflection = AlignmentIndex_reflection_;
  return metadata;
}

#if PROTOBUF_INLINE_NOT_IN_HEADERS
// AlignmentIndex

// repeated uint32 target_position_offsets = 1 [packed = true];
int AlignmentIndex::target_position_offsets_size() const {
  return target_position_offsets_.size();
}
void AlignmentIndex::clear_target_position_offsets() {
  target_position_offsets_.Clear();
}
 ::google::protobuf::uint32 AlignmentIndex::target_position_offsets(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentIndex.target_position_offsets)
  return target_position_offsets_.Get(index);
}
 void AlignmentIndex::set_target_position_offsets(int index, ::google::protobuf::uint32 value) {
  target_position_offsets_.Set(index, value);
  // @@protoc_insertion_point(field_set:goby.AlignmentIndex.target_position_offsets)
}
 void AlignmentIndex::add_target_position_offsets(::google::protobuf::uint32 value) {
  target_position_offsets_.Add(value);
  // @@protoc_insertion_point(field_add:goby.AlignmentIndex.target_position_offsets)
}
 const ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >&
AlignmentIndex::target_position_offsets() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentIndex.target_position_offsets)
  return target_position_offsets_;
}
 ::google::protobuf::RepeatedField< ::google::protobuf::uint32 >*
AlignmentIndex::mutable_target_position_offsets() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentIndex.target_position_offsets)
  return &target_position_offsets_;
}

// repeated uint64 offsets = 2 [packed = true];
int AlignmentIndex::offsets_size() const {
  return offsets_.size();
}
void AlignmentIndex::clear_offsets() {
  offsets_.Clear();
}
 ::google::protobuf::uint64 AlignmentIndex::offsets(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentIndex.offsets)
  return offsets_.Get(index);
}
 void AlignmentIndex::set_offsets(int index, ::google::protobuf::uint64 value) {
  offsets_.Set(index, value);
  // @@protoc_insertion_point(field_set:goby.AlignmentIndex.offsets)
}
 void AlignmentIndex::add_offsets(::google::protobuf::uint64 value) {
  offsets_.Add(value);
  // @@protoc_insertion_point(field_add:goby.AlignmentIndex.offsets)
}
 const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
AlignmentIndex::offsets() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentIndex.offsets)
  return offsets_;
}
 ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
AlignmentIndex::mutable_offsets() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentIndex.offsets)
  return &offsets_;
}

// repeated uint64 absolute_positions = 3 [packed = true];
int AlignmentIndex::absolute_positions_size() const {
  return absolute_positions_.size();
}
void AlignmentIndex::clear_absolute_positions() {
  absolute_positions_.Clear();
}
 ::google::protobuf::uint64 AlignmentIndex::absolute_positions(int index) const {
  // @@protoc_insertion_point(field_get:goby.AlignmentIndex.absolute_positions)
  return absolute_positions_.Get(index);
}
 void AlignmentIndex::set_absolute_positions(int index, ::google::protobuf::uint64 value) {
  absolute_positions_.Set(index, value);
  // @@protoc_insertion_point(field_set:goby.AlignmentIndex.absolute_positions)
}
 void AlignmentIndex::add_absolute_positions(::google::protobuf::uint64 value) {
  absolute_positions_.Add(value);
  // @@protoc_insertion_point(field_add:goby.AlignmentIndex.absolute_positions)
}
 const ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >&
AlignmentIndex::absolute_positions() const {
  // @@protoc_insertion_point(field_list:goby.AlignmentIndex.absolute_positions)
  return absolute_positions_;
}
 ::google::protobuf::RepeatedField< ::google::protobuf::uint64 >*
AlignmentIndex::mutable_absolute_positions() {
  // @@protoc_insertion_point(field_mutable_list:goby.AlignmentIndex.absolute_positions)
  return &absolute_positions_;
}

#endif  // PROTOBUF_INLINE_NOT_IN_HEADERS

// @@protoc_insertion_point(namespace_scope)

}  // namespace goby

// @@protoc_insertion_point(global_scope)
