示例#1
0
    def _do_check(self, seq):
        min_ = self.min
        max_ = self.max
        length = uppercase_length(get_str_seq(seq)) if self.ignore_masked else get_length(seq)

        passed = True
        if min_ is not None and length < min_:
            passed = False
        if max_ is not None and length > max_:
            passed = False
        return passed
示例#2
0
    def _do_check(self, seq):
        min_ = self.min
        max_ = self.max
        length = uppercase_length(get_str_seq(seq)) if self.ignore_masked else get_length(seq)

        passed = True
        if min_ is not None and length < min_:
            passed = False
        if max_ is not None and length > max_:
            passed = False
        return passed
示例#3
0
 def __call__(self, seqrecords):
     'It filters out the short seqrecords.'
     stats = self._stats
     threshold = self.threshold
     reverse = self.reverse
     ignore_masked = self.ignore_masked
     stats[PROCESSED_PACKETS] += 1
     processed_seqs = []
     for seqrecord in seqrecords:
         stats[PROCESSED_SEQS] += 1
         seq = str(seqrecord.seq)
         length = uppercase_length(seq) if ignore_masked else len(seq)
         passed = True if length >= threshold else False
         if reverse:
             passed = not(passed)
         if passed:
             processed_seqs.append(seqrecord)
             stats[YIELDED_SEQS] += 1
     return processed_seqs
 def test_uppercase_length(self):
     "It counts the number of uppercase letters in a string"
     assert uppercase_length("aCTaGGt") == 4
     assert uppercase_length("acagt") == 0
示例#5
0
 def test_uppercase_length(self):
     'It counts the number of uppercase letters in a string'
     assert uppercase_length('aCTaGGt') == 4
     assert uppercase_length('acagt') == 0
示例#6
0
 def test_uppercase_length(self):
     'It counts the number of uppercase letters in a string'
     assert uppercase_length('aCTaGGt') == 4
     assert uppercase_length('acagt') == 0