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/svohr/mixemt
20 October 2023, 16:20:37 UTC
  • Code
  • Branches (5)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/fix-old-xrange-in-python3
    • refs/heads/master
    • refs/tags/v0.0.1-sub
    • refs/tags/v0.1-sub
    • refs/tags/v0.2
    No releases to show
  • 1a54d84
  • /
  • plot
  • /
  • plot_mix_coverage.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 ...

Permalinks

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 Iframe embedding
swh:1:cnt:7a6ddd5e5b06b954536fa3e0b9a496e9b8ca1f9c
origin badgedirectory badge Iframe embedding
swh:1:dir:947b6f9c7f48e7478f0d3171f0b925f820f19b84
origin badgerevision badge
swh:1:rev:be33e2d3db69a1c5c64f68041f54f9f781deb769
origin badgesnapshot badge
swh:1:snp:69fdfeaf2093b6060505654e1d866ccc69e9bf2c
Citations

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: be33e2d3db69a1c5c64f68041f54f9f781deb769 authored by Sam Vohr on 06 October 2023, 00:46:11 UTC
Fix index error for report top proportions (#24)
Tip revision: be33e2d
plot_mix_coverage.R
#! /usr/bin/env Rscript
#
# This script generates a plot of the read coverage across the reference
# genome for the complete mixture sample as well as the assembled contributor
# haplotypes and any reads that were not assigned to a contributor. The count
# of the majority base at each position is also plotted along with coverage
# so that variant position can be identified by eye.
#
# Sam Vohr (svohr@soe.ucsc.edu)


library(ggplot2)


args <- commandArgs(trailingOnly=TRUE)

if (length(args) < 1) {
  stop("usage: plot_mix_coverage stat_file_prefix")
}

stats.prefix <- args[1]


obs.tab.fn <- paste(stats.prefix, "obs.tab", sep='.')
obs.tab <- read.table(obs.tab.fn)

obs <- data.frame(Contributor=paste(obs.tab[, 1], obs.tab[, 2], sep=':'),
                  position=obs.tab[, 3],
                  coverage=obs.tab[, 8])
obs$agreement <- apply(obs.tab[, 4:7], 1, max)

# Remove coverage and agreement values at positions with no coverage.
obs[obs$coverage == 0, c(3, 4)] <- NA
# Change the positions to 1-based for plotting.
obs$position <- obs$position + 1


cov.plot <- ggplot(obs) +
  geom_line(aes(x=position, y=agreement), size=0.3, color="lightblue") +
  geom_line(aes(x=position, y=coverage), size=0.6) +
  facet_wrap(~Contributor, ncol=1) +
  theme_minimal() +
  expand_limits(y = 0) +
  scale_x_continuous(breaks=c(1, 5000, 10000, 15000, 16569),
                     minor_breaks=seq(500, 16000, 500)) +
  labs(y="Coverage", x="RSRS Reference Position")

plot.fn <- paste(stats.prefix, "mix_coverage.png", sep='.')
n.facets <- length(levels(obs$Contributor))

ggsave(filename=plot.fn, plot=cov.plot, width=10, height=n.facets + 1, dpi=100)

quit(save='no', status=0)

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— Contact— JavaScript license information— Web API

back to top