<jupyter_start><jupyter_text>hESC<jupyter_code>fname='/home/linaiqi/Lab/data/BEELINE-data/inputs/scRNA-Seq/hESC/GeneOrdering.csv'
df = pd.read_csv(fname)
df=df.sort_values(by=['Variance'], ascending=False)
df.head()
genes=df.iloc[:ngene, 0].tolist()
# df=df.rename(mapper={'Unnamed: 0': "gene"}, axis='columns')
# df=df.set_index('gene')
# fout='/home/linaiqi/Lab/data/hESC200-celldata.csv'
# df.iloc[:ngene].to_csv(fout)
fname='/home/linaiqi/Lab/data/BEELINE-data/inputs/scRNA-Seq/hESC/ExpressionData.csv'
df = pd.read_csv(fname)
df.head()
lst=df.columns
lst
cnt=0
fout='/home/linaiqi/Lab/data/hESC200-celldata.csv'
with open(fout,'w') as f:
    f.write(',PseudoTime1\n')
    for g in lst[1:]:
        f.write('%s,%d\n'%(g,cnt))
        cnt+=1
df=df.rename(mapper={'Unnamed: 0': "gene"}, axis='columns')
df=df.set_index('gene')
fout='/home/linaiqi/Lab/data/bl-hESC200.csv'
df.loc[genes].to_csv(fout)
data=df.loc[genes].to_numpy().T
data.shape
fout='/home/linaiqi/Lab/data/hESC200.txt'
with open(fout, 'w') as f:
    f.write("\t".join(genes)+'\n')
    for i in range(data.shape[0]):
        f.write('%.8f'%data[i, 0])
        for j in range(1, data.shape[1]):
            f.write('\t%.8f'%data[i, j])
        f.write('\n')
fname='/home/linaiqi/Lab/data/Networks/human/hESC-ChIP-seq-network.csv'
fout='/home/linaiqi/Lab/data/bl-hESC200-ChIP-seq-network.csv'

cnt=0
with open(fname) as fin, open(fout, 'w') as f:
    l = fin.readline()
    f.write(l)
    for l in fin:
        a, b = l.strip().split(',')
        if a in genes and b in genes:
            cnt+=1
            f.write('%s,%s\n'%(a,b))
print(cnt)
fname='/home/linaiqi/Lab/data/Networks/human/Non-specific-ChIP-seq-network.csv'
fout='/home/linaiqi/Lab/data/bl-hESC200-nonspec-ChIP-seq-network.csv'

cnt=0
with open(fname) as fin, open(fout, 'w') as f:
    l = fin.readline()
    f.write(l)
    for l in fin:
        a, b = l.strip().split(',')
        if a in genes and b in genes:
            cnt+=1
            f.write('%s,%s\n'%(a,b))
print(cnt)
fname='/home/linaiqi/Lab/data/Networks/human/STRING-network.csv'
fout='/home/linaiqi/Lab/data/bl-hESC200-STRING-network.csv'

with open(fname) as fin, open(fout, 'w') as f:
    l = fin.readline()
    f.write(l)
    for l in fin:
        a, b = l.strip().split(',')
        if a in genes and b in genes:
            f.write('%s,%s\n'%(a,b))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2089991589571068, 'fraction_numerical': 0.0159798149705635, 'mean_word_length': 3.3097826086956523, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '496180', 'license': 'MIT', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1068, 'n_words': 157, 'path': 'eval/beeline-hESC-preprocess.ipynb', 'repo_name': 'naiqili/GPGene-TCBB', 'size': '2378'}