mhegde / base-editor-design-tool

This tool designs guides for use with the base editor technology.
11 stars 7 forks source link

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

Open ChiaraBecht opened 6 months ago

ChiaraBecht commented 6 months ago

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_editpos].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