def _get_gene_detailed(self): """ define a gene detailed table """ #unique identifier for each entry i = 0 table_contents = detailed_list = [] config = read_gemini_config(args=self.args) path_dirname = config["annotation_dir"] file_handle = os.path.join(path_dirname, 'detailed_gene_table_v75') for line in open(file_handle, 'r'): field = line.strip().split("\t") if not field[0].startswith("Chromosome"): i += 1 table = gene_table.gene_detailed(field) detailed_list = [str(i),table.chrom,table.gene,table.is_hgnc, table.ensembl_gene_id,table.ensembl_trans_id, table.biotype,table.trans_status,table.ccds_id, table.hgnc_id,table.entrez,table.cds_length,table.protein_length, table.transcript_start,table.transcript_end, table.strand,table.synonym,table.rvis,table.mam_phenotype] table_contents.append(detailed_list) database.insert_gene_detailed(self.c, table_contents)
def _get_gene_detailed(self): """ define a gene detailed table """ #unique identifier for each entry i = 0 table_contents = detailed_list = [] config = read_gemini_config(args=self.args) path_dirname = config["annotation_dir"] file_handle = os.path.join(path_dirname, 'detailed_gene_table_v75') for line in open(file_handle, 'r'): field = line.strip().split("\t") if not field[0].startswith("Chromosome"): i += 1 table = gene_table.gene_detailed(field) detailed_list = [ str(i), table.chrom, table.gene, table.is_hgnc, table.ensembl_gene_id, table.ensembl_trans_id, table.biotype, table.trans_status, table.ccds_id, table.hgnc_id, table.entrez, table.cds_length, table.protein_length, table.transcript_start, table.transcript_end, table.strand, table.synonym, table.rvis, table.mam_phenotype ] table_contents.append(detailed_list) database.insert_gene_detailed(self.c, table_contents)
def _get_gene_detailed(self): """ define a gene detailed table """ #unique identifier for each entry i = 0 table_contents = detailed_list = [] config = read_gemini_config() path_dirname = config["annotation_dir"] file_handle = os.path.join(path_dirname, 'detailed_gene_table_v75') header= ['uid','chrom','gene','is_hgnc','ensembl_gene_id','transcript','biotype','transcript_status','ccds_id','hgnc_id',\ 'entrez_id','cds_length','protein_length','transcript_start','transcript_end','strand','synonym','rvis_pct','mam_phenotype_id'] import csv with open('../gene_detailed.csv', 'wb') as csvfile: rowwriter = csv.writer(csvfile, delimiter=',', quotechar='|', quoting=csv.QUOTE_MINIMAL) rowwriter.writerow(header) for line in open(file_handle, 'r'): field = line.strip().split("\t") if not field[0].startswith("Chromosome"): i += 1 table = gene_table.gene_detailed(field) detailed_list = [str(i),table.chrom,table.gene,table.is_hgnc, table.ensembl_gene_id,table.ensembl_trans_id, table.biotype,table.trans_status,table.ccds_id, table.hgnc_id,table.entrez,table.cds_length,table.protein_length, table.transcript_start,table.transcript_end, table.strand,table.synonym,table.rvis,table.mam_phenotype] rowwriter.writerow(detailed_list) # if(i==5): # print detailed_list # table_contents.append(detailed_list) #database.insert_gene_detailed(self.c, table_contents) """