# -*- coding: utf-8 -*-

#
# Copyright (c) 2011-2015 Genestack Limited
# All Rights Reserved
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF GENESTACK LIMITED
# The copyright notice above does not evidence any
# actual or intended publication of such source code.
#

from Metainfo import Metainfo


def xstr(arg):
    return str(arg) if arg is not None else None


class BioMetainfo(Metainfo):
    METHOD = 'genestack.bio:method'
    ORGANISM = 'genestack.bio:organism'
    STRAIN = 'genestack.bio:strain/breed/cultivar'
    BREED = STRAIN
    CULTIVAR = STRAIN
    TISSUE = 'genestack.bio:tissue'
    CELL_TYPE = 'genestack.bio:cellType'
    CELL_LINE = 'genestack.bio:cellLine'
    DEVELOPMENTAL_STAGE = 'genestack.bio:developmentalStage'
    DISEASE_STATE = 'genestack.bio:disease'
    DISEASE_STAGE = 'genestack.bio:diseaseStage'
    COMPOUND = 'genestack.bio:compoundName'
    AGE = 'genestack.bio:age'
    SEX = 'genestack.bio:sex'
    HUMAN_ETHNIC_GROUP = 'genestack.bio:humanEthnicGroup'
    READS_LINK = 'genestack.url:reads'
    DATA_LINK = 'genestack.url:data'
    BAM_FILE_LINK = 'genestack.url:bamfile'
    REFERENCE_GENOME = 'genestack.bio:referenceGenome'
    REFERENCE_GENOME_ASSEMBLY = 'genestack.bio:referenceGenomeAssembly'
    REFERENCE_GENOME_RELEASE = 'genestack.bio:referenceGenomeRelease'
    STUDY_SHORT_NAME = 'genestack.bio:shortName'

    RNASEQ_TECHNOLOGY = 'Expression profiling by high throughput sequencing'
    DNASEQ_TECHNOLOGY = 'Genome variation profiling by high throughput sequencing'
    CHIPSEQ_TECHNOLOGY = 'Genome binding/occupancy profiling by high throughput sequencing'
    MICROARRAY_TECHNOLOGY = 'Expression profiling by array'
    DNA_MICROARRAY_TECHNOLOGY = 'Genome variation profiling by SNP array'
    # SAMPLE_ID = 'genestack.bio:sampleId'      # still used in 1000 loader.
    EXTRACTED_MOLECULE = 'genestack.bio:extractedMolecule'
    PLATFORM = 'genestack.bio:platform'
    SOURCE_DATA_PREFIX = 'sourceData:'

    def add_organism(self, key, value):
        self._add_value(key, value, 'Organism')

    def add_ethnic_group(self, key, value):
        self._add_value(key, value, 'EthnicGroup')

@@ -297,102 +297,122 @@
 o%0A%0A%0A
-def xstr(arg):%0A    return str(arg) if arg is not None else None%0A%0A%0Aclass BioMetainfo(Metainfo):
+class BioMetainfo(Metainfo):%0A    %22%22%22%0A    MetainfoRepresentation with additional methods for bio metadata.%0A    %22%22%22%0A
 %0A   
@@ -2031,92 +2031,460 @@
     
-self._add_value(key, value, 'Organism')%0A%0A    def add_ethnic_group(self, key, value):
+%22%22%22%0A        Add organism value.%0A%0A        :param key: key%0A        :type key: str%0A        :param value: organism name%0A        :type value: str%0A        :rtype: None%0A        %22%22%22%0A        self._add_value(key, value, 'Organism')%0A%0A    def add_ethnic_group(self, key, value):%0A        %22%22%22%0A        Add ethnic group value.%0A%0A        :param key: key%0A        :type key: str%0A        :param value: organism name%0A        :type value: str%0A        :rtype: None%0A        %22%22%22
 %0A   

Update BioMetainfo docs.