Changeset 1416:a644a8a541d3 in orange-bioinformatics


Ignore:
Timestamp:
06/13/11 10:21:03 (3 years ago)
Author:
markotoplak
Branch:
default
Convert:
66933f8c7e1182f6f2cea62590b87a9a054d3392
Message:

obiGEO: you can now set gene label for the transpose function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • obiGEO.py

    r996 r1416  
    316316    return new 
    317317 
    318 def transpose_labels_to_class(data, class_label=None): 
     318def transpose_labels_to_class(data, class_label=None, gene_label="gene"): 
    319319    """Converts data with genes in rows to data with genes as attributes.""" 
    320320    # if no class_label (attribute type) given, guess it from the data 
     
    330330                          % (", ".join(l), class_label)) 
    331331 
    332     if "gene" in [v.name for v in data.domain.getmetas().values()]: 
    333         atts = [orange.FloatVariable(str(d["gene"])) for d in data] 
     332    if gene_label in [v.name for v in data.domain.getmetas().values()]: 
     333        atts = [orange.FloatVariable(str(d[gene_label])) for d in data] 
    334334    else: 
    335335        atts = [orange.FloatVariable("A%d" % i) for i in range(len(data))] 
Note: See TracChangeset for help on using the changeset viewer.