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/fenderglass/Ragout
22 June 2021, 01:27:41 UTC
  • Code
  • Branches (21)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/chr_map
    • refs/heads/devel
    • refs/heads/gh-pages
    • refs/heads/ismb_2014
    • refs/heads/master
    • refs/heads/path_cover
    • refs/heads/py3
    • refs/heads/rr_devel
    • refs/heads/tree_infer
    • refs/remotes/origin/devel
    • refs/tags/1.0
    • refs/tags/1.1
    • refs/tags/2.0
    • refs/tags/2.1
    • refs/tags/2.1.1
    • refs/tags/2.2
    • refs/tags/2.3
    • refs/tags/v0.1b
    • refs/tags/v0.2b
    • refs/tags/v0.3b
    • refs/tags/v1.2
    No releases to show
  • eb905b6
  • /
  • scripts
  • /
  • ord2fasta.py
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.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:a99846503bb2ae047612fa7d6d63d4bd49b9464c
origin badgedirectory badge
swh:1:dir:764b779386231c33cc22c428cab1840bb329b5ec
origin badgerevision badge
swh:1:rev:54ec8318ee615f6aa28b3188cfd95ee5679cc317
origin badgesnapshot badge
swh:1:snp:049c406b15a9a28e76d942bfc1fe2a04f4142f61

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
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 54ec8318ee615f6aa28b3188cfd95ee5679cc317 authored by fenderglass on 15 January 2014, 22:20:24 UTC
sibelia path fix
Tip revision: 54ec831
ord2fasta.py
#!/usr/bin/env python

from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
import sys

def main(ord_file, contigs_file):
    fasta_dict = {}
    for seq in SeqIO.parse(contigs_file, "fasta"):
        fasta_dict[seq.id] = seq.seq

    scf = Seq("")
    for line in open(ord_file, "r").read().splitlines():
        if line.startswith(">"):
            if len(scf):
                SeqIO.write(SeqRecord(scf, id=scf_name, description=""), sys.stdout, "fasta")
            scf_name = line[1:]
            scf = Seq("")
        else:
            name = line[1:]
            seq = fasta_dict[name]
            if line.startswith("+"):
                scf += seq
                scf += Seq("N"  * 11)
            else:
                scf += seq.reverse_complement()
                scf += Seq("N"  * 11)
    SeqIO.write(SeqRecord(scf, id=scf_name, description=""), sys.stdout, "fasta")

if __name__ == "__main__":
    if len(sys.argv) < 3:
        print "USAGE: ord2fasta.py ord_file contigs_file"
    else:
        main(sys.argv[1], sys.argv[2])

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