Code Monkey home page Code Monkey logo

gganatogram's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gganatogram's Issues

Add eyes + ears

This is my new favourite package - thank you so much!

Is it possible to add eyes and ears?

Thank you again

Venous System

Your package is awesome. It could be possible to have also a depiction of the human venous system to add along with the arteries?
Minor issue... the descending aorta does not match with the circulatory system when plot together.

Thank you in advance.

Basic but annoying situation

Dear all,

The package looks really great. When I copy the exercise the plot looks fantastic. However, when I use my dataset which look like:

'data.frame': 26 obs. of 4 variables:
$ organ : chr "adipose_tissue" "adrenal_gland" "brain" "heart" ...
$ colour: chr "red" "red" "red" "red" ...
$ Gene : chr "Stau1" "Stau1" "Stau1" "Stau1" ...
$ value : num 57 117 171 36 35 45 67 121 37 36 ...

And then I try to do any plot, RStudio return this:
Error in stats::complete.cases(dat) :
no input has determined the number of cases

Do you have an idea of what its happening? It's really frustrating, because as I said, when I do the dummy data.frame that you posted works fantastic.

Thank you in advance,

Best

Share your workflow to create the data necessary for the images...

Hi Jesper,
Would it be possible for you to share the workflow that moved the anatogram images from the figure in ArrayExpress Expression Atlas to this package, please?
If so, I think I (and others) might be able to help to make this package useful. As discussed on twitter, it would be great to add the images for female and other species too.
Thanks,
Paul

REQUEST: *Organism* is missing, can you add it?

Request for additional organism or organs

Many people have contacted me asking to add their favorite organisms, so I thought I'd create a guiding thread.

How organisms were chosen

When I first started working on gganatogram, I realised that it would be impossible for me to draw the anatograms myself, so I set out to use well annotated open source SVG files.
I remembered seeing some at the Expression Atlas, and decided to use the ones here https://ebi-gene-expression-group.github.io/anatomogram/
I then also found the cell SVG from the Protein Atlas https://www.proteinatlas.org/images_static/cell.svg

Not all organisms in the Expression Atlas has an anatogram, and most species anatograms are not as well annotated as human and mouse.
Unfortunately, my drawing and anatomy skills are limited, and gganatogram is a hobby project outside my day job, so I won't be able to manually draw organisms/organs and add them.

How to add a tissue to an existing organism

If your favourite organism is included in gganatogram, but some tissues are missing, how do you add it?

Edit SVG in inkscape

The best way to add an organisms would be to download the SVG from the Expression Atlas (https://github.com/ebi-gene-expression-group/anatomogram/tree/master/src/svg), edit the file and create a new path for your tissue and draw it in inkscape (preferably avoid circles and such). If the tissue is annotated similarly to the tissues in the SVG, it should be easy for me to add the organisms.

Add coordinate points

The easiest for me would be to receive the coordinates (x,y) directly, which I can then read in to R and add to the appropriate organism.
One way to to this, which I manually did for some tissues for the human anatograms due to my incapability of handling circles in SVG, was to plot the outline of the organisms, and then plot points as outlining the new tissue. I used DescTools's DrawEllipse, which outputs the coordinates of an circle/ellipse. Otherwise, points that you can connect with a line works,

How to add a whole new organism

As, I mentioned above, I have no way of drawing a whole new organism from scratch. If you are an expert on a specific organisms, and think adding it to gganatogram will greatly help you to save time. I suggest you either point me to a highly annotated SVG file of said organism, or you commit time/commission to draw it from scratch.

I have found a SVG that I want you to add

If you have found an open source SVG that you want me to add, make sure that the anatomy is correct, and that the tissues are names properly. If there's a group of paths, the group name should be the tissue name.

I want to draw my favourite organism

Great! I would be happy to add it to gganatogram to help researchers in your field!
See the guidelines here (https://github.com/ebi-gene-expression-group/anatomogram/tree/master/src/svg) to make them similar to the Expression Atlas SVGs.

In summary

How to add a new organism
image
And send the resulting well annotated SVG to me!

Help understand X and Y values

Hi,
I find your package interesting and I would like to use it in my research. I have a question for the following code in your publication

`biopsies <- data.frame(biopsy = c("liver", "heart", "prostate", "stomach", "brain"),
` x = c(55, 50, 53, 60, 57),
 y = c(48, 60, 95, 68, 10),
 value = c(10, 15, 5, 2, 15)) 

How do you decide on the X and Y values? For my research I want to use: tongue", "lung", "nasal_pharynx", "urinary_bladder"

Extra tissues to match with GTex

Hi,
We would very much like to use gganatograms for a couple of projects running in our group. I think it fits very well with what we would like to demonstrate using GTex data, except that the pituitary and salivary glands are missing in gganatogram. Would it be possible to add them as two (optional) tissues? I think matching between gganatogram and GTex tissues would potentially be useful to other people using these data.

Best,
Greg

Align Aorta

Align the Aorta so it matches the rest of the circulatory system

not able to run gganatogram

I'm getting this error

Error: GeomPolypath was built with an incompatible version of ggproto.
Please reinstall the package that provides this extension.
> grid.arrange(hgMale,ncol=1)
Error: could not find function "grid.arrange"

This is my script


devtools::install_github("jespermaag/gganatogram")
library(gganatogram)
library(dplyr)
devtools::install_github("dkahle/ggmap")
devtools::install_github("hadley/ggplot2")
install.packages("gridExtra")
library(gridExtra)
hgMale <- gganatogram(data=hgMale_key, fillOutline='#a6bddb', organism='human', sex='male', fill="colour") + theme_void()
grid.arrange(hgMale,ncol=1)


Maybe I'm not installing the packages correctly

overlaying data

Hello
I am a big fan of your package : simple and efficient!
for my new project, I would like to plot diagram on top of the human body based on the coordinate of the organs...
the first thing I did was to try to find the centroids of these organs.. I did the following although it is probably not ideal... (all suggestions are welcome)


df_cat<- data.frame()
for(i in 1:length(unique(names(hgMale_list)))){
        organ=unique(names(hgMale_list))[i]
        coordinates <- hgMale_list[i]
        lat=mean(coordinates[[1]]$X1,na.rm=T)
        lon=mean(coordinates[[1]]$X2,na.rm=T)
        df<- cbind(organ,lat,lon)
        df_cat=rbind(df_cat,df)
        
}

then is the tricky part.
I do have my 'background' body with


organPlot <- data.frame(organ = c("heart", "aorta", "spleen", "brain", "liver", "duodenum", "colon", "prostate"), 
                        type = c("circulation", "circulation",  "circulation", "nervous system", "digestion", "digestion", "digestion",'reproductive'), 
                        colour = c("#F08080", "#F08080", "#F08080", "#c6e2ff", "#FDE1C1", "#D3EBED", "#57BFC5",'#F39325'), 
                        value = c(10, 5, 1, 8, 2, 5, 5,5), 
                        stringsAsFactors=F)
plot1 <- gganatogram(data=organPlot, fillOutline='white', organism='human', sex='male', fill="colour")+theme_bars()
plot1

but I would like to overlay a pie chart (ggplot) on top of a given organs
a simple geom_point works

plot1+geom_point(aes(x=52.64,y=-4.84),size=5)

but what would you suggest to add another ggplot 'nested' /'on top' of the body?
if you can think about alternative ways to do that, all ideas are very welcome!

thank you again for making this package available

Here's an example with 2 plots...

X and Y coordenates to get differentes organ

Hi:
How could I find the X and Y coordenates to get differentes organs:

normal <- data.frame(organ =
c("heart", "leukocyte", "nerve", "brain", "liver", "stomach", "colon"),
value = c(10, 5, 1, 2, 2, 5, 5),
type = rep("Normal", 7),
stringsAsFactors=F)

I am trying to find: Uterine cervix

Thanks in advance

Feature request: Brain anatomy

Hi,

Would really appreciate the ability to map onto specific regions of the brain.

Thanks again for a great piece of software.

/Alistair

hgFemale_key doesn't have spinal cord?

Hi All,

This is an awesome tool and I really like it! I was wondering though, if perhaps you could add in the spinal cord for the hgFemale_key so that it can be displayed?

Thanks so much!

Best wishes,
Claudia

new tissue list and smoothing

Dear Jesper,

I am reaching out to you regarding your impressive work with gganatogram. This is so precious!
Your tool is really inspiring to plot our data in a more comprehensive way. I have some questions:
Is there a way to expand the list of tissues (e.g. occipital cortex)? or adapt some (e.g. split lymphoid tissues into axillary, mesentary, mediastinal, split colon into right and left colon…)?
Also regarding the grouping, I am particularly interested into research focusing on CNS and on genital tract. Is there a way to smooth the plotting and increase resolution (like in ggseg3d) ? For example, I like how the brain and human body are shown in the expression atlas (frontal and sagittal view)
If you are interested/have time, we can continue to chat over email.

thank you!

plugin to expression atlas?

Hi,

Great tool, just what I was looking for and hoped someone would create. A quick question: do you have existing code for, given a gene symbol, getting expression data for that gene for all human or mouse tissues such that it can be quickly visualised on your body map? Seems to me like the most common use case, and if the code was included it would speed update/usage.

Best wishes
/Alistair

Request: ability to map to body segments rather than organs

Thanks for the great package! Much of my research involves measuring skin temperatures of different body segments (e.g. face, hands, chest, etc) and I haven't found an elegant way to visualize those data in R yet. I came across your package and thought it would be perfect for this particular application with some modifications. I would be happy to help determine the coordinates of typical body segments if that was useful.

LICENSE file is missing

It would be nice if a license file could be added to the repo and the release tarballs as requested by the GPL.

YEAST PLOT

This is not really an issue but ... is it possible to create a plot of Saccharomyces cerevisiae using gganatogram? This yeast species exists in the repository https://www.ebi.ac.uk/gxa/home but I am not sure how to specify that in the command line.

Thanks
Kobchai

The mouse brain coronal and sagittal sections

A really good tool to show gene expression in different organs. My lab work focuses on the mouse brain and we have some region-specific data to plot. After a long time searching, this is the closest R package that fits my purpose. Is it hard to make several coronal and sagittal maps? Then we can add the gene expression value to each region of the brain.

I found another brain-heatmap project 6 years ago brain-heatmap, I want to do a similar thing on ggplot2.

Looking forward to your reply.

Using gganatogram within a loop of tabs

I'm unable to print within a loop of tabs, and it seems like a limitation, as many other types of plots work using the print function.

Here's an example trying to output it using ggplotly. Is there a way to print like this through an "asis" chunk within gganatogram? Thank you.

knitr::opts_chunk$set(echo = TRUE)

library(gganatogram)
library(ggplot2)
library(plotly)

Tabs of Anatograms {.tabset}


list_to_output <- c("Tab 1","Tab 2","Tab 3")

for(i in list_to_output){
  
  cat("\n") 
  cat("### ", i, " {.tabset .tabset-pills}\n") # Create second level headings with the names.
  
  g <- gganatogram(data = hgMale_key,
            organism = "human", sex = "male",
            fill = "value",
            fillOutline = "#a6bddb")
  
  print("This is a test.")

  print(ggplotly(g),cat('\n'))
}

Problem with Shiny

I am trying to upload some example to Shiny.io. to my account. Lamentably i have the same error:

Error: Unhandled Exception: Child Task 1134575266 failed: Error parsing manifest: Unknown repository for package source: neuroconductor-devel-releases

My script head:

devtools::install_github("jespermaag/gganatogram")

library(shiny)
library(dplyr)
library(gganatogram)
library(ggplot2)
library(gridExtra)
library(viridis)

Facetting only works if facet variable is named "type"

Hi,
Thank you so much for your work and for providing this package. The plots look amazing!

Here is one thing that took me a while to figure out. When using facet_wrap to facet the plot, it only works when the facet variable is named type. Using any other name results in the following error:
Error in combine_vars(data, params$plot_env, vars, drop = params$drop)

I would kindly suggest to allow for other variable names or to make it explicit in the documentation that the variable has to be named "type".

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.