리스트 안에 겹치는 것이 1개라도 있는 것들을 합치는 기능
import networkx as nx coll = [['aaaa', 'aaab', 'abaa'], ['bbbb', 'bbbb'], ['aaaa', 'bbbb'], ['dddd', 'dddd'], ['bbbb', 'bbbb', 'cccc','aaaa'], ['eeee','eeef','gggg','gggi'], ['gggg','hhhh','iiii']] edges = [] for i in range(len(coll)): a = coll[i] for j in range(len(coll)): if i != j: b = coll[j] if set(a).intersection(set(b)): edges.append((i,j)) G = nx.Graph() G.add_nodes_from(range(len(coll))..
더보기
[IEDB] MHC ligand binding dataset 파싱 파이썬 스크립트.
def select_necessary_info_in_iedb(x): # x : mhc_ligand_full.tsv나 mhc_ligand_full.csv를 pd.read_csv로 불러들인 후의 DataFrame import pandas as pd from tqdm import tqdm import re import gc remove_col=['Reference.1','Epitope','Reference.4','Reference.3','Assay ID', 'Reference.5','Reference.6','Reference.7','Epitope.1','Epitope.8','Epitope.9','Epitope.3', 'Epitope.4','Epitope.5','Epi..
더보기