INNER CODE UNIT · Python

__init__

Gabaldonlab/redundans · bin/FastaIndex.py:32

    def __init__(self, handle, verbose=0, log=sys.stderr):
        """ """
        ext = ".fai"
        self.verbose = verbose
        self.log = log.write
        self.genomeSize = 0
        self.whitespaces_in_headers = False
        # guess handle
        if type(handle) is str and os.path.isfile(handle): 
            handle = open(handle)
        if type(handle) is TextIOWrapper:
            if handle.name.endswith(('.gz','.bz')):
                raise Exception("Compressed files are currently not supported!")
            self.handle = handle
        else:
            sys.stderr.write("[ERROR] Couldn't guess handle for %s\n"%str(handle))
            sys.exit(1)
            

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…