Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def all_uni_present(uni_list, uniprot_folder):
- uni_missing = []
- progress = ProgressBar(
- len(uni_list),
- start_msg="Verify that UniProt IDs are identical between DataFrames.",
- end_msg="Verification complete."
- )
- for uni in uni_list:
- uni_path = os.path.join(uniprot_folder, uni + '.fasta')
- if not os.path.exists(uni_path):
- uni_missing.append(uni)
- else:
- try:
- with open(uni_path, 'r', encoding='utf-8') as uni_fh:
- _ = SeqIO.read(uni_fh, "fasta").seq
- except ValueError:
- os.remove(uni_path)
- uni_missing.append(uni)
- progress.inc()
- return uni_missing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement