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


Python Lims.check_version方法代码示例

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


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

示例1: LimsService

# 需要导入模块: from genologics.lims import Lims [as 别名]
# 或者: from genologics.lims.Lims import check_version [as 别名]
class LimsService(object):
    name = "lims_service"

    def __init__(self):
        super(LimsService, self).__init__()
        self.lims = Lims(BASEURI, USERNAME, PASSWORD)
        self.lims.check_version()

    @rpc
    def sample(self, lims_id):
        """Get a sample from LIMS."""
        sample_obj = LimsSample(self.lims, id=lims_id)
        sample_dict = transform_entry(sample_obj)
        return sample_dict

    @rpc
    def validate_sample(self, lims_id):
        """Validate information in the LIMS on sample level."""
        logger.debug("fetch sample from LIMS")
        sample_obj = LimsSample(self.lims, id=lims_id)

        try:
            case_id = sample_obj.udf["familyID"]
            cust_id = sample_obj.udf["customer"]
        except KeyError as error:
            raise MissingLimsDataException(error.message)
        except HTTPError as error:
            raise LimsSampleNotFoundError(error.message)

    @rpc
    def ls_case(self, cust_id, case_id):
        """Fetch all samples for a case from the LIMS."""
        sample_objs = self.lims.get_samples(udf={"customer": cust_id, "familyID": case_id})
        sample_dicts = [transform_entry(sample) for sample in sample_objs]
        analysis_types = set(sample["analysis_type"] for sample in sample_dicts)
        case_data = {"analysis_types": list(analysis_types), "samples": sample_dicts}
        return case_data

    @rpc
    def ls_project(self, project_id):
        """List all samples in a project."""
        samples = self.lims.get_samples(projectname=project_id)
        lims_ids = [sample.id for sample in samples]
        return lims_ids

    @rpc
    def pedigree(self, cust_id, case_id):
        """Generate pedigree content for a case."""
        ped_content = serialize_pedigree(self.lims, cust_id, case_id)
        return ped_content

    @rpc
    def target_reads(self, lims_id):
        """Determine the amount of reads to be sequenced."""
        sample_obj = LimsSample(self.lims, id=lims_id)
        app_tag = analysis_info(sample_obj)
        # millions of reads
        target_reads = app_tag["reads"] * 1000000
        return target_reads
开发者ID:Clinical-Genomics,项目名称:cghq-services,代码行数:61,代码来源:services.py

示例2: __init__

# 需要导入模块: from genologics.lims import Lims [as 别名]
# 或者: from genologics.lims.Lims import check_version [as 别名]
    def __init__(self, current_step, logger=None, cache=False):
        """
        Initializes the context.

        :param current_step: The step from which the extension is running
        :param logger: A logger instance
        :param cache: Set to True to use the cache folder (.cache) for downloaded files
        """
        lims = Lims(BASEURI, USERNAME, PASSWORD)
        lims.check_version()

        self.advanced = Advanced(lims)
        self.current_step = Process(lims, id=current_step)
        self.logger = logger or logging.getLogger(__name__)
        self._local_shared_files = []
        self.cache = cache
开发者ID:GitEdvard,项目名称:clarity-ext,代码行数:18,代码来源:context.py

示例3: getArgs

# 需要导入模块: from genologics.lims import Lims [as 别名]
# 或者: from genologics.lims.Lims import check_version [as 别名]
    elif lines: # Avoid printing empty files
        lp_args = ["lp"]
        if args.hostname:
            #remove that when all the calls to this script have been updated
            if args.hostname == 'homer.scilifelab.se:631':
                args.hostname='homer2.scilifelab.se:631'
            lp_args += ["-h",args.hostname]
        if args.destination:
            lp_args += ["-d",args.destination]
        lp_args.append("-") # lp accepts stdin if '-' is given as filename
        logging.info('Ready to call lp for printing.')
        sp = subprocess.Popen(lp_args, 
                              stdin=subprocess.PIPE, 
                              stdout=subprocess.PIPE, 
                              stderr=subprocess.PIPE)
        sp.stdin.write(str('\n'.join(lines)))
        logging.info('lp command is called for printing.')
        stdout,stderr = sp.communicate() # Will wait for sp to finish
        logging.info('lp stdout: {0}'.format(stdout))
        logging.info('lp stderr: {0}'.format(stderr))
        logging.info('lp command finished')
        sp.stdin.close()

if __name__ == '__main__':
    arguments = getArgs()
    lims = Lims(BASEURI,USERNAME,PASSWORD)
    lims.check_version()
    prepend = not arguments.no_prepend
    with EppLogger(arguments.log,lims=lims,prepend=prepend) as epp_logger:
        main(arguments,lims,epp_logger)
开发者ID:SciLifeLab,项目名称:scilifelab_epps,代码行数:32,代码来源:zebra_barcodes.py

示例4: namesetter

# 需要导入模块: from genologics.lims import Lims [as 别名]
# 或者: from genologics.lims.Lims import check_version [as 别名]
def namesetter(PID):

    lims = Lims(BASEURI, USERNAME, PASSWORD)
    lims.check_version()
    #Find LIMS entry with same PID
    allProjects = lims.get_projects()
    for proj in allProjects:
        if proj.id == PID:
            limsproject = proj.name
            break
    #Error handling
    if not 'limsproject' in locals():
        print "{} not available in LIMS.".format(PID)
        return None
    
    #Enter project summary process
    stepname=['Project Summary 1.3']
    process=lims.get_processes(type=stepname, projectname=limsproject)
    #Error handling
    if process == []:
        print "{} for {} is not available in LIMS.".format(stepname, limsproject)
        return None

    loop = True
    while loop:
        if "Bioinfo responsible" in process[0].udf:
            response = process[0].udf["Bioinfo responsible"]
        else:
            response = "Unassigned"
        print "Existing Bioinfo responsible for project {} aka {} is: {}".format(limsproject, PID, response.encode('utf-8'))
        
        #Checks for valid name
        in_responsibles = False
        config_responsibles =Udfconfig(lims, id="1128")
        while not in_responsibles:
            newname = raw_input("Enter name of new Bioinfo responsible: ")
            for names in config_responsibles.presets:
                if newname in names:
                    in_responsibles = True
                    newname = names
            if not in_responsibles:
                print "Subset {} not found in accepted Bioinfo responsible list.".format(newname)
            else:
                print "Suggested name is {}".format(newname)
        
        confirmation = raw_input("Project {} aka {} will have {} as new Bioinfo responsible, is this correct (Y/N)? ".format(limsproject, PID, newname))
        if confirmation == 'Y' or confirmation == 'y':
            try:
                newname.decode('ascii')
                process[0].udf["Bioinfo responsible"] = unicode(newname)
                process[0].put()
                print "Project {} aka {} assigned to {}".format(limsproject, PID, newname)
                return None
            except UnicodeDecodeError:
                #Weird solution due to put function
                process[0].udf["Bioinfo responsible"] = response
                print "ERROR: You tried to use a special character, didn't you? Don't do that. New standards and stuff..."
        elif confirmation == 'N' or confirmation == 'n':
            loop = False
        else:
            print "Invalid answer."
开发者ID:Galithil,项目名称:standalone_scripts,代码行数:63,代码来源:set_bioinforesponsible.py


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