Exemplo n.º 1
0
def count_seqs_in_files(fhands, file_format=GUESS_FORMAT):
    'It counts the seqs in the given files'
    count = 0
    for fhand in fhands:
        if file_format == GUESS_FORMAT or file_format is None:
            file_format = guess_format(fhand)
        else:
            file_format = file_format

        if file_format == 'fasta':
            count += _count_seqs_in_fasta(fhand)
        elif 'fastq' in file_format:
            count += length(QualityIO.FastqGeneralIterator(fhand))
        else:
            count += length(read_seqrecords([fhand]))
    return count
Exemplo n.º 2
0
 def test_length(self):
     'We can count an iterator'
     items = xrange(10)
     assert length(items) == 10
Exemplo n.º 3
0
 def test_length(self):
     'We can count an iterator'
     items = xrange(10)
     assert length(items) == 10