def get_seqids(self): result = [] err = Error() stra = StrArray(gtlib.gt_feature_index_get_seqids(self.fi, err)) if stra == None: gterror(err) for i in range(stra.size()): result.append(stra.get(i)) return result
def encode(self, seqfiles, indexname): if not isinstance(seqfiles, list): raise TypeError, "argument must be a list of strings" if len(seqfiles) == 0: raise Error, "list of input sequence files must be non-empty" sa = StrArray() for f in seqfiles: if not os.path.exists(str(f)): raise IOError, ("file not found: %s" % str(f)) sa.add(str(f)) err = Error() esptr = gtlib.gt_encseq_encoder_encode(self.ee, sa, str(indexname), err) if esptr != 0: gterror(err)
def create_from_sequence(seqfilenames): if not isinstance(seqfilenames, list): raise TypeError, "argument must be a list of strings" e = Error() sa = StrArray() for f in seqfilenames: if not os.path.exists(f): raise IOError, ("file not found: %s" % f) sa.add(str(f)) a_ptr = gtlib.gt_alphabet_new_from_sequence(sa, e) a = Alphabet(a_ptr, True) if a == None: gterror(e) else: return a
def get_used_types(self): str_array_ptr = gtlib.gt_gff3_in_stream_get_used_types(self.gs) used_types = StrArray(str_array_ptr) return used_types.to_list()
def filenames(self, num): arr = StrArray(gtlib.gt_encseq_filenames(seld.encseq)) return arr.to_list()