Giter Site home page Giter Site logo

eva-common-pyutils's Introduction

EBI EVA - Common Python Utilities

Assembly retrieval module

Create a object that will download and organise all the assemblies under onw directory. The scientific name is provided to place the assembly in a species specific subfolder. No checks are performed to see if the assembly and the species match.

from ebi_eva_common_pyutils.assembly import NCBIAssembly

assembly = NCBIAssembly('GCA_000008865.1', 'Escherichia coli O157:H7 str. Sakai', download_destination)
assembly.download_or_construct()
assembly.assembly_fasta_path

To only download the report

from ebi_eva_common_pyutils.assembly import NCBIAssembly

assembly = NCBIAssembly('GCA_000008865.1', 'Escherichia coli O157:H7 str. Sakai', download_destination)
assembly.download_assembly_report()
assembly.assembly_report_path

Logging

Central logging is provided by the logger module which takes care of propagating all handler to any newly created logger. You need to create at least one handler for the logging to happen.

from ebi_eva_common_pyutils.logger import logging_config as log_cfg 
log_cfg.add_stderr_handler()
logger = log_cfg.get_logger(__name__)
logger.info('Information')

Or from any class

from ebi_eva_common_pyutils.logger import logging_config as log_cfg 

class Foo(log_cfg.AppLogger):

    def bar(self):
        self.info('Information')

def main():
    log_cfg.add_stderr_handler()

eva-common-pyutils's People

Contributors

andresfsilva avatar apriltuesday avatar nitin-ebi avatar sundarvenkata-ebi avatar tcezard avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.