본문 바로가기

파이썬3

유전자의 펩타이드 시퀀스 불러오는 함수 biopython을 잘 사용할 줄 알면 쉽게 할 수 있을지 모르겠으나 구글링을 해도 누군가 만들어 둔 것이 없고 튜토리얼은 nucleotide서열을 불러오는 것만 있어서 다른 라이브러리를 활용해 만듬. import requests as r from Bio import SeqIO from io import StringIO import mygene as mg import pandas as pd mg = mg.MyGeneInfo() def gene2peptide(gene,taxid=9606): ''' This function will return every uniprotID and peptide sequence for the given gene. :param gene : gene ids :param taxid.. 더보기
pandas 명령어들 df['column-name'].notna() : NA가 아닌경우 true 맞는 경우 false를 반환한다. df = df[df['EPS'].notna()] df.drop('column-name',axis=1) : column을 삭제할 때 사용한다. df.drop('index-name',axis=0) : index이름으로 row를 삭제한다. 더보기
drug-indication-collector.py (drugBank용) drug-bank에서 약물의 indication부분만을 크롤링하기 위한 스크립트임. # Get drug indication import numpy as np def drug_indication_extractor(soup): descriptions=soup.__str__().split('\n') identify_description=[] for i,j in enumerate(descriptions): if 'id="indication"' in j: identify_description.append(i) indication_string=descriptions[identify_description[0]:(identify_description[0]+2)] indication_text=[i.split('')[1].. 더보기
CLS archive SQLite에서 meta데이터 추출 PerkinElmer CLS장비에서 archive를 추출하면 IMAGES폴더에 IMAGES.sqlite란 파일이 있음 이것이 메타정보임. 아래의 python script를 실행하면 Archive_meta_info.csv가 해당 폴더에 저장됨 더보기
bam file thred score 및 flag확인용 #!/bin/bash #$ -S /bin/bash #$ -N g1 #$ -cwd for x in /scratch/sjoh/GBM/cancer/WXS_T/*.bam do echo "$x" y=${x##*/} echo "$y" samtools view $x | cut -f2,11 > /scratch/sjoh/GBM/cancer/WXS_T/quality/$y.result echo "/scratch/sjoh/GBM/cancer/WXS_T/quality/$y.result exported" done rm tmp #------------------ # This script is to investigate thred score in bam file #----------------- ''' Before running p.. 더보기
pandas_datareader.data 주가정보 불러오기관련 python3에서 pandas.io는 다른 패키지로 관리되므로 새로 다운 받아야함 pandas_datarader를 다운 받을 것 yahoo_finance를 불러오고 싶을 때는 다른 모듈을 받아야함fix_yahoo_finance를 받고 import할 것 start = datetime.datetime(2016, 2, 19) end = datetime.datetime(2016, 3, 4) gs = web.get_data_yahoo("078930.KS", start, end) https://wikidocs.net/4370 더보기