import csv


def parse_rnacsv(rnaseq_csv):
    """parse a csv file and extract accessions and rnaseq names"""
    with open(rnaseq_csv, 'r') as f:
        reader = csv.reader(f)
        header = next(reader)[1:] # Skip the empty col
        # Generate dictionaries:
        rnavalues = {}
        for rna_id in header:
            rnavalues[rna_id] = []
        # Populate with entries
        accession_ids = []
        for line in reader:
            accession_ids.append(line[0])
            for i,rna_id in enumerate(header):
                rnavalues[rna_id].append(float(line[1+i]))
    return accession_ids, rnavalues