<jupyter_start><jupyter_text>for getting all gene biotype (below code)<jupyter_code>import pandas as pd
df_all_gene = pd.read_csv('/dataset/Ensembl_numeric/all_gene_data/all_gene_sorted_chr/all_gene_data_sorted_chr.csv', index_col=0)
df_all_gene.head(2)
import pandas as pd
df_all_gene_overlap = pd.read_csv('/feature_selection/overlap/Ensembl/all_gene_overlap.csv', index_col=0)
df_all_gene_overlap.head(2)
all_gene_id = df_all_gene['Gene ID']
overlap_all_gene_id = df_all_gene_overlap['all gene ID']
df_all_gene_with_index = df_all_gene.set_index(['Gene ID'])

df_all_gene_with_index.head(3)
df_all_gene_with_index[df_all_gene_with_index.columns[1]][0]
df_all_gene_with_index.loc['ENSG00000186063']['SNO']
overlap_gene_biotype = []
from tqdm import tqdm
def get_gene_biotype():
    for i in tqdm(range((len(df_all_gene_overlap)))):
        overlap_gene_biotype.append(df_all_gene_with_index.loc[df_all_gene_overlap['all gene ID'][i]]['Biotype'])
get_gene_biotype()
df_all_gene_overlap['All Gene biotype'] = overlap_gene_biotype
df_all_gene_overlap.head(2)
df_all_gene_overlap = df_all_gene_overlap[['lincRNA ID', 'all gene ID', 'All Gene biotype', 'Chr region', 'No. of transcripts in lincrna', 'No. of transcripts in all gene', 'Ensembl-Ensembl overlap ?', 'Ensembl-linc_Ensembl overlap?', 'same_opp_overlap']]
df_all_gene_overlap.head(2)
df_all_gene_overlap.to_csv('/feature_selection/overlap/Ensembl/all_gene_overlap.csv')<jupyter_output><empty_output><jupyter_text>Ens(linc) vs Ens(linc) overlap [yes/no ?] wrongly calculated.  Correcting it below<jupyter_code>df_linc_all_gene_overlap = pd.read_csv('/feature_selection/overlap/Ensembl/all_gene_overlap.csv', index_col=0)
df_linc_all_gene_overlap.head(3)
df_linc_all_gene_overlap.drop('Ensembl-linc_Ensembl overlap?', axis=1, inplace=True)
same_lincrna_ensg = []
from tqdm import tqdm
df_ens_all_gene_index = df_all_gene.set_index(['Gene ID'])
df_ens_linc_overlap_index = df_linc_all_gene_overlap.set_index(['all gene ID'])
for i in tqdm(range(len(df_linc_all_gene_overlap))):
    if df_ens_all_gene_index.loc[df_linc_all_gene_overlap['all gene ID'][i]]['Biotype'] == 'lincRNA':
        same_lincrna_ensg.append('Yes')
    else:
        same_lincrna_ensg.append('No')
len(same_lincrna_ensg)
df_linc_all_gene_overlap['Ensembl-linc_Ensembl overlap?'] = same_lincrna_ensg
df_linc_all_gene_overlap.to_csv('/feature_selection/overlap/Ensembl/all_gene_overlap.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11901840490797547, 'fraction_numerical': 0.009406952965235174, 'mean_word_length': 9.149377593360995, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '263131', 'license': 'Apache-2.0', 'n_tokens_mistral': 1064, 'n_tokens_neox': 995, 'n_words': 129, 'path': 'feature_selection/overlap/python_scripts/gene_overlap_function_ens-ens.ipynb', 'repo_name': 'EnsemblGSOC/lncRNA-analysis', 'size': '2445'}