Package: hpo-downloader
hpo_downloaderPython package to downloadHPO annotationsand mapping toUniprot ID and ACandCAFA4 IDs.How do I install this package?As usual, just download it using pip:pipinstallhpo_downloaderTests CoverageSince some software handling coverages sometime get
slightly different results, here’s three of them:PipelineThe package pipeline is illustrated in the following image:PreprocessingFor thepre-processingyou have to retrieve theuniprot mapping files by asking directly to the Uniprot teamsince each mapping is aroung 17GB.
Let’s save each file in a directory within this repository called"mapping/{month}/idmapping.dat.gz".Cache for the pre-processing results is availablewithin the python package,so there is no need to retrieve the originalfiles unless you need to fully reproduce the pipeline.For each release, we have to retrieve the"GeneID"and the human uniprot_IDs, and we can do so usingzgrep.zgrep"GeneID"mapping/{month}/idmapping.dat.gz>gene_id.tsvzgrep"HUMAN"mapping/{month}/idmapping.dat.gz>human_id.tsvNow we have to map in a non-bijective way uniprot IDs
to GeneIDs on the uniprot ACs.
We can use the package methodnon_unique_mapping.fromhpo_downloader.utilsimportnon_unique_mappingimportpandasaspdgene_id=pd.read_csv(f"mapping/{month}/gene_id.tsv",sep="\t",header=None,usecols=[0,2])gene_id.columns=["uniprot_ac","gene_id"]human_id=pd.read_csv(f"mapping/{month}/human_ids.tsv",sep="\t",header=None,usecols=[0,2])human_id.columns=["uniprot_ac","uniprot_id"]non_unique_mapping(gene_id,human_id,"uniprot_ac").to_csv(f"hpo_downloader/uniprot/data/{month}.tsv.gz",sep="\t",index=False)Package usage examplesTo generate the complete mapping (optionally filtering only
for Uniprot IDs within CAFA4) proceed as follows:fromhpo_downloaderimportmappingmy_mapping=mapping(month="november")my_mapping_cafa_only=mapping(month="november",cafa_only=True)The obtainedpandas DataFrameslook as follows:HPO mappings:October,November,Decembergene_idhpo_iduniprot_acuniprot_id8192HP:0004322Q16740CLPP_HUMAN8192HP:0001250Q16740CLPP_HUMAN8192HP:0000786Q16740CLPP_HUMAN8192HP:0000007Q16740CLPP_HUMAN8192HP:0000252Q16740CLPP_HUMANHPO mappings (CAFA4 only):October (CAFA only),November (CAFA only),December (CAFA only)cafa4_iduniprot_idgene_idhpo_iduniprot_acT960600000021433E_HUMAN7531HP:0000960P62258T960600000021433E_HUMAN7531HP:0001539P62258T960600000021433E_HUMAN7531HP:0002119P62258T960600000021433E_HUMAN7531HP:0002120P62258T960600000021433E_HUMAN7531HP:0000463P62258Author notesHPO missing GeneID mappingsAround 54 to 55 GeneID to Uniprot IDs mapping are currently missing in Uniprot.
I have already signaled this to the Uniprot team
and will update the package accordingly,
if anything is to be made about these.MonthHPO unique missed samplesHPO unique missed percentageHPO total missed samplesHPO total missed percentageOctober541.26%30761.86%November551.28%31621.91%December551.28%31621.91%HPO phenotype ID to CAFA4 Uniprot_IDs missed mappingsA considerable percentage (around 80%) of the HUMAN uniprot IDs used in CAFA4
are not mappable to the HPO phenotype IDs.MonthCAFA4 unique missed samplesCAFA4 unique missed percentageCAFA4 total missed samplesCAFA4 total missed percentageOctober1618279.21%1618279.21%November1618479.22%1618479.22%December1618779.23%1618779.23%