Coder Social home page Coder Social logo

Comments (22)

alimanfoo avatar alimanfoo commented on September 10, 2024

@cclarkson here's some food for discussion tomorrow:

image

...this is a clustering of haplotypes carrying L995S. Only distinct haplotypes are used to construct the tree. Haplotype frequencies are shown in the adjacent bar plot. Shaded regions show the 5 largest clusters by a method I'll explain tomorrow - I'm thinking we show one network for each of these 5 clusters.

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

Hey @cclarkson, maybe Python is an option after all, I made this with graphviz:

image

cc @hardingnj.

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

That's great, will be cool if we could keep most of it in python. Looking forward to seeing the code.

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

Making some progress, here's a network with some real data, the Kenya/Uganda L995S cluster:

image

Will turn this into a usable function and share asap.

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

Still not sure how to figure out which edge has which mutation, that may be tricky...

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

Hi @alimanfoo ,

Just to document the TCS comparison, almost all clusters produced identical networks to your function, except for 995F8, which TCS did not circularise and 995F16, which added a number of loops compared to the one you generated - see below (I tried to lay it out the same to compare but TCS kept crashing, this is best I managed, the bottom right hand corner is a bit messy!).

995f_cluster16_tcscomp

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

Thanks Chris. Can you compare with the networks I made using median-joining? They should be in the (recently updated) hapclust_demo notebook, look out for the calls to graph_haplotype_network(..., network_method='mjn'). What you have above in TCS looks very similar to what I made with MJN...

image

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

@alimanfoo

Yep, I'm pretty sure that is the same as the TCS one, interesting.

ION - having a problem getting graphviz to work due to neato - how did you fix that problem?

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

No worries, think I've cracked it.

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

Hi @alimanfoo ,

Now I've got this all up and running again, I was just trying to plot multiple networks on one figure but I'm struggling. I can't see how to get it to use an 'ax', is this because it is just a wrapper for external code and can't talk to matplotlib?

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

Hi @alimanfoo ,

I'm trying to find a nice way to bring the dendrogram together with the clusters but I'm struggling to work out how to give the fig_haplotypes_clustered function (from haplclust_utils) an ax to plot on in my composite figure because the dendrogram function is already a composite figure. Any pointers would be gratefully received!

Cheers, C.

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

test_fig

Been flailing at this for a while and I think I am finally getting somewhere! I'm now trying to work out how to colour the network's backgrounds like the dendrogram (and align/scale things in a less awful way).

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

As far as I can see, the importing of the graphviz image as an image array means that you can't overlay or 'draw' on top of those arrays. I'm going to try an kick out the graphviz stuff in a vector format so that I can build something a bit like this:
inkscape_example_vgsc_netclustfig
I think this figure could then be quite small, losing the fine network details, but we could have individual figures for the clusters of interest. What do you think?

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

Hi @alimanfoo,

This was what I was trying to do with just code, but I resorted to a bit of Inkscape in the end. Looks okay, but we would need to make it clear that the network nodes are not to scale across networks, they are just relative to that cluster. Just going to make the stand alone for cluster 16.

vgsc_netclustfig

-Should I push on with this format for 995S?
-What do you think about leaving the colony haplotypes in this analysis?
-At some stage I saw the network function able to add the size of node (number of haps) to the figure, I'm trying to find this to make a size key, is it still there?

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

Hi @alimanfoo

Not sure how I feel about the overlapping nodes, but they can all be re-arranged nicely in Inkscape if we decide to use this type of figure...

995f_cluster_16_standalone_rededge

from ag1000g-phase1-vgsc-report.

cclarkson avatar cclarkson commented on September 10, 2024

Figure 2 (draft) - haplogroup distance and frequency
figure2_dendfreq_draft

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

from ag1000g-phase1-vgsc-report.

alimanfoo avatar alimanfoo commented on September 10, 2024

Superseded by #69 and #73.

from ag1000g-phase1-vgsc-report.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.