biosustain / genomediff-python

GenomeDiff (*.gd) file parser for Python
MIT License
2 stars 5 forks source link

<genomediff.records.Record at 0x**********> #6

Open antanij opened 1 year ago

antanij commented 1 year ago

The code seems to be reading in the file fine: metadata and mutations[0].parent_ids output correctly. However, the output for

document.mutations[0] is <genomediff.records.Record at 0x1fe87dfa550>

Am I missing something trivial?

Slightly related: can I get the Records data as a table?

jeffreybarrick commented 1 year ago

Is this a coding question or a question about using a gdtools command?

If you are printing from the C++ code and want it to output the contents of the entry versus the address of the pointer, use this syntax:

cout << document.mutations[0].as_string() << endl;

In a terminal, you can output the contents of a GD file as a table using a gdtools ANNOTATE command like this:

gdtools ANNOTATE -f CSV -r reference.gb -o output.csv input.csv 

Let me know if this doesn't address your goal!

EDIT: Whoops, I see this is about the Python version of things... I'm not familiar with that interface.

antanij commented 1 year ago

Your response is a MUCH more effective way to achieve my end goal: programmatically extracting mutations in a particular gene locus. I am working with tens of WGS directories consisting breseq outputs- hence the need to do this programmatically. Your response resolved my problem.

Thank you so much for noticing and addressing this Issue!