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

AttributeError: 'dict_values' object has no attribute 'index' TypeError: 'int' object is not subscriptable #6

Open
ChiaraBecht opened this issue Apr 19, 2024 · 0 comments

Comments

@ChiaraBecht
Copy link

While executing the base-editor-design-tool I ran into the following issue:
python3 base_editing_guide_designs.py --input-file /Downloads/input.txt --input-type tid --be-type BE4max --intron-buffer 18 --output-name results --variant-file /Downloads/variant_summary1.txt --filter-gc True

/base-editor-design-tool/base_editing_guide_designs.py:446: FutureWarning: In a future version of pandas all arguments of StringMethods.split except for the argument 'pat' will be keyword-only.
parsed_variant_df.loc[:,'RefSeqID'] = parsed_variant_df.loc[:,'Name'].str.split('(',1).str[0]
Designing for xx
Traceback (most recent call last):
File "/base-editor-design-tool/base_editing_guide_designs.py", line 1218, in
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, 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-editor-design-tool/base_editing_guide_designs.py", line 1009, in design_sgrnas
sg_gen_pos = abs_pos.keys()[abs_pos.values().index(sgrna_start_pos)]
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'dict_values' object has no attribute 'index'

I fixed this by using another implementation, but now I am running into a new issue which is this:
File "/home/chiara/base-editor-design-tool/base_editing_guide_designs.py", line 1224, in
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, 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 "/home/chiara/base-editor-design-tool/base_editing_guide_designs.py", line 1017, 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-editor-design-tool/base_editing_guide_designs.py", line 791, in get_edit_info
edit_map, window_silent, cds_error, num_stop, transcript_ref_allele, transcript_alt_allele, genome_ref_allele, genome_alt_allele = get_edits(edit_map,context,sgrna_window,edit,sgrna_trans,codon_map,j_window,sgrna_strand,pam,int(window_start),int(window_end), aa_map,filter_gc, sgrna_context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/base-editor-design-tool/base_editing_guide_designs.py", line 670, in get_edits
aa_num,frame = sgrna_trans[nuc_edit_pos].split('_')
~~~~~~~~~~~^^^^^^^^^^^^^^
TypeError: 'int' object is not subscriptable

When i print out sgrna_trans it is a number (int) and nuc_edit_pos is a string. I am not quite sure how to approach this. Thanks for any recommendation on the topic

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

1 participant