def getPercentAltered(self, gene_list, study=None, study_name=None,
                          case_set_id=None, genetic_profile_id=None,
                          threshold=2):

        study = self._getStudyId(study, study_name)
        case_set_id = self._getCaseListId(case_set_id, study)
        genetic_profile_id = self._getAndCheckGeneticProfiles(
            genetic_profile_id, study)

        if study and study == self.study:
            profiles = self.profiles
            case_list = [x['case_ids']
                         for x in self.cases
                         if x['case_list_id'] == case_set_id][0]

        else:
            profiles = self.getGeneticProfiles(study)
            case_list = [x['case_ids'] for x in self.getCaseLists(
                study) if x['case_list_id'] == case_set_id][0]

        return_table = []
        case_list = case_list.split(" ")

        data = []
        warnings = []
        for profile in genetic_profile_id:

            data.append(self.getProfileData(
                gene_list=gene_list, case_set_id=case_set_id,
                genetic_profile_id=[profile]))
            warnings.extend(self.last_warnings)

        # data[profile][gene][case]
        for gene in range(len(data[0])):
            cases_altered = 0.0

            geneProfile = [x[gene] for x in data]

            for case in (set(geneProfile[0]) - set(["gene_id", "common"])):
                if len([geneProfile[x][case] for x in range(len(geneProfile))
                        if self._guessAlteration(
                            geneProfile[x][case],
                            genetic_profile_id[x], profiles)]) > 0:

                    cases_altered += 1

            return_table.append(
                dict({'gene_id': geneProfile[0]['GENE_ID'],
                      'common': geneProfile[0]['COMMON'],
                      'altered_in': cases_altered * 100 / len(case_list)}))

        self.last_warnings = warnings
        return return_table

##########################################################################
Get the percent of cases that have one or more of the specified
dataset/ETHPy150Open CGATOxford/cgat/CGAT/CBioPortal.py/CBioPortal.getPercentAltered