Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'str' has no attribute 'iteritems' #3

Open
gernophil opened this issue May 22, 2023 · 1 comment
Open

'str' has no attribute 'iteritems' #3

gernophil opened this issue May 22, 2023 · 1 comment

Comments

@gernophil
Copy link

gernophil commented May 22, 2023

For some ENST numbers and HGNC we run into the error AttributeError: 'str' object has no attribute 'iteritems' (whole error at the bottom). This happens because sometimes the edit_map becomes an empty string. I tried to follow the script, but I can't see where this happens, since the function get_edits always gets an empty dictfor edit_maps and just adds entries. I could dodge this error by adding the line if not isinstance(edit_map, str): between the lines 518 and 519. It works with this edit and get_snps should only return empty lists in this case, but I am not sure, if the results would still be correct. Do you see, why this happens and can you maybe evaluate, if my solution is reasonable?

Traceback (most recent call last):
  File "base_editing_guide_designs.py", line 1211, in <module>
    val = design_sgrnas(gene_name, assembly, chromosome, gene_id, w, tr_seq, abs_pos_map, fs, cds_map, utr, tr, pam, exons, gene_strand, edit_1, window, cds_sequence, len(pam), sg_len, cds_start_exon, w_error, w_clin, gene_variant_df, aa_map, input_type, intron_buffer, filter_gc)
  File "base_editing_guide_designs.py", line 1009, in design_sgrnas
    edit_map, window_silent, cds_error, num_stop, clinical_sig, snp_info, transcript_ref_allele, transcript_alt_allele, genome_ref_allele, genome_alt_allele = get_edit_info(context_for_trans, sgrna, sgrna_strand, edit, window, pam, sgrna_trans, codon_map, sg_gen_pos, gene_strand, gene_variant_df, aa_map, filter_gc, sgrna_context)
  File "base_editing_guide_designs.py", line 791, in get_edit_info
    snp_type_list, snp_info = get_snps(edit_map, edit, sg_gen_pos, gene_strand, sgrna_strand, gene_variant_df, aa_map)
  File "base_editing_guide_designs.py", line 519, in get_snps
    for k,v in edit_map.iteritems():
AttributeError: 'str' object has no attribute 'iteritems'
@mhegde
Copy link
Owner

mhegde commented Jun 1, 2023

That sounds like it could work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants