Skip to content

Instantly share code, notes, and snippets.

@StephenFordham
Created May 3, 2019 08:52
Show Gist options
  • Save StephenFordham/bb9dbc2993aa8d3d44a3ffa95aca61e9 to your computer and use it in GitHub Desktop.
Save StephenFordham/bb9dbc2993aa8d3d44a3ffa95aca61e9 to your computer and use it in GitHub Desktop.
creating_dictionaries
Ref_dict = dict(zip(Reference_species, Reference_sequences))
Unknown_dict = dict(zip(my_unknown_id, my_unknown_seq))
print(Ref_dict)
print(Unknown_dict)
Output:
{'A': 'AAAAGCGCGAGGGGGGA', 'K': 'GGGAGAGAGGG', 'Y': 'CGGAGCGTTT', 'T': 'TTTTAGAGAGCTCTG', 'P': 'TAGAGAGCGGCC', 'E': 'GAAGGCGCT', 'V': 'TATAGCGCGCG', 'M': 'TAGAGCGCGA', 'N': 'GGCTCCGG
GAGA', 'Q': 'GGGGCCCCCATA'}
{1: 'AGCGCGAGGGGGGA', 2: 'GGGAGAGA', 3: 'CGGAGCGTTT', 4: 'TAGCTGAGA', 5: 'TAGAGAGCGGCC', 6: 'GAAGGCGCT', 7: 'TATAGCGCGCG', 8: 'TAGAGCGCGA', 9: 'GAGGCTCCGGGAGA', 10: 'GGGGCCCCCATA'}
@ihamieh
Copy link

ihamieh commented Apr 6, 2021

hi Stephen, I was trying to use this code but I keep getting the following error message:
ValueError: dictionary update sequence element #0 has length 3; 2 is required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment