コード例 #1
0
ファイル: encseq.py プロジェクト: random234/genometools_smax
 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)
コード例 #2
0
 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
コード例 #3
0
 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