'Returns an HDA that points to a metadata file which contains a
converted data with the requested extension.'

def get_metadata_dataset(self, dataset_ext):

    for (name, value) in self.metadata.items():
        if ((dataset_ext == 'bai') and (name == 'bam_index') and isinstance(value, MetadataFile)):
            fake_dataset = Dataset(state=Dataset.states.OK, external_filename=value.file_name)
            fake_hda = HistoryDatasetAssociation(dataset=fake_dataset)
            return fake_hda
