유전자 목록 (침대 파일로)과 게놈 전체 RNA-seq 데이터 세트 (침대 파일로 저장 됨)가 있습니다. 저는 현재 파이썬 스크립트를 개발하고 있습니다.이 스크립트를 사용하면 전사 시작 사이트 (즉, 유전자의 시작 부분)의 500bp 업스트림에서 2000bp 업스트림으로 추출한 수를 추출하여 나중에 사용할 수 있도록이 값을 배열에 저장할 수 있습니다. 이 strand-입니다 ( 특정 유전자와 RNA-seq 데이터의 연관
feature_genes=np.zeros((6576, 2501))
for lines in feature:
for i in range(0,6575):
if line[5]==lines[5] and line[5]=='+' and line[0]==lines[0] and int(lines[1])>=int(line[1])- 500 and int(lines[1])<=int(line[1])+2000:
feature_genes[i][int(lines[1])-int(line[1])+500]=lines[4]
elif line[5]=='-' and line[0]==lines[0] and int(lines[2])+500>=int(line[2]) and int(lines[2])-2000<=int(line[2]) and lines[5]=='-':
feature_genes[i][-1*(int(lines[2])-int(line[2])-500)]=lines[4]
기능이 유전자의 bedfile 유전자 내 목록에 내 읽기를 나타냅니다
는, 각 라인이있는 특정 염기의 읽기 수를 포함
:현재, 제 스크립트는 다음과 같습니다 특정 정보 및 판독이 관찰되지 않은 염기 쌍 또는 유전자의 위치를 각각 배제 함).
NB. .bed 파일의 형식은 다음과 같습니다.
Position
0 chromosome
1 transcription start site
2 transcription termination site
3 feature name
4 read count
5 strand
누구든지이 방법을 효율적으로 생각할 수 있습니까? 내 코드는 영원히 실행됩니다 (python 초보자).