Questions tagged [ggplot2]

Advanced R visualisation and plotting package based on the grammar of graphics. ggplot2 is also available in Python via 'plotnine' which uses ggplot2 code

Filter by
Sorted by
Tagged with
1
vote
1answer
30 views

How to plot the gap distribution of contigs wrt to reference genome

I have a contigs file that I generated using Minia and then I have used Minimap2 to map these contigs again to the reference genome. Now I want to plot the gap distribution i.e. gap distance of the ...
0
votes
1answer
27 views

Barplot without alphabetizing x-axis

I'm inputting a .csv file and then plotting a barplot based on the colnames but when I go plot the order the names are being alphabetized rather than get the order that is in the .csv file. How to I ...
2
votes
1answer
1k views

Plotting gene models - alternatives to ggbio

I am curious how people make genome track plots such as what can be done with the Bioconductor package ggbio. For example this plot was made w/ ggbio: I think ...
1
vote
2answers
78 views

PCA plot in R coloured by sample type

I'm a biologist, not a programmer so please be gentle. So I have a dataset that looks like ...
-2
votes
1answer
92 views

Multiple box plot

I am using below code to plot multiple box plot but I am still struggling to understand how I can add whisker to box plot and how to change sample order like in this figure SampleType? ...
1
vote
1answer
422 views

How do I add external labels and connecting lines to a Ternary Plot in R?

I have plotted a triangular plot,that three dimensions of which represent three herbal strategies. One dimension represents the strategy of C (competitive plant), the second dimension “S” (stress ...
2
votes
2answers
2k views

How do I add a colour annotation bar to the heatmap generated by DoHeatmap function of Seurat v2?

I am using Seurat v2 for professional reasons (I am aware of the availablity of Seurat v3). I am clustering and analysing single cell RNA seq data. How do I add a coloured annotation bar to the ...
3
votes
1answer
1k views

Percentage distribution of cells in all clusters based on their treatment condition?

I have 2151 cells, I clustered them by Seurat to 5 clusters. With the code below, I am able to have the number of cells per cluster and per condition: ...
1
vote
0answers
24 views

How to call this : some dots in volcano plot aligned a line after add a very small value to padj

when I plotting the volcano plot, I got some dots very top of the Y-axis because their padj nearly reached 0(I checked the data, I think they are reliable), so I followed the advice to add a very ...
1
vote
1answer
163 views

ggplot2 geom_bar() , do not merge y-values shared same x-ids [closed]

I am plotting a barplot using ggplot + geom_bar() function in R. I have some the recoreds which share the same x-axis ...
2
votes
1answer
54 views

Plot information stored in dataframe within a tree (ggtree)

Hello to the entire Stackoverflow community! I'm writing to you because I'm currently building a phylogeny with ggtree and I have in parallel a table like this one: df : ...
0
votes
1answer
38 views

Very low probability densities

I'm generating a density plot using the ggplot2 library: ...
0
votes
1answer
349 views

Getting weird plot with ggpubr package

I have a data frame for two groups and 9 variables ...
1
vote
0answers
359 views

How to create a dendrogram of clusters and reconstruct phylogenetic relationship

I'm working with a Daphnia data set looking at the 16s gene pulled from the BOLD database. So far I did a multiple sequence alignment and attempted to cluster and plot a dendrogram: ...
0
votes
2answers
80 views

Grouping a set of genes in a ggplot object

I have a boolean matrix of mutated or non mutated genes across some samples ...
-5
votes
1answer
68 views
0
votes
1answer
44 views

A box plot of qualitative variables

I have 2 groups of patients; responders to chemotherapy and non-responders I have calculated cancer cell fraction (CCF) of a set of driver genes (by variant allele frequency) for each group and I ...
0
votes
1answer
60 views

Griding ggplot object in r

I have this data frame head(d) ...
-1
votes
1answer
87 views

Showing name of genes in boxplot

I have a long format data frame like this ...
0
votes
2answers
50 views

Clustered column chart for single cell data

I want to create a column plot for my single cell analysis that has 2 sample types, a normal and PDAC. I want to show, the percentage of different cell types per sample type. How do I go about ...
0
votes
3answers
92 views

Boxplot of read length distributions from multiple samples

Newbie R user here. I want to create a plot with boxplots of read length distribution on the Y-axis, and samples on the X-axis -- like this image from doi: 10.1038/srep16498 However, I'm not sure ...
0
votes
1answer
77 views

Bar plot with error bars

I am trying to plot a box plot/stacked bar graph with error bars. output of dput(DF) ...
1
vote
1answer
710 views

Visualizing the difference among three groups

I have 3 data frames for three groups of patients and in each of them I have the number of mutation types like insertion, deletion, SNP and total of mutations for each patients. In each group I have ...
0
votes
2answers
532 views

Making a volcano plot look less cluttered

I have generated a volcano plot with a differential expression file. Code for inputing file: ...
0
votes
1answer
38 views

Dodged bar chart

I want to create a dodged barchart with different cell cycles for each cell type within each condition. dput(DF_count) ...
2
votes
1answer
1k views

Pulling out a certain gene in a volcano plot

I have generated a volcano plot with a differential expression file. Code for inputing file: ...
0
votes
1answer
2k views

stacked bargraph with error bars

I'm attempting to plot a stacked barplot with ggplot2 with this code: ...
-1
votes
2answers
210 views

Making a boxplot or violinplot for several dataframe with different number of samples

I have 3 data frames for treatment of 3 different drugs and in each of them I have the number of mutation types like insertion, deletion, SNP and total of mutations for each patients. In each group I ...
0
votes
1answer
194 views

Stacked barplot for single cell analysis

I want to create a stacked bar-graph with different cell cycles for each cell type within each condition. I have uploaded the file for it. Don't know how to go about it as now I have another condition ...
3
votes
3answers
5k views

Mapping a list of cells in seurat featureplot

I have 209 cells, I clustered them by Seurat to 4 clusters. By Featureplot I am able to track a gene in clusters: Higher color shows higher expression. Now, for some genes I want to highlight some ...
7
votes
1answer
288 views

Density plot, scale it to 0-1

Doubt regarding density plot what is the scale being plotted in the Y axis.Is it possible to scale it to 1?. This is my code ...
0
votes
1answer
2k views

How do I increase the minimum dot size in Seurat's DotPlot function?

I want to use the DotPlot function from Seurat v3 to visualise the expression of some genes across clusters. However when the expression of a gene is zero or very low, the dot size is so small that it ...
0
votes
1answer
3k views

Seurat VlnPlot presenting expression of multiple genes in a single cluster

Seurat VlnPlots are most commonly used to visualize differences in any given gene expression across multiple clusters or cell types. For example: ...
0
votes
1answer
162 views

Customizing colors in geom_arc_bar (ggforce)

I am trying to plot scatter plot of pie charts using ggplot2 and ggforce. Following is my code ...
0
votes
1answer
918 views

Changing the axis limits of ggplot objects

By EnhancedVolcano R package I have this plot with this code ...
2
votes
1answer
2k views

Create a Grouped Barchart

I’m trying to create a Group Chart like this: I have 7 classes for each of 4 species, not 5 like in the diagram. I want to build i diagram to show the distributions of the classes in each species ...
2
votes
1answer
108 views

Multiple line chart

I am trying to create a multiple coloured line graph based on six lines. Essentially I have data that identifies different units of vegetation by the variable” NDVI (vegetation index)” I want to ...
1
vote
0answers
125 views

How can I correctly get 3D scatter plot for micro-array pheno data in R [updated]?

I intend to see data points distribution (each reows) within labeled groups (different batchs such as 1,2,3, and so on) in 3D scatter plot, because I want to see the distribution of the data points ...
3
votes
1answer
197 views

How do I prevent the FeatureHeatmap function from the Seurat package, from sorting my data groups in alphabetical order when plotting data?

How can I prevent a function from sorting my data groups (factors) in alphabetical order without affecting the integrity of the data? I am analysing single cell RNA sequencing data using Seurat 2.3.4. ...
1
vote
0answers
73 views

Missing lower IQR in boxplot [closed]

Im not able to figure it out why the lower quartile of the two data points missing. Data Code ...
3
votes
1answer
1k views

How to set the position of groups in a Seurat object on a FeatureHeatmap plot

I am analysing singe cell sequence data and I have followed this tutorial, https://satijalab.org/seurat/pbmc3k_tutorial.html to perform QC and various differential analyses using the Seurat package on ...
3
votes
2answers
3k views

Separate boxplots for multiple violin plot

I am using the following function from seurat package to generate multiple violon plots and I am interested in adding box plots to them but it doesn't work when I have plotted different data at once. ...
4
votes
1answer
598 views

How to plot p-values in a circular barplot?

Im trying to plot reactome pathway in for of circular bar plot using ggplot2 my data ...
2
votes
0answers
110 views

How to plot gene mutation frequencey in terms of percnatge alteration in samples?

I'm taking data from cbioportal of gene and their mutation frequency with percentage which I'm trying to categorize with various sub class. The issue I'm facing is I have to plot it in mutation ...
2
votes
1answer
184 views

Question about the dots on Quartile groups in boxplot

I have Microarray Normalized Expression data for a specific Gene. It looks like below in a dataframe B ...
3
votes
2answers
809 views

Changing a wide range of colours to a limited gradient

I returned a FeaturePlot from Seurat to ggplot. My plot has a weird range of colours as below I produced this plot by this code ...
1
vote
1answer
49 views

Error in annotating row names as data points in a PCA plot

I made a PCA plot and was trying to plot the eigenvenctors in R so that each data point is actually the sample name. All the samples are in column 1. The following are the R commands I am using: <...
4
votes
1answer
288 views

Plot to show the expression of genes between tumor and normal

I have RNA-seq raw counts data for 50 samples. 20 Normal and 30 tumor. After differential analysis I got 30 DEGs. I want to make a violin plot showing the expression of each gene. I transformed counts ...
2
votes
2answers
2k views

Which data is being used for violin plot?

Sorry I just got totally confused conceptually. If this is my raw count data Likely, Seurat divides each value by sum of the column afterward times by 10000. which gives so ...