def _process_stock_genotype(self, limit):
        """
        The genotypes of the stocks.

        :param limit:
        :return:
        """

        if self.test_mode:
            graph = self.testgraph
        else:
            graph = self.graph

        raw = '/'.join((self.rawdir, 'stock_genotype'))
        LOG.info("processing stock genotype")
        line_counter = 0

        with open(raw, 'r') as f:
            filereader = csv.reader(f, delimiter='\t', quotechar='\"')
            f.readline()  # read the header row; skip
            for line in filereader:
                (stock_genotype_id, stock_id, genotype_id) = line

                stock_key = stock_id
                stock_id = self.idhash['stock'][stock_key]
                genotype_key = genotype_id
                genotype_id = self.idhash['genotype'][genotype_key]

                if self.test_mode \
                        and int(genotype_key) not in self.test_keys['genotype']:
                    continue

                graph.addTriple(stock_id, self.globaltt['has_genotype'], genotype_id)

                line_counter += 1

                if not self.test_mode and limit is not None and line_counter > limit:
                    break

        return
def _process_stock_genotype ( self , limit ) : if self . test_mode : graph = self . testgraph else : graph = self . graph raw = '/' . join ( ( self . rawdir , 'stock_genotype' ) ) LOG . info ( "processing stock genotype" ) line_counter = 0 with open ( raw , 'r' ) as f : filereader = csv . reader ( f , delimiter = '\t' , quotechar = '\"' ) f . readline ( ) for line in filereader : ( stock_genotype_id , stock_id , genotype_id ) = line stock_key = stock_id stock_id = self . idhash [ 'stock' ] [ stock_key ] genotype_key = genotype_id genotype_id = self . idhash [ 'genotype' ] [ genotype_key ] if self . test_mode and int ( genotype_key ) not in self . test_keys [ 'genotype' ] : continue graph . addTriple ( stock_id , self . globaltt [ 'has_genotype' ] , genotype_id ) line_counter += 1 if not self . test_mode and limit is not None and line_counter > limit : break return
The genotypes of the stocks.

        :param limit:
        :return: