Created
May 4, 2021 21:16
-
-
Save oeway/6de9195fd193e346106fac2715aca886 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gzip | |
# download idmapping.dat.gz from uniprot | |
# wget ftp://ftp.ebi.ac.uk/pub/databases/uniprot/current_release/knowledgebase/idmapping/idmapping.dat.gz | |
id_mapping_file = './idmapping.dat.gz' | |
id_mapping = {} | |
for line in gzip.open(id_mapping_file): | |
line = line.decode('utf8').strip() | |
ac, pred, obj = line.split('\t') | |
if pred == 'Ensembl': | |
print(obj) | |
id_mapping[ac] = obj |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment