当前位置: 首页>>代码示例>>Python>>正文


Python File.dataSubType方法代码示例

本文整理汇总了Python中synapseclient.File.dataSubType方法的典型用法代码示例。如果您正苦于以下问题:Python File.dataSubType方法的具体用法?Python File.dataSubType怎么用?Python File.dataSubType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在synapseclient.File的用法示例。


在下文中一共展示了File.dataSubType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: uploadToSynapse

# 需要导入模块: from synapseclient import File [as 别名]
# 或者: from synapseclient.File import dataSubType [as 别名]
def uploadToSynapse(f):
    """Given a filepath extracts metadata and uploads to Synapse"""
    center, sample_id, workflow_name, date, call_type, dataType, fileType = ['']*7
    url = URLBASE+f
    if   'OICR_BL' in f: center = 'oicr_bl'
    elif 'CRG/clindel/somatic' in f:  center = 'crg_clindel'
    else: center = f.split('/')[4]
    filename =  f.split('/')[-1]
    if center in ('yale', 'wustl', 'LOHcomplete'):
        if filename =='bd829214-f230-4331-b234-def10bbe7938CNV.vcf.gz':
            sample_id, dataType, fileType='bd829214-f230-4331-b234-def10bbe7938', 'cnv', 'vcf'
        else:
            sample_id, dataType = filename.lower().split('.')[:2]
            fileType =  [i for i in filename.split('.')[2:] if i != 'gz'][-1]
    elif center in ('broad', 'BSC', 'oicr_sga', 'mda_kchen', 'MDA_HGSC', 'mcgill_popsv', 'sfu', 'UCSC', 'oicr_bl', 'Synteka_pgm21', 'crg_clindel'):
        sample_id, workflow_name, date, call_type, dataType  =  filename.replace('indels', 'indel', split('.')[:5])
        fileType =  [i for i in filename.split('.')[5:] if i != 'gz'][-1]
    else:
        print 'Not uploading:', f
        return 
    print center, workflow_name, date, call_type, dataType, fileType
    file = File(url, parentId=DIRS[center], synapseStore=False)
    file.center = center.lower()
    file.sample_id = sample_id
    file.workflow_name = workflow_name
    file.date = date
    file.call_type = call_type
    file.dataType = 'DNA'
    file.disease = 'Cancer'
    file.dataSubType = dataType
    file.fileType = fileType
    #file.analysis_id_tumor = ?????
    syn.store(file, forceVersion=False)
开发者ID:larssono,项目名称:synapseICGCSampleTracker,代码行数:35,代码来源:uploadSynapse.py

示例2: range

# 需要导入模块: from synapseclient import File [as 别名]
# 或者: from synapseclient.File import dataSubType [as 别名]
PLATFORM_MAP = {'133AB': 'AffymetrixU133AB', 
                'Plus2': 'AffymetrixU133Plus2'}
	
query = 'select id, name from entity where parentId=="%s"' %OLDPARENTID
df = synapseHelpers.query2df(syn.chunkedQuery(query))
for i in range(1,df.shape[0]):
    row =  df.ix[i, :]
    ent = syn.get(row.id)
    fStudy, fTissue, fPlatform, fDatatype,  fRest = ent.name.split('_')
    name = 'AMP-AD_MSBB_MSSM_%s_%s_%s' % (PLATFORM_MAP[fPlatform],   
                                          TISSUEABRMAP[fTissue][0], fRest)
    print name
    os.rename(ent.path, name)

    f = File(name, parentId=NEWPARENTID, name=name[7:])
    f.consortium = 'AMP-AD'
    f.study = 'MSBB'
    f.center = 'MSSM'
    f.dataType =  'mRNA'
    f.disease = 'Alzheimers Disease'
    f.platfrom = PLATFORM_MAP[fPlatform]
    f.tissueTypeAbrv = TISSUEABRMAP[fTissue][1]
    f.tissueType = TISSUEABRMAP[fTissue][0]
    f.dataSubType = 'geneExp'
    f.fileType =  'genomicMatrix'
    f.organism =  'human'
    f = syn.store(f, used = [ent], executed=['https://github.com/Sage-Bionetworks/ampAdScripts/blob/4d7d6b78b1e73058483354a1a18bff7422966a4b/Mount-Sinai/migrateMSBBExpression.py'], activityName='Data migration')
    

开发者ID:th1vairam,项目名称:ampAdScripts,代码行数:29,代码来源:migrateMSBBExpression.py

示例3: File

# 需要导入模块: from synapseclient import File [as 别名]
# 或者: from synapseclient.File import dataSubType [as 别名]
    ent = syn.get(row.id)

    # fStudy, fTissue, fPlatform, fDatatype, fProcess,  fRest = ent.name.split('_')
    # name = 'AMP-AD_MSBB_MSSM_%s_%s_%s' % (PLATFORM_MAP[fPlatform],   
    #                                       TISSUEABRMAP[fTissue][0], fRest
    fStudy, fTissue, fPlatform, fDatatype,  fProcess, fRest = ent.name.split('_')
    name = 'AMP-AD_MSBB_MSSM_%s_%s_%s_%s' % (PLATFORM_MAP[fPlatform],   
                                             TISSUEABRMAP[fTissue][0], 
                                             fProcess, 
                                             fRest)
    print name
    used =  syn.query('select id from file where parentId=="%s" and tissueType=="%s" ' %(EXPRFILE_PARENTID, TISSUEABRMAP[fTissue][0]))['results'][0].values()[0]
    os.rename(ent.path, name)

    f = File(name, parentId=NEWPARENTID, name=name[7:])
    f.consortium = 'AMP-AD'
    f.study = 'MSBB'
    f.center = 'MSSM'
    f.dataType =  'mRNA'
    f.disease = 'Alzheimers Disease'
    f.platfrom = PLATFORM_MAP[fPlatform]
    f.tissueTypeAbrv = TISSUEABRMAP[fTissue][1]
    f.tissueType = TISSUEABRMAP[fTissue][0]
    f.dataSubType = 'CoExpression'
    f.fileType =  'genomicMatrix'
    f.organism =  'human'
    f = syn.store(f, used = [used], executed=['syn2731322'], 
                  activityName='Weighted coexpression network modules using Coexpp v 0.1.0')
    

开发者ID:th1vairam,项目名称:ampAdScripts,代码行数:30,代码来源:migrateMSBBCoExpression.py


注:本文中的synapseclient.File.dataSubType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。