lczech / gappa

A toolkit for analyzing and visualizing phylogenetic (placement) data
GNU General Public License v3.0
56 stars 7 forks source link

Tabular assignment output #5

Closed boopsboops closed 5 years ago

boopsboops commented 5 years ago

Hi there. Quick question ...

Is is possible to have a tabular output of gappa analyze assign, where the queries are in the same row as the other values.

It would look like this: Query\t1\t1\t1\t1\tReference1\n Query\t1\t1\t1\t1\tReference2\n

Rather than like this: Query\n 1\t1\t1\t1\tReference1\n t1\t1\t1\t1\tReference2\n

You probably won't want to change the output of the program, but maybe you know a handy regex or something to reformat?

Cheers!

boopsboops commented 5 years ago

The good people on Stack Overflow provided a solution:

awk '/^otu/{val=$0;next}{OFS="\t"} {print val,$0}' per_pquery_assign > new

All my queries began with "otu" but this can be changed for something else that can be easily regexed.

lczech commented 5 years ago

Hi @boopsboops,

thanks for the suggestion. I also had a similar issue before, which back then I solved similarly to your solution. Thanks for also posting the awk command!

Anyway, it is of course better to use a more consistent output format, such as the one you suggested. So this is what we did now. Please download the release of gappa v0.2.0, and see the assign documentation for details of the new formats!

If there are any issues with the new release or the changes to the format, let us know!

Best Lucas