>sp|Q6GZX2|003R_FRG3G (438 aa) Uncharacterized protein 3R. [Frog virus 3 (isolate Goorha) (FV-3)] MARPLLGKTSSVRRRLESLSACSIFFFLRKFCQKMASLVFLNSPVYQMSNILLTERRQVDRAMGGSDDDGVMVVALSPSD FKTVLGSALLAVERDMVHVVPKYLQTPGILHDMLVLLTPIFGEALSVDMSGATDVMVQQIATAGFVDVDPLHSSVSWKDN VSCPVALLAVSNAVRTMMGQPCQVTLIIDVGTQNILRDLVNLPVEMSGDLQVMAYTKDPLGKVPAVGVSVFDSGSVQKGD AHSVGAPDGLVSFHTHPVSSAVELNYHAGWPSNVDMSSLLTMKNLMHVVVAEEGLWTMARTLSMQRLTKVLTDAEKDVMR AAAFNLFLPLNELRVMGTKDSNNKSLKTYFEVFETFTIGALMKHSGVTPTAFVDRRWLDNTIYHMGFIPWGRDMRFVVEY DLDGTNPFLNTVPTLMSVKRKAKIQEMFDNMVSRMVTS 2 - 9: ArpllGKT
def get_sequence(): try: with open("Filename.txt") as f: file = f.readlines() raw_data = '' start_reading = False for line in file: if line.startswith(">"): start_reading = True if start_reading: raw_data += line sequence = raw_data.split(">") sequence = sequence[1:] except IOError: print('Some meaningfull message') quit() finally: print(sequence) print(sequence) dict(sequence) return sequence
My question is how can I convert the list sequence to a dictionary? It would be really nice if the organism is the key and the value is a list of the other data. The dict() method raises a ValueError.
This is a school assignment, so I'm not allowed to use BioPython.
Thanks in advance!