scout/parse/ensembl.py
def parse_ensembl_genes(lines):
    """Parse lines with ensembl formated genes

        This is designed to take a biomart dump with genes from ensembl.
        Mandatory columns are:
        'Gene ID' 'Chromosome' 'Gene Start' 'Gene End' 'HGNC symbol

        Args:
            lines(iterable(str)): An iterable with ensembl formated genes
        Yields:
            ensembl_gene(dict): A dictionary with the relevant information
    """
    LOG.info("Parsing ensembl genes from file")
    header = []
    for index, line in enumerate(lines):

        # File allways start with a header line
        if index == 0:
            header = line.rstrip().split('\t')
            continue
        # After that each line represents a gene

        yield parse_ensembl_line(line, header)
def parse_ensembl_genes(lines):
    LOG.info("Parsing ensembl genes from file")
    header = []
    for index, line in enumerate(lines):

        # File allways start with a header line
        if index == 0:
            header = line.rstrip().split('\t')
            continue
        # After that each line represents a gene

        yield parse_ensembl_line(line, header)
def parse_ensembl_genes ( lines ) : LOG . info ( "Parsing ensembl genes from file" ) header = [ ] for index , line in enumerate ( lines ) : # File allways start with a header line if index == 0 : header = line . rstrip ( ) . split ( '\t' ) continue # After that each line represents a gene yield parse_ensembl_line ( line , header )
Parse lines with ensembl formated genes

        This is designed to take a biomart dump with genes from ensembl.
        Mandatory columns are:
        'Gene ID' 'Chromosome' 'Gene Start' 'Gene End' 'HGNC symbol

        Args:
            lines(iterable(str)): An iterable with ensembl formated genes
        Yields:
            ensembl_gene(dict): A dictionary with the relevant information
Parse lines with ensembl formated genes