本文整理汇总了Python中UI.exportDefaultFileLocations方法的典型用法代码示例。如果您正苦于以下问题:Python UI.exportDefaultFileLocations方法的具体用法?Python UI.exportDefaultFileLocations怎么用?Python UI.exportDefaultFileLocations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UI
的用法示例。
在下文中一共展示了UI.exportDefaultFileLocations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getUniProtURLsForAllSupportedSpecies
# 需要导入模块: import UI [as 别名]
# 或者: from UI import exportDefaultFileLocations [as 别名]
def getUniProtURLsForAllSupportedSpecies():
### Import all UniProt supproted species and URLs
species_uniprot_db={}
fn=filepath('Config/uniprot-species-file.txt')
for line in open(fn,'r').xreadlines():
data = cleanUpLine(line)
species_full,taxid,url = string.split(data,'\t')
if 'Homo sapiens' not in species_full: ### There's a separate file for us humans (so egotistical!!!)
species_uniprot_db[species_full] = taxid,url
import AltAnalyze
###Get species annotations from the GO-Elite config
species_annot_db=AltAnalyze.importGOEliteSpeciesInfo()
### Export all urls for currently supported species
import UI
file_location_defaults = UI.importDefaultFileLocations()
location_db={}; species_added=[]
for species_full in species_annot_db:
if species_full in species_uniprot_db:
taxid,url = species_uniprot_db[species_full]
species_code = species_annot_db[species_full].SpeciesCode()
try: location_db[url].append(species_code)
except Exception: location_db[url] = [species_code]
species_added.append(species_full)
for species_full in species_annot_db:
taxid = species_annot_db[species_full].TaxID()
species_code = species_annot_db[species_full].SpeciesCode()
if species_full not in species_added:
for species_name in species_uniprot_db:
tax,url = species_uniprot_db[species_name]
if tax == taxid:
location_db[url].append(species_code)
print species_code
for url in location_db:
species = string.join(location_db[url],'|')
fl = UI.FileLocationData('ftp', url, species)
try: file_location_defaults['UniProt'].append(fl)
except KeyError: file_location_defaults['UniProt'] = [fl]
UI.exportDefaultFileLocations(file_location_defaults)