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

Revision d60db86886186e80622deaa91045caccaf4103d3 authored by Diego del Alamo on 17 February 2022, 16:16:20 UTC, committed by GitHub on 17 February 2022, 16:16:20 UTC
Update predict.py
1 parent 714006d
  • Files
  • Changes
  • 732ab36
  • /
  • figures
  • /
  • fig2
  • /
  • fig2_script.R
Raw File Download

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.

  • revision
  • directory
  • content
revision badge
swh:1:rev:d60db86886186e80622deaa91045caccaf4103d3
directory badge
swh:1:dir:18ac3c00e49e01cca0eaf763433688c7278358a1
content badge
swh:1:cnt:3046caf0c41cf65d23105a14e478db91d26feab6

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.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
fig2_script.R
#!/usr/bin/env Rscript

#' Author: Diego del Alamo
#' This script reproduces Figure 2 from the manuscript.
#' Note that this figure will have clipped facet titles.
#' (namely 'MCT1 (without templates)' will be clipped at the edges)
#' It is therefore recommended that you save this as an SVG and manually
#' edit in Inkscape/Adobe Illustrator.
#' This can be achieved by scrolling to the bottom of this file and replacing
#' the destination file ending from ".png" to ".svg"
#' Finally, note that R-squared values are NOT calculated in this script and 
#' are instead added manually. Nevertheless such values can be manually verified 

library(ggplot2)
library(cowplot)
library(viridis)

#' Data set-up
data <- read.csv(
  "fig2_data.csv",
  header=TRUE, sep="," )

data$protein <- factor(
  data$protein,
  c( "CGRPR", "FZD7", "PTH1R", "ASCT2", "Lat1", "STP10", "ZnT8",
     "MCT1 (without templates)", "MCT1 (with templates)" ) )

#' Plot the data
outpng <- ggplot() +
  geom_point( data=data, aes( x=exp_dist, y=sim_rmsf, fill=avg_plddt ),
              size=1.0, stroke=0.125,pch=21, color="black" ) +
  scale_fill_viridis( name="pLDDT", labels=c( 75, 80, 85, 90, 95, 100 ),
                      limits=c( 75, 100 ), oob = scales::squish ) +
  labs( x="Movement during alternating access (Å)",
        y="RMSF among AlphaFold2 models (Å)" ) +
  theme_minimal() +
  xlim( 0, NA ) +
  ylim( 0, NA ) +
  facet_wrap( . ~ protein, ncol=3, scales="free" ) +
  theme( legend.title = element_text( size=5, face="bold" ),
         legend.text = element_text( size=5 ),
         legend.position ="bottom",
         panel.border = element_rect(colour = "black", fill=NA, size=0.5 ),
         strip.text.x = element_text( size=5, face="bold" ),
         strip.text.y = element_text( size=5, face="bold" ),
         axis.title.y = element_text( size=5, face="bold" ),
         axis.title.x = element_text( size=5, face="bold" ),
         axis.text.y = element_text( size=5 ),
         axis.text.x = element_text( size=5 ),
         aspect.ratio=1 )

save_plot( "fig2.png",
           plot = outpng, base_width = 3.25, base_height = 4.25, units="in" )
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, 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