MDU-PHL / pango-collapse

app to collapse Pango lineages for reporting
https://mdu-phl.github.io/pango-collapse/
GNU General Public License v3.0
8 stars 1 forks source link

Have you seen the new `partial_compress` method? #2

Closed corneliusroemer closed 1 year ago

corneliusroemer commented 1 year ago

Didn't know you were making such good use of the little pango_aliasor package - didn't expect that!

I set up partial collapse yesterday to help keep the number of dots limited while teaching what the aliases mean.

Hence you can now compress B.1.1.529.5.2.1.1 to BA.5.2.1.1 instead of BF.1

Good choice of name "collapse" - better than my "compress" 👼

see https://github.com/corneliusroemer/pango_aliasor/releases/tag/v0.2.0 for details

Wytamma commented 1 year ago

Hey @corneliusroemer yes thanks for such a great package! It’s solving a bunch of problems for us.

I did see partial compress but couldn’t get it to go exactly what we wanted. We need to collapse all sub lineages up to a set of lineages that we can then report to the department of health.

I’d be happy to contribute back anything we can! Just needed a CLI so it was easier to make this one instead of thinking of a way to make it work generally 😅

corneliusroemer commented 1 year ago

Great! Can you give an example of what you mean by collapse up to a certain set?

It may be able to do that already or only with minor tweaks.

On Tue, Sep 6, 2022, 01:26 Wytamma Wirth @.***> wrote:

Hey @corneliusroemer https://github.com/corneliusroemer yes thanks for such a great package! It’s solving a bunch of problems for us.

I did see partial compress but couldn’t get it to go exactly what we wanted. We need to collapse all sublimates up to a set of lineages that we can then report to the department of health.

I’d be happy to contribute back anything we can! Just needed a CLI so it was easier to make this one instead of think of a way to make it work generally 😅

— Reply to this email directly, view it on GitHub https://github.com/MDU-PHL/pango-collapse/issues/2#issuecomment-1237522442, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF77AQLOOVKAAIQJNIUCYXLV4Z6RDANCNFSM6AAAAAAQFHYAIE . You are receiving this because you were mentioned.Message ID: @.***>

Wytamma commented 1 year ago

Essentially it's the collapse function here -> https://github.com/MDU-PHL/pango-collapse/blob/main/pango_collapse/collapsor.py#L9. You could just copy and paste that into your Aliasor class as i'm subclassing it anyway.

We have a set of lineages that we report to the department of health (e.g. https://github.com/MDU-PHL/pango-collapse/blob/main/pango_collapse/collapse.txt). All the sublineages of these lineages need to be collapsed into these lineages so that the report only contains the lineages in the collapse.txt file.