Package: proharmed
ProHarMeD - Proteomic Meta-Study Harmonization, Mechanotyping and Drug Repurposing Prediction##IntroductionTODOThis repository comprises four main harmonization functionalities:filter protein IDsremap gene namesreduce gene namesmap orthologsAdditionally, it offers following meta anylsis functionalities:intersection anaysisdisease mechanism mining and drug repurposingA detailed tutorial with example data on how to use the mqhandler python package can be foundhere.Installationpipinstallmqhandler1. Filter Protein IDsFor a protein assignment using MaxQuant, Fasta files are required. Since MaxQuant can also be used to run several data collectively,
it can also happen that results are provided with protein IDs of several organisms.This method makes it possible to check the protein IDs for their organism by directly accessing the Uniprot database, and to
remove incorrectly assigned IDs. Additionally, decoy (REV_) and contaminants (CON_) IDs and/or unreviewed protein IDs can be removed.One might be interested to know how many IDs were filtered out, in total and per row. Therefore, with this call, you can generate 2 data frames that display this information as a table.In addition to the information as a table, it can also be displayed directly as plots with a simple call.1.1 Importsimportpandasaspdfromproharmedimportfilter_idsasfifromproharmed.mq_utils.runner_utilsimportfind_delimiter1.2 Load Your Data# load data into a dataframe with automated delimiter finderdata=pd.read_table(file,sep=find_delimiter(<file>)).fillna("")1.3 Set Preferences# mandatoryprotein_column="Protein IDs"# Name of column with protein IDs# optionalorganism="rat"# Specify organism the IDs should match torev_con=False# Bool to indicate if protein IDs from decoy (REV__) and contaminants (CON__) should be keptreviewed=False# Bool to indicate if newly retrieved protein IDS should be reduced to reviewed oneskeep_empty=False# Bool to indicate if empty ID cells should be kept or deletedres_column=None# Name of column for filer protein IDs results. If None, the protein_column will be overridden1.4 Run filter_protein_idsfi_data,fi_log_dict=fi.filter_protein_ids(data=data,protein_column=protein_column,organism=organism,rev_con=rev_con,keep_empty=keep_empty,reviewed=reviewed,res_column=res_column)1.5 Inspect Loggingfromproharmed.mq_utilsimportplottingasptpt.create_overview_plot(fi_log_dict["Overview_Log"],out_dir=out_dir)pt.create_filter_detailed_plot(fi_log_dict["Detailed_Log"],organism=organism,reviewed=reviewed,decoy=rev_con,out_dir=out_dir)2. Remap Gene NamesBesides protein IDs, gene names are also taken out of the respective Fasta files and mapped. These are needed for easier naming in plots and in analytical procedures such as enrichment analysis. Unfortunately, Fasta files are not always complete in terms of gene names.This method makes it possible to retrieve the assigned gene names based on the protein IDs with direct access to the Uniprot database and to fill the empty entries in the user file or even replace existing entries. There are multiple possible modes for which names should be taken.Here, too, it is possible to subsequently obtain information on how many gene names were found for how many rows.2.1 Importsimportpandasaspdfromproharmedimportremap_genenamesasrmgfromproharmed.mq_utils.runner_utilsimportfind_delimiter2.2 Load Your Data# load data into a dataframe with automated delimiter finderdata=pd.read_table(file,sep=find_delimiter(<file>)).fillna("")2.3 Set Preferences# mandatorymode="uniprot_primary"# Mode of refilling. See below for more infos.protein_column="Protein IDs"# Name of column with protein IDs# optionalgene_column="Gene names"# Name of column with gene namesskip_filled=False# Bool to indicate if already filled gene names should be skippedorganism="rat"# Specify organism the IDs should match tofasta=None# Path of Fasta file when mode all or fastakeep_empty=False# Bool to indicate if empty gene names cells should be kept or deletedres_column=None# Name of column for remap gene names results. If None, the gene_column will be overriddenModes of refilling:all: use primarily fasta infos and additionally uniprot infosfasta: use information extracted from fasta headersuniprot: use mapping information from uniprot and use all gene namesuniprot_primary: use mapping information from uniprot and only all primary gene namesuniprot_one: use mapping information from uniprot and only use most frequent single gene name2.4 Run remap_genenamesrmg_data,rmg_log_dict=rmg.remap_genenames(data=data,mode=mode,protein_column=protein_column,gene_column=gene_column,skip_filled=skip_filled,organism=organism,fasta=fasta,keep_empty=keep_empty,res_column=res_column)3. Reduce Gene NamesA well-known problem with gene symbols is that they are not unique and slight changes in spelling can lead to problems. Often there are different gene symbols for the same gene in UniProt. Depending on which protein IDs you used to get the gene symbol, you can get multiple gene symbols for the same gene by using the previous remap function.This method makes it possible to reduce the gene symbols to a common gene symbol using different features and databases, thus preventing redundancy. There are multiple possible modes for which names should be taken.Here, too, it is possible to subsequently obtain information on how many gene names were reduced for how many rows. This can also be displayed as a plot with a simple call.3.1 Importsimportpandasaspdfromproharmedimportreduce_genenamesasrdgfromproharmed.mq_utils.runner_utilsimportfind_delimiter3.2 Load Your Data# load data into a dataframe with automated delimiter finderdata=pd.read_table(file,sep=find_delimiter(<file>)).fillna("")3.3 Set Preferences# mandatorymode="ensembl"# Mode of reduction. See below for more infos-gene_column="Gene names"# Name of column with gene namesorganism="rat"# Specify organism the IDs should match to# optionalres_column=False# Name of column of reduced gene names results. If None, the gene_column will be overriddenkeep_empty=False# Bool to indicate if empty reduced gene names cells should be kept or deletedHGNC_mode=None# Mode on how to reduce the gene names using HGNC (mostfrequent, all)Modes of reduction:ensembl: use gProfiler to reduce gene names to those having an Ensembl IDHGNC: use HGNC database to reduce gene names to those having an entry in HGNC (only for human)mygeneinfo: Use mygeneinfo database to reduce gene names to those having an entry in mygeneinfoenrichment: Use gProfiler to reduce gene names to those having a functional annotation3.4 Run reduce_genenamesrdg_data,rdg_log_dict=rdg.reduce_genenames(data=rmg_data,mode=mode,gene_column=gene_column,organism=organism,res_column=res_column,keep_empty=keep_empty,HGNC_mode=HGNC_mode)3.5 Inspect Loggingfromproharmed.mq_utilsimportplottingasptpt.create_overview_plot(rdg_log_dict["Overview_Log"],out_dir=out_dir)pt.create_reduced_detailed_plot(rdg_log_dict["Detailed_Log"],out_dir=out_dir)4. Get OrthologsSuppose you want to compare data between organisms, for example if you want to do a review across several species, you come across a known problem. Gene names differ between species, making it necessary to map all IDs to a selected organism through an ortholog mapping.Using the commonly used gProfiler, this method simply maps the gene names from the current organism to the target organism.Unfortunately, depending on the original and target organism, there are more or less cases where no orthologous gene could be found. For a simplified overview of how many cases this was the case, this method can be used to obtain this information.As with the previous tasks, the log information can be displayed in plots.3.1 Importsimportpandasaspdfromproharmedimportmap_orthologsasmofromproharmed.mq_utils.runner_utilsimportfind_delimiter3.2 Load Your Data# load data into a dataframe with automated delimiter finderdata=pd.read_table(file,sep=find_delimiter(<file>)).fillna("")3.3 Set Preferences# mandatorygene_column="Gene names"# Name of column with gene namessource_organism="rat"# Specify organism the IDs match totar_organism="human"# Specify organism the IDs should me mapped to# optionalkeep_empty=False# Bool to indicate if empty ortholog gene names cells should be kept or deletedres_column=None# Name of column of orthologs gene names results. If None, the gene_column will be overridden```3.4 Run map_orthologsmo_data,mo_log_dict=mo.map_orthologs(data=data,gene_column=gene_column,organism=source_organism,tar_organism=tar_organism,keep_empty=keep_empty,res_column=res_column)3.5 Inspect Loggingfromproharmed.mq_utilsimportplottingasptpt.create_overview_plot(mo_log_dict["Overview_Log"],out_dir=out_dir)pt.create_ortholog_detailed_plot(mo_log_dict["Detailed_Log"],organism=organism,out_dir=out_dir)