Skip to content

A simple way to map gene names/accession numbers/UniProt IDs/etc to other denominations in a Pandas Dataframe

License

Notifications You must be signed in to change notification settings

maufadel/simpleGeneMapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

simpleGeneMapper

A simple class to map gene names/accession numbers/UniProt IDs/etc to other denominations in a dataframe.

How to use

To quickly map several ids in a Pandas dataframe, is enough to call the method map_genes and specify a few parameters:

from GeneMapper import GeneMapper
import pandas as pd

gm = GeneMapper()

full_data = pd.read_csv('dataframe.csv')
print(gm.map_genes(fr='STRING_ID', to='ACC',
                   df = full_data,
                   orig_cols = ['protein1', 'protein2'],
                   dest_cols = ['acc1', 'acc2']).head())

Also, if you would like to use your own mapping dictionary, you can use the method:

gm.add_mapping_to_df(df, final_map_dict, orig_cols, dest_cols)

About

A simple way to map gene names/accession numbers/UniProt IDs/etc to other denominations in a Pandas Dataframe

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages