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

genebe annotate #5

Open
lmanchon opened this issue Jan 22, 2025 · 2 comments
Open

genebe annotate #5

lmanchon opened this issue Jan 22, 2025 · 2 comments

Comments

@lmanchon
Copy link

--Hi,

is "genebe annotate" command line can handle csv or tsv input file and output as same format ?

thank you --

@pstawinski
Copy link
Owner

Hi,

no, but this can be easily achieved using really simple Python script and pandas.

Here is simple code showing what you can do, instead of creating a dataframe load it from the csv file.

import pandas as pd

df = pd.DataFrame({
   'chr': ['chr1', 'chr2', 'chr1', 'chr3', 'chr2'],
   'pos': [1234567, 2345678, 3456789, 4567890, 5678901],
   'ref': ['A', 'C', 'G', 'T', 'G'],
   'alt': ['T', 'G', 'C', 'A', 'C']
})

import genebe as gnb
annotated = gnb.annotate_dataframe_variants(df,use_ensembl=False,use_refseq=True, genome='hg38', flatten_consequences=True)

annotated.to_csv('/tmp/output.tsv', sep='\t', index=False)

I hope this helps.

@lmanchon
Copy link
Author

-Hi,

yes, you are right, i'm going to do that.
thank you --

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

No branches or pull requests

2 participants