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/jasonbrickner/SeqComp
01 May 2025, 22:34:39 UTC
  • Code
  • Branches (1)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/main
    No releases to show
  • 102afa9
  • /
  • Competition assay
  • /
  • example competition.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:bec78e6abff6231ee6fc3412724824ea117e00af
origin badgedirectory badge Iframe embedding
swh:1:dir:3b5d72c548d5693e23f5bc0df54141088121175b
origin badgerevision badge
swh:1:rev:3eb152971adc09d0b4559bb86e4ad036eebd4dc7
origin badgesnapshot badge
swh:1:snp:752a7b3fb25d9471ac4459df1fe103b3f094dc58
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: 3eb152971adc09d0b4559bb86e4ad036eebd4dc7 authored by Jason Brickner on 26 April 2022, 15:16:44 UTC
Update README.md
Tip revision: 3eb1529
example competition.R
#This script finds the peak height of T and G from input ab files, calculates a ratio of the strains and normalizes based on the initial ratio 
#and corrects for initial densities not equal to 1.
library(plyr)
library(tidyverse)  
library(sangerseqR)
library(stringr)

#draw peak heights and calculate normalized ratios for each strain, condition and time point.
#Step 1: collect data for WT cells act vs react
fnames <- as.character(list.files("~/Downloads/Competition assay/example competition raw data/"))
WT_LUT <- read.csv("~/Downloads/Competition assay/LUT for example competition.csv")
WT_LUT$file <- paste(WT_LUT$file_number, ".ab1", sep = "")
SNPdf <- data.frame(file = character(),
                      A = numeric(),
                      C = numeric(),
                      CtoA_ratio = numeric())

for(i in 1:length(fnames)){
    SNPdf[i,1] <- fnames[i]
    sub_LUT <- subset(WT_LUT, file == fnames[i])
    df <- read.abif(paste("~/Downloads/Competition assay/example competition raw data/", fnames[i], sep = ""))@data
    seq <- sangerseq(read.abif(paste("~/Downloads/Competition assay/example competition raw data/", fnames[i], sep = "")))
    position <- as.numeric(str_locate_all(pattern ="GGGTTTTCCC", primarySeq(seq, string = "TRUE"))[[1]][1,2])+1
    window <- round((df$PLOC.2[position]-df$PLOC.2[position-1])/4, 0)
    tracestart <- df$PLOC.2[(position)]-window
    traceend <- df$PLOC.2[(position)]+window
    SNPdf[i, 2] <- max(seq@traceMatrix[c(tracestart:traceend), 1])
    SNPdf[i, 3] <- max(seq@traceMatrix[c(tracestart:traceend), 2])
    SNPdf[i, 4] <- round(SNPdf[i, 3]/SNPdf[i, 2], 2)
}
  SNP_final <- merge(WT_LUT[,-c(1:2)], SNPdf, by = "file")[,-1]
  SNP_sum1 <- ddply(SNP_final, .(A_strain, C_strain, time, bio_rep), summarize,
                   tech_ratio = mean(CtoA_ratio))
  zeros <- subset(SNP_sum1, time == 0)[,-3] %>% dplyr::rename(zero = tech_ratio)
  SNP_norm <- merge(SNP_sum1, zeros, by = c("A_strain", "C_strain", "bio_rep")) %>% dplyr::mutate(normalized_ratio = tech_ratio/zero)

  SNP_sum2 <- ddply(SNP_norm, .(A_strain, C_strain, time), summarize,
                    mean_ratio = mean(normalized_ratio),
                    sd_ratio = sd(normalized_ratio),
                    se_ratio = sd_ratio/sqrt(length(bio_rep)))
  
SNP_sum2$ID <- paste(SNP_sum2$C_strain, SNP_sum2$A_strain, SNP_sum2$time, sep = "_")

  

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