Changeset 1682:2e2c671e4300 in orange-bioinformatics for _bioinformatics/obiGene.py


Ignore:
Timestamp:
06/12/12 11:15:18 (23 months ago)
Author:
Lan Zagar <lan.zagar@…>
Branch:
default
Message:

Replaced split(\n) with splitlines (closes #1160).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGene.py

    r1643 r1682  
    7474        fname = orngServerFiles.localpath_download("NCBI_geneinfo", "gene_info.%s.db" % self.taxid) 
    7575        file = open(fname, "rb") 
    76         self.update(dict([(line.split("\t", 3)[1], line) for line in file.read().split("\n") if line.strip() and not line.startswith("#")])) 
     76        self.update(dict([(line.split("\t", 3)[1], line) for line in file.read().splitlines() if line.strip() and not line.startswith("#")])) 
    7777 
    7878        # NOTE orig init time for gene matcher: 2.5s, new 4s: investigate the slowdown 
     
    9494            fname = orngServerFiles.localpath_download("NCBI_geneinfo", "gene_history.%s.db" % self.taxid) 
    9595            try: 
    96                 self._history = dict([(line.split("\t")[2], GeneHistory(line)) for line in open(fname, "rb").read().split("\n")]) 
     96                self._history = dict([(line.split("\t")[2], GeneHistory(line)) for line in open(fname, "rb").read().splitlines()]) 
    9797                 
    9898            except Exception, ex: 
     
    127127        if type(file) in [str, unicode]: 
    128128            file = open(file, "rb") 
    129         return cls((line.split("\t", 3)[1], line) for line in file.read().split("\n") if line.strip() and not line.startswith("#")) 
     129        return cls((line.split("\t", 3)[1], line) for line in file.read().splitlines() if line.strip() and not line.startswith("#")) 
    130130         
    131131    def get_info(self, gene_id, def_=None): 
Note: See TracChangeset for help on using the changeset viewer.