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/maartenpaul/DBD_tracking
08 February 2026, 18:47:12 UTC
  • Code
  • Branches (2)
  • Releases (0)
  • Visits
Revision 9c823c521bb4a60c0efe33c4767a3c52caa3328e authored by Maarten Paul on 07 March 2022, 11:26:07 UTC, committed by GitHub on 07 March 2022, 11:26:07 UTC
Fixed install error
1 parent 19f3a47
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/development
    • refs/heads/master
    • 9c823c521bb4a60c0efe33c4767a3c52caa3328e
    No releases to show
  • 9dda183
  • /
  • python
  • /
  • ML_py.R
Raw File Download Save again
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.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:9c823c521bb4a60c0efe33c4767a3c52caa3328e
origin badgedirectory badge
swh:1:dir:21bf6ea851a95db58d963db08b6b615cd1c5d540
origin badgecontent badge
swh:1:cnt:096e5c3eacc343b080a94dc500c1735936407db4
origin badgesnapshot badge
swh:1:snp:f14cfe52ad9e74434b7288f4e59ba10f11fe3d0f

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
  • 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: 9c823c521bb4a60c0efe33c4767a3c52caa3328e authored by Maarten Paul on 07 March 2022, 11:26:07 UTC
Fixed install error
Tip revision: 9c823c5
ML_py.R
library(reticulate)
library(tidyverse)
library(reshape2)

path_to_model<-"python/Model_Bidirectional_NoShape_3state_Tr10000"
  rm(py)
  #py$MLfolder <- 'D:/Imaging_data/ML_test/'
  cat("Loading Python functions and ML model")
  source_python(file.path(getwd(),"python/MLE_functions.py"))
  py$path_to_model <- path_to_model
  source_python(file.path(getwd(),"python/Load_model.py"))


ML_segment_tracks <- function(tracks,directory=NULL){

  #source_python("python/Load_data.py")

  x <- dlply(tracks,.variables = c("cellID","track"), function(x){

    return(x$X)
  })
  names(x) <- NULL

  py$x <- x


  y <- dlply(tracks,.variables = c("cellID","track"), function(x){
    return(x$Y)
  })
  names(y) <- NULL
  py$y <- y

  indices <- cumsum(daply(tracks,.variables = "cellID", function(x){
    return(length(unique(x$track)))
  }))

  indices <- c(0,indices-1)
  cat("import R data")
  source_python("python/Load_Rdata.py")
  cat("Get ML predictions")

  source_python("python/Get_predictions.py")
  cat("Return data")
  #source_python('python/make_table.py')

  if(!is.null(directory)){
    py_save_object(object = x,filename = file.path(directory,tracks$condition[1],"x.pydata"))
    py_save_object(object = y,filename = file.path(directory,tracks$condition[1],"y.pydata"))
    py_save_object(object = allStates,filename = file.path(directory,tracks$condition[1],"allStates.pydata"))



  }

out <-  py$getTrackPiecesForInfo(x, y, allStates)
x0 <- out[[1]]
y0 <- out[[2]]
x1 <- out[[3]]
y1 <- out[[4]]
x2 <- out[[5]]
y2 <- out[[6]]
trnums0 <- out[[7]]
trnums1 <- out[[8]]
trnums2  <- out[[9]]

  names(x0) <- trnums0
  names(x1) <- trnums1
  names(x2) <- trnums2
  names(y0) <- trnums0
  names(y1) <- trnums1
  names(y2) <- trnums2


  x0 <- melt(x0)
  y0 <- melt(y0)
  x0$y <- y0$value
  x0$state <- 0

  x1 <- melt(x1)
  y1 <- melt(y1)
  x1$y <- y1$value
  x1$state <- 1

  x2 <- melt(x2)
  y2 <- melt(y2)
  x2$y <- y2$value
  x2$state <- 2

  all <- rbind(x0,x1,x2)
  all$L1 <- as.numeric(all$L1)
  all <- plyr::arrange(df = all, L1)

  tracks$state <- all$state

  return(tracks)
}
#plotting
#source_python('python/mss.py')
source_python('python/SMMsplot.py')


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