Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(2)  |  Derive(0)  |  Import(1)
It checks if a Biopython ValueError is due to a malformed quality file

        def error_quality_disagree(error_msg):
    'It checks if a Biopython ValueError is due to a malformed quality file'
    msg = 'Sequence length and number of quality scores disagree'
    msg2 = 'Lengths of sequence and quality values differs'
    if msg in str(error_msg) or msg2 in str(error_msg):
        return True
    else:
        return False
        


src/s/e/seq_crumbs-HEAD/crumbs/seqio.py   seq_crumbs(Download)
from crumbs.utils.data import (ambiguous_rna_letters, ambiguous_dna_letters,
                               extended_protein_letters)
from crumbs.exceptions import (MalformedFile, error_quality_disagree,
                               UnknownFormatError, IncompatibleFormatError,
                               FileIsEmptyError, IsSingleLineFastqError)
            write_seqrecs(seqs, out_fhand, out_format)
        except ValueError, error:
            if error_quality_disagree(error):
                raise MalformedFile(str(error))
            if 'No suitable quality scores' in str(error):
        write_seqrecs(seqrecords, out_fhand.name, 'fastq')
    except ValueError, error:
        if error_quality_disagree(error):
            raise MalformedFile(str(error))
        raise