src/etl/bgi_etl.py
def locations_process(self, basic_genetic_entity, chromosomes, genomic_locations):
        """Get chromosome and genomic location info."""
        primary_id = basic_genetic_entity.get('primaryId')

        if 'genomeLocations' not in basic_genetic_entity:
            return
        for genome_location in basic_genetic_entity.get('genomeLocations'):
            chromosome = genome_location.get('chromosome')
            if chromosome is not None:
                if chromosome.startswith("chr"):
                    chromosome = chromosome[3:]

                if chromosome not in chromosomes:
                    chromosomes[chromosome] = {"primaryKey": chromosome}

                if 'startPosition' in genome_location:
                    start = genome_location['startPosition']
                else:
                    start = None

                if 'endPosition' in genome_location:
                    end = genome_location['endPosition']
                else:
                    end = None

                if 'strand' in basic_genetic_entity['genomeLocations']:
                    strand = genome_location['strand']
                else:
                    strand = None

            assembly = genome_location.get('assembly')

            if 'strand' in genome_location:
                strand = genome_location['strand']
            else:
                strand = None

            genomic_locations.append({"primaryId": primary_id,
                                      "chromosome": chromosome,
                                      "start": start,
                                      "end": end,
                                      "strand": strand,
                                      "assembly": assembly,
                                      "uuid": str(uuid.uuid4()),
                                      "dataProvider": self.data_provider})
Get chromosome and genomic location info.
Get chromosome and genomic location info.
Get chromosome and genomic location info .
def locations_process(self, basic_genetic_entity, chromosomes, genomic_locations):
        primary_id = basic_genetic_entity.get('primaryId')
        if 'genomeLocations' not in basic_genetic_entity:
            return
        for genome_location in basic_genetic_entity.get('genomeLocations'):
            chromosome = genome_location.get('chromosome')
            if chromosome is not None:
                if chromosome.startswith("chr"):
                    chromosome = chromosome[3:]
                if chromosome not in chromosomes:
                    chromosomes[chromosome] = {"primaryKey": chromosome}
                if 'startPosition' in genome_location:
                    start = genome_location['startPosition']
                else:
                    start = None
                if 'endPosition' in genome_location:
                    end = genome_location['endPosition']
                else:
                    end = None
                if 'strand' in basic_genetic_entity['genomeLocations']:
                    strand = genome_location['strand']
                else:
                    strand = None
            assembly = genome_location.get('assembly')
            if 'strand' in genome_location:
                strand = genome_location['strand']
            else:
                strand = None
            genomic_locations.append({"primaryId": primary_id,
                                      "chromosome": chromosome,
                                      "start": start,
                                      "end": end,
                                      "strand": strand,
                                      "assembly": assembly,
                                      "uuid": str(uuid.uuid4()),
                                      "dataProvider": self.data_provider})
def locations_process ( self , basic_genetic_entity , chromosomes , genomic_locations ) : primary_id = basic_genetic_entity . get ( 'primaryId' ) if 'genomeLocations' not in basic_genetic_entity : return for genome_location in basic_genetic_entity . get ( 'genomeLocations' ) : chromosome = genome_location . get ( 'chromosome' ) if chromosome is not None : if chromosome . startswith ( "chr" ) : chromosome = chromosome [ 3 : ] if chromosome not in chromosomes : chromosomes [ chromosome ] = { "primaryKey" : chromosome } if 'startPosition' in genome_location : start = genome_location [ 'startPosition' ] else : start = None if 'endPosition' in genome_location : end = genome_location [ 'endPosition' ] else : end = None if 'strand' in basic_genetic_entity [ 'genomeLocations' ] : strand = genome_location [ 'strand' ] else : strand = None assembly = genome_location . get ( 'assembly' ) if 'strand' in genome_location : strand = genome_location [ 'strand' ] else : strand = None genomic_locations . append ( { "primaryId" : primary_id , "chromosome" : chromosome , "start" : start , "end" : end , "strand" : strand , "assembly" : assembly , "uuid" : str ( uuid . uuid4 ( ) ) , "dataProvider" : self . data_provider } )
Get chromosome and genomic location info.
Get chromosome and genomic location info .
"""Get chromosome and genomic location info."""
self
basic_genetic_entity
chromosomes
genomic_locations