Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/emkcosta/KillifishAutomaticFeederPaper
07 December 2022, 14:04:35 UTC
  • Code
  • Branches (2)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/add-license-1
    • refs/heads/main
    No releases to show
  • 336b4b1
  • /
  • Fig5_SuppFig5
  • /
  • R_scripts
  • /
  • 5_GSEA_BubblePlot_220805_codechk.R
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:8c3d25a8d1015d400c5bfc2405cbe6224d27a2f2
origin badgedirectory badge
swh:1:dir:028f620e76f50bc8271b25bcf22af47ae6b46d84
origin badgerevision badge
swh:1:rev:451bc5d78cd266a00b53612585d201d404f73920
origin badgesnapshot badge
swh:1:snp:a9f2e10f0b2ec00bc74865a9a1af5fd0004baa95

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 451bc5d78cd266a00b53612585d201d404f73920 authored by Emma on 24 October 2022, 20:33:32 UTC
Delete SuppFig2 directory
Tip revision: 451bc5d
5_GSEA_BubblePlot_220805_codechk.R
# Title: Plot GSEA results 
# Author: Jingxun Chen
# Date: code compiled on 20220805
# Related publication: Andrew McKay, Emma K. Costa, and Jingxun Chen, eLife, 2022


# ------------------------------------------------------------------
# Set up 
# ------------------------------------------------------------------

# Set wd to the current directory and seed (for reproducible results)
setwd("/Users/jingxun/Dropbox/KillifishFeederPaper_AndrewMcKay/Revision/Code/RNAseq_Code_check/GSEA/")
set.seed(1234)

# Load packages
library('ggplot2')
library('dplyr')


# ------------------------------------------------------------------
# Load data
# ------------------------------------------------------------------

# Load Male & Female GOGSEA csv list
# Liver
Input1 <- read.csv('Output/liver_Male_DRoverAL_DEG_220401_GOGSEA.csv', header = T)
Input2 <- read.csv('Output/liver_Female_DRoverAL_DEG_220401_GOGSEA.csv', header = T)


# ------------------------------------------------------------------
# Clean up, Filter, Sort the input data
# ------------------------------------------------------------------

# Extract only the NES and padj terms
Input1 <- Input1[c('ID', 'Description', 'NES', 'p.adjust')]
Input2 <- Input2[c('ID','NES', 'p.adjust')]

# Rename columns to keep track of Male vs. Female data
names(Input1) <- c('ID', 'Description', 'Male_NES', 'Male_p.adjust')
names(Input2) <- c('ID', 'Female_NES', 'Female_p.adjust')


# Make a large dataframe
data <- full_join(Input1, Input2, by = 'ID')


# ------------------------- Define GO terms of interest -----------------------------------------

go <- c('GO:0044391', 'GO:0006415', 'GO:0042254', 'GO:0044272', 'GO:0035384', 'GO:0071616', 'GO:0050778', 'GO:0019221','GO:0002694', 'GO:0006457', 'GO:0034976', 'GO:0000502', 'GO:0006486', 'GO:0048193')

# GO:0044391 ribosomal subunit
# GO:0006415 translational termination
# GO:0042254 ribosome biogenesis
# GO:0044272 sulfur compound biosynthetic process
# GO:0035384 thioester biosynthetic process
# GO:0071616 acyl-CoA biosynthetic process
# GO:0050778 positive regulation of immune response
# GO:0019221 cytokine-mediated signaling pathway
# GO:0002694 regulation of leukocyte activation
# GO:0006457 protein folding
# GO:0034976 response to ER stress
# GO:0000502 proteasome complex
# GO:0006486 protein glycosylation
# GO:0048193 Golgi vesicle transport


# ------------------------------------------------------------------
# Getting the data ready for plotting
# ------------------------------------------------------------------

# Keep only the terms of interest
data_go <- filter(data, data$ID %in% go)

# Make a long list of the data for plotting
data_go_f <- subset(data_go, select = -c(Male_NES, Male_p.adjust))
data_go_m <- subset(data_go, select = -c(Female_NES, Female_p.adjust))
names(data_go_f) <- c('ID', 'Description', 'NES', 'p.adjust')
names(data_go_m) <- c('ID', 'Description', 'NES', 'p.adjust')

# Keep track of the Condition
data_go_f['Condition']<- 'Female'
data_go_m['Condition']<- 'Male'

# Match the order so that ID = my GO list 
df <- data_go_f[match(go, data_go_f$ID), ]
dm <- data_go_m[match(go, data_go_m$ID), ]

# Make the final data frame for plotting
FinalData <- rbind(df, dm)

# Change the level of 'Description' based on the order I defined here.
order <- df$Description
FinalData$Description <- factor(FinalData$Description, levels=rev(order))


# ------------------------------------------------------------------
# Plot the bubble plot and save as PDF
# ------------------------------------------------------------------

# Liver
pdf('Plots/Liver_GSEA_GO_MvsF_selectedGOterms_220707.pdf', width = 8, height = 10)
ggplot(data=FinalData, aes(x=Condition, y=Description)) +
  geom_point(aes(color=NES, size = -log10(p.adjust))) +
  scale_colour_gradient2(low = "blue", mid = "purple", high = "red", midpoint = 0, space = "Lab",na.value = "grey50", guide = "colourbar", aesthetics = "colour") +
  labs(title = 'Liver GSEA by GO terms for males vs. females', x='Conditions', y = '',size='-log(FDR)', color='NES')
dev.off()


sessionInfo() 

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API