message: set the reference before opening bams
  see if we can only set the cram ref if the file has the cram ending
  adds reset for a mix of bams and crams
  added debug statements
diff: @@ -67,19 +67,29 @@ void AlleleParser::openBams(void) {
  }
  #else
  +
  if (parameters.useStdin) {
  if (!bamMultiReader.Open("-")) {
  ERROR("Could not read BAM data from stdin");
  exit(1);
  }
  } else {
  - for (std::vector<std::string>::const_iterator i = parameters.bams.begin();
  - i != parameters.bams.end(); ++i)
  + for (std::vector<std::string>::const_iterator i = parameters.bams.begin(); i != parameters.bams.end(); ++i){
  + string b = *i;
  + // set reference to supplied fasta if the alignment file ends with cram
  + if(b.substr(b.size()-4).compare("cram") == 0){
  + DEBUG("Setting cram reference for bam reader")
  + bamMultiReader.SetCramReference(parameters.fasta);
  + }else{
  + // reset the reference if this alignment file is no cram
  + DEBUG("Unsetting cram reference for bam reader")
  + bamMultiReader.SetCramReference("");
  + }
  +
  if (!bamMultiReader.Open(*i)) {
  ERROR("Could not open input BAM file: " + *i);
  exit(1);
  - }
  - else {
  + }else {
  /*if (!bamMultiReader.LocateIndexes()) {
  ERROR("Opened BAM reader without index file, jumping is disabled.");
  cerr << bamMultiReader.GetErrorString() << endl;
  @@ -93,11 +103,13 @@ void AlleleParser::openBams(void) {
  }
  }*/
  }
  + }
  /*if (!bamMultiReader.SetExplicitMergeOrder(bamMultiReader.MergeByCoordinate)) {
  ERROR("could not set sort order to coordinate");
  cerr << bamMultiReader.GetErrorString() << endl;
  exit(1);
  }*/
  +
  }
  #endif
  