Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dburkhardt opened this issue Jun 12, 2019 · 2 comments
Open

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

dburkhardt opened this issue Jun 12, 2019 · 2 comments

Comments

@dburkhardt
Copy link
Member

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

@dburkhardt dburkhardt self-assigned this Jun 12, 2019
@scottgigante
Copy link
Contributor

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

  • data with column names gene_list
  • a separate list of genes called my_list

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

@scottgigante
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants