Exemplo n.º 1
0
    def __init__(self, infile, outfile=None, *args, **kwargs):
        """.. rubric:: constructor

        :param str infile: input :term:`PLINK` file.
        :param str outfile: (optional) output :term:`VCF` file
        """
        if not outfile:
            outfile = generate_outfile_name(infile, 'vcf')
        super().__init__(infile, outfile)
Exemplo n.º 2
0
    def __init__(self, infile, outfile):
        """.. rubric:: constructor

        :param str infile: the path of the input file.
        :param str outfile: the path of The output file
        """
        if not outfile:
            outfile = generate_outfile_name(infile, self.output_ext[0])

        self.infile = infile
        self.outfile = outfile
        self._execute_mode = "shell"  #"subprocess"  # set to shell to call shell() method
        self.logger = logger
Exemplo n.º 3
0
def test_utils():

    assert utils.get_extension("test.fastq") == "fastq"
    assert utils.get_extension("test.fastq.gz",
                               remove_compression=True) == "fastq"
    assert utils.get_extension("test") is None

    assert utils.generate_outfile_name("test.fastq", "fq") == "test.fq"

    assert utils.get_format_from_extension(".bam") == "BAM"
    assert utils.get_format_from_extension(".bb") == "BIGBED"
    try:
        utils.get_format_from_extension(".temp")
        assert False
    except:
        assert True
Exemplo n.º 4
0
    def __init__(self, infile, outfile):
        """.. rubric:: constructor

        :param str infile: the path of the input file.
        :param str outfile: the path of The output file
        """
        if not outfile:
            outfile = generate_outfile_name(infile, self.output_ext[0])

        self.infile = infile
        self.outfile = outfile

        # execute mode can be shell or subprocess.
        self._execute_mode = "shell"

        # The logger to be set to INFO, DEBUG, WARNING, ERROR, CRITICAL
        self.logger = logger
Exemplo n.º 5
0
    def __init__(self, infile, outfile):
        """.. rubric:: constructor

        :param str infile: The path of the input file.
        :param str outfile: The path of The output file
        """
        # do not check the existence of the input file because it could be just a prefix
        # if os.path.exists(infile) is False:
        #     msg = "Incorrect input file: %s" % infile
        #     _log.error(msg)
        #     raise ValueError(msg)

        if not outfile:
            outfile = generate_outfile_name(infile, self.output_ext[0])

        self.infile = infile
        self.outfile = outfile
        self.threads = cpu_count()
        self._execute_mode = "shell"  #"subprocess"  # set to shell to call shell() method
        self.logger = logger
def test_generate_outfile_name():
    assert generate_outfile_name('foo.fasta', 'phylip') == 'foo.phylip'
    assert generate_outfile_name('/foo/bar.ext.fasta',
                                 'clustal') == '/foo/bar.ext.clustal'