def determine_unknown_phreds(self, reads, phred64_reads, phred33_reads, unknown_phred_reads, reftoname):
    print('IN UNKNOWN CHECKING')
    eautils = kb_ea_utils(self.callbackURL)
    for ref in unknown_phred_reads:
        rds = reads[ref]
        obj_name = reftoname[ref]
        files_to_check = []
        f = rds['files']
        if (f['type'] == 'interleaved'):
            files_to_check.append(f['fwd'])
        elif (f['type'] == 'paired'):
            files_to_check.append(f['fwd'])
            files_to_check.append(f['rev'])
        elif (f['type'] == 'single'):
            files_to_check.append(f['fwd'])
        for file_path in files_to_check:
            ea_stats_dict = eautils.calculate_fastq_stats({'read_library_path': file_path})
            if (ea_stats_dict['phred_type'] == '33'):
                phred33_reads.add(obj_name)
            elif (ea_stats_dict['phred_type'] == '64'):
                phred64_reads.add(obj_name)
            else:
                raise ValueError((('Reads object {} ({}) phred type is not of the ' + 'expected value of 33 or 64. It had a phred type of ') + '{}').format(obj_name, rds, ea_stats_dict['phred_type']))
    return (phred64_reads, phred33_reads)
def determine_unknown_phreds(self, reads, phred64_reads, phred33_reads, unknown_phred_reads, reftoname):
    print('IN UNKNOWN CHECKING')
    eautils = kb_ea_utils(self.callbackURL)
    for ref in unknown_phred_reads:
        rds = reads[ref]
        obj_name = reftoname[ref]
        files_to_check = []
        f = rds['files']
        if (f['type'] == 'interleaved'):
            files_to_check.append(f['fwd'])
        elif (f['type'] == 'paired'):
            files_to_check.append(f['fwd'])
            files_to_check.append(f['rev'])
        elif (f['type'] == 'single'):
            files_to_check.append(f['fwd'])
        for file_path in files_to_check:
            ea_stats_dict = eautils.calculate_fastq_stats({'read_library_path': file_path})
            if (ea_stats_dict['phred_type'] == '33'):
                phred33_reads.add(obj_name)
            elif (ea_stats_dict['phred_type'] == '64'):
                phred64_reads.add(obj_name)
            else:
                raise ValueError((('Reads object {} ({}) phred type is not of the ' + 'expected value of 33 or 64. It had a phred type of ') + '{}').format(obj_name, rds, ea_stats_dict['phred_type']))
    return (phred64_reads, phred33_reads)