Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(4)  |  Derive(0)  |  Import(4)
It sets the file format in the global inventory variable

        def set_format(fhand, file_format):
    'It sets the file format in the global inventory variable'
    id_ = _get_fhand_id(fhand)
    if id_ in FILEFORMAT_INVENTORY:
        msg = 'The given instance already setted its file format'
        raise RuntimeError(msg)
    FILEFORMAT_INVENTORY[id_] = file_format
        


src/s/e/seq_crumbs-HEAD/crumbs/utils/bin_utils.py   seq_crumbs(Download)
from crumbs.utils.file_utils import (wrap_in_buffered_reader,
                                     uncompress_if_required, compress_fhand)
from crumbs.utils.file_formats import get_format, set_format
from crumbs.settings import get_setting
from crumbs.utils.tags import (OUTFILE, GUESS_FORMAT, BGZF, GZIP, BZIP2,
            # checking
            for wrapped_fhand in wrapped_fhands[1:]:
                set_format(wrapped_fhand, in_format)
 
    out_fhand = getattr(parsed_args, OUTFILE)

src/s/e/seq_crumbs-HEAD/crumbs/filters.py   seq_crumbs(Download)
from __future__ import division
from tempfile import NamedTemporaryFile
from crumbs.utils.file_formats import get_format, set_format
from bisect import bisect
 
    fhand = open(paired_fpaths[0]) if paired_fpaths else open(unpaired_fpaths[0])
    if file_format is not None:
        set_format(fhand, file_format)
    else:
        file_format = get_format(fhand)

src/s/e/seq_crumbs-HEAD/test/test_utils.py   seq_crumbs(Download)
from crumbs.seqio import guess_seq_type
from crumbs.settings import get_setting
from crumbs.utils.file_formats import get_format, FILEFORMAT_INVENTORY,\
    set_format
 
 
        fhand = NamedTemporaryFile()
        set_format(fhand, 'fasta')
 
        assert 'fasta' == get_format(fhand)

src/s/e/seq_crumbs-HEAD/test/test_pairing.py   seq_crumbs(Download)
                               ItemsNotSortedError)
from crumbs.seq import SeqWrapper, SeqItem
from crumbs.utils.file_formats import set_format
 
# pylint: disable=R0201
'''
        file1 = StringIO(file1)
        set_format(file1, 'fastq')
        seqs = read_seqs([file1])
        out_fhand = StringIO()