def get_first_rec(fastafile):
    """
    Returns the first record in the fastafile
    """
    f = list(SeqIO.parse(fastafile, "fasta"))

    if len(f) > 1:
        logging.debug("{0} records found in {1}, using the first one".
                      format(len(f), fastafile))

    return f[0]
def get_first_rec ( fastafile ) : f = list ( SeqIO . parse ( fastafile , "fasta" ) ) if len ( f ) > 1 : logging . debug ( "{0} records found in {1}, using the first one" . format ( len ( f ) , fastafile ) ) return f [ 0 ]
Returns the first record in the fastafile