KrishnaswamyLab / scprep

A collection of scripts and tools for loading, processing, and handling single cell data.
MIT License
72 stars 19 forks source link

Helper function to search if `gene` in `dataframe.columns` #46

Open dburkhardt opened 5 years ago

dburkhardt commented 5 years ago

Need to think about this more, but say I have a gene list from a collaborator and some are correct gene symbols, but others aren't, I currently do this:

for gene in my_list:
    if gene not in gene_list:
        print(gene)
        for g in gene_list:
            if gene[:3] in g:
                print('    ' + g)

Would be nice to have a helper function here

scottgigante commented 5 years ago

Just so I understand the use case here, you have:

and you want to know the closest string match(es) in gene_list of each value of my_list?

scottgigante commented 5 years ago

https://stackoverflow.com/a/10018734/3996580 might be a valid direction to take this.