private Map<String, Reference> getReferences(ReadGroupSet readGroupSet) 
      throws IOException, GeneralSecurityException {
    Set<String> referenceSetIds = Sets.newHashSet();
    if (!Strings.isNullOrEmpty(readGroupSet.getReferenceSetId())) {
      LOG.info("Found reference set from read group set: " + 
          readGroupSet.getReferenceSetId());
      referenceSetIds.add(readGroupSet.getReferenceSetId());
    }
    if (readGroupSet.getReadGroups() != null) {
      LOG.info("Found read groups");
      for (ReadGroup readGroup : readGroupSet.getReadGroups()) {
        if (!Strings.isNullOrEmpty(readGroup.getReferenceSetId())) {
          LOG.info("Found reference set from read group: " + 
              readGroup.getReferenceSetId());
          referenceSetIds.add(readGroup.getReferenceSetId());
        }
      }
    }
    
    Map<String, Reference> references = Maps.newHashMap();
    for (String referenceSetId : referenceSetIds) {
      LOG.info("Getting reference set " + referenceSetId);
      ReferenceSet referenceSet = getApi().referencesets().get(referenceSetId).execute();
      if (referenceSet == null || referenceSet.getReferenceIds() == null) {
        continue;
      }
      for (String referenceId : referenceSet.getReferenceIds()) {
        LOG.fine("Getting reference  " + referenceId);
        Reference reference = getApi().references().get(referenceId).execute();
        if (!Strings.isNullOrEmpty(reference.getName())) {
          references.put(reference.getName(), reference);
          LOG.fine("Adding reference  " + reference.getName());
        }
      }
    }
    return references;
  }
private Map < String , Reference > getReferences ( ReadGroupSet readGroupSet ) throws IOException , GeneralSecurityException { Set < String > referenceSetIds = Sets . newHashSet ( ) ; if ( ! Strings . isNullOrEmpty ( readGroupSet . getReferenceSetId ( ) ) ) { LOG . info ( "Found reference set from read group set: " + readGroupSet . getReferenceSetId ( ) ) ; referenceSetIds . add ( readGroupSet . getReferenceSetId ( ) ) ; } if ( readGroupSet . getReadGroups ( ) != null ) { LOG . info ( "Found read groups" ) ; for ( ReadGroup readGroup : readGroupSet . getReadGroups ( ) ) { if ( ! Strings . isNullOrEmpty ( readGroup . getReferenceSetId ( ) ) ) { LOG . info ( "Found reference set from read group: " + readGroup . getReferenceSetId ( ) ) ; referenceSetIds . add ( readGroup . getReferenceSetId ( ) ) ; } } } Map < String , Reference > references = Maps . newHashMap ( ) ; for ( String referenceSetId : referenceSetIds ) { LOG . info ( "Getting reference set " + referenceSetId ) ; ReferenceSet referenceSet = getApi ( ) . referencesets ( ) . get ( referenceSetId ) . execute ( ) ; if ( referenceSet == null || referenceSet . getReferenceIds ( ) == null ) { continue ; } for ( String referenceId : referenceSet . getReferenceIds ( ) ) { LOG . fine ( "Getting reference  " + referenceId ) ; Reference reference = getApi ( ) . references ( ) . get ( referenceId ) . execute ( ) ; if ( ! Strings . isNullOrEmpty ( reference . getName ( ) ) ) { references . put ( reference . getName ( ) , reference ) ; LOG . fine ( "Adding reference  " + reference . getName ( ) ) ; } } } return references ; }
Collect a list of references mentioned in this Readgroupset and get their meta data.
@throws GeneralSecurityException
@throws IOException