Exemplo n.º 1
0
    def __init__(self, filename, sepn=None, use_sa=1, print_flag=0):
        self.thisown = 0
        if sepn == None:
            sepn = []

        # Need to change directory because the C code works only on UNIX
        old_workdir = os.getcwd()
        new_workdir, new_filename = os.path.split(filename)
        if len(new_workdir):
            os.chdir(new_workdir)

        self.this = FS.new_Index(new_filename, sepn, use_sa, print_flag)

        # Return to old working directory
        if len(new_workdir):
            os.chdir(old_workdir)

        self.thisown = 1
        self.__dict__.update(FS.Index_get_data(self))
Exemplo n.º 2
0
 def kNN_srch(self, qseq, M, kNN, stype=FS_BINS, ptype=SARRAY, qdef=""):
     hits_dict = FS.Index_kNN_srch(self, qseq, M, kNN, stype, ptype, qdef)
     return HitList(hits_dict)
Exemplo n.º 3
0
    def rng_srch(self, qseq, M, rng, stype=FS_BINS, ptype=SARRAY, qdef=""):

        hits_dict = FS.Index_rng_srch(self, qseq, M, rng, M.conv_type, stype,
                                      ptype, qdef)
        return HitList(hits_dict)
Exemplo n.º 4
0
 def get_unique_bin_size(self, bin):
     return FS.Index_get_unique_bin_size(self, bin)
Exemplo n.º 5
0
 def print_stats(self, options=3):
     return FS.Index_print_stats(self, options)
Exemplo n.º 6
0
 def print_bin(self, bin, options=1):
     return FS.Index_print_bin(self, bin, options)
Exemplo n.º 7
0
 def seq2bin(self, seq):
     return FS.Index_seq2bin(self, seq)
Exemplo n.º 8
0
 def __str__(self):
     return FS.Index___str__(self)
Exemplo n.º 9
0
 def save(self, filename):
     return FS.Index_save(self, filename)
Exemplo n.º 10
0
 def __del__(self):
     if self.thisown:
         FS.delete_Index(self)
Exemplo n.º 11
0
def _get_ix_data(I):
    return FS.Index_get_data(I)
Exemplo n.º 12
0
def _get_db(I):
    return db(FS.Index_s_db_get(I), new=False, own=False)
Exemplo n.º 13
0
 def threaded_search(self, srch_args):
     results = FS.Index_threaded_search(self, srch_args)
     return [HitList(r) for r in results]