How to use the dnaio.open function in dnaio

To help you get started, we’ve selected a few dnaio examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github marcelm / cutadapt / src / cutadapt / utils.py View on Github external
def dnaio_open(self, *args, **kwargs):
        logger.debug("Opening file '%s', mode '%s' with dnaio", args[0], kwargs['mode'])
        kwargs["opener"] = self.xopen
        return dnaio.open(*args, **kwargs)
github marcelm / cutadapt / src / cutadapt / pipeline.py View on Github external
def open(self):
        return dnaio.open(self.file1, file2=self.file2,
            interleaved=self.interleaved, mode="r")
github marcelm / cutadapt / src / cutadapt / pipeline.py View on Github external
def _open_writer(
        self,
        file: BinaryIO,
        file2: Optional[BinaryIO] = None,
        force_fasta: Optional[bool] = None,
    ):
        # file and file2 must already be file-like objects because we don’t want to
        # take care of threads and compression levels here.
        for f in (file, file2):
            assert not isinstance(f, (str, bytes, Path))
        return dnaio.open(
            file,
            file2=file2,
            mode="w",
            qualities=self.uses_qualities,
            fileformat="fasta" if force_fasta else None,
            interleaved=file2 is None,
        )
github marcelm / cutadapt / src / cutadapt / pipeline.py View on Github external
def _open_writer(
        self,
        file: BinaryIO,
        file2: Optional[BinaryIO] = None,
        force_fasta: Optional[bool] = None,
    ):
        assert file2 is None
        assert not isinstance(file, (str, bytes, Path))
        return dnaio.open(
            file, mode="w", qualities=self.uses_qualities, fileformat="fasta" if force_fasta else None)

dnaio

Read and write FASTA and FASTQ files efficiently

MIT
Latest version published 14 days ago

Package Health Score

75 / 100
Full package analysis