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

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.

  • content
content badge
swh:1:cnt:8fa7c944efa28658e0c7d346b6a4ed552ec39fbd

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
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
#(c) 2016 by Authors
#This file is a part of Ragout program.
#Released under the BSD license (see LICENSE file)

from __future__ import print_function

import os
import sys
import subprocess
import shutil

try:
    import setuptools
except ImportError:
    sys.exit("setuptools package not found. "
             "Please use 'pip install setuptools' first")

from setuptools import setup
from setuptools.command.install import install as SetuptoolsInstall
from distutils.command.build import build as DistutilsBuild
from distutils.spawn import find_executable

# Make sure we're running from the setup.py directory.
script_dir = os.path.dirname(os.path.realpath(__file__))
if script_dir != os.getcwd():
    os.chdir(script_dir)

from ragout.__version__ import __version__


class MakeBuild(DistutilsBuild):
    def run(self):
        DistutilsBuild.run(self)

        if not find_executable("make"):
            sys.exit("ERROR: 'make' command is unavailable")
        try:
            subprocess.check_call(["make"])
        except subprocess.CalledProcessError as e:
            sys.exit("Compilation error: ", e)


class MakeInstall(SetuptoolsInstall):
    def run(self):
        SetuptoolsInstall.run(self)

        print('Installing C++ binaries')
        if os.path.isdir(self.install_lib) and not os.access(self.install_lib, os.W_OK):
            sys.exit('Error: no write permission for ' + self.install_lib + '  ' +
                     'Perhaps you need to use sudo?')

        if os.path.isdir(self.install_scripts) and not os.access(self.install_scripts, os.W_OK):
            sys.exit('Error: no write permission for ' + self.install_scripts + '  ' +
                     'Perhaps you need to use sudo?')

        build_dir = os.path.join(script_dir, "bin")
        install_dir = self.install_scripts
        bin_files = ['ragout-maf2synteny', 'ragout-overlap']
        for file in bin_files:
            if not os.path.isfile(os.path.join(build_dir, file)):
                sys.exit('Error: binary not found: ' + file)
            shutil.copy2(os.path.join(build_dir, file),
                         os.path.join(install_dir, file))


setup(name='ragout',
      version=__version__,
      description='Chromosome assembly using multiple references',
      url='https://github.com/fenderglass/Ragout',
      author='Mikhail Kolmogorov',
      author_email = 'fenderglass@gmail.com',
      license='BSD-3-Clause',
      packages=['ragout', 'ragout/assembly_graph', 'ragout/breakpoint_graph',
                'ragout/maf2synteny', 'ragout/overlap', 'ragout/parsers',
                'ragout/phylogeny', 'ragout/scaffolder', 'ragout/shared',
                'ragout/synteny_backend', 'ragout/newick', 'ragout/tests'],
      package_data={'ragout': ['tests/data/*']},
      entry_points={'console_scripts': ['ragout = ragout.main:main']},
      cmdclass={'build': MakeBuild,
                'install' : MakeInstall}
      )

back to top

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