fix: dG 계산식 수정 및 5MB 청크 스캔을 통한 500 OOM 에러 해결#45
Merged
7hyunii merged 2 commits intoSeq-Lab:developfrom Mar 5, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
프라이머 설계 파이프라인에서 3' 말단 안정성(dG) 계산식을 교정하고, 대용량 게놈 스캔/특이성 검사에서 OOM을 피하기 위해 5MB 청크 기반 스캔을 도입하며, 반환 후보 수를 페널티 기반 상위 N개로 제한하는 변경입니다.
Changes:
- 3' 말단 dG 계산을 엔탈피/엔트로피를 모두 반영하는 표준 깁스 자유에너지 계산으로 수정
- 템플릿 위치 탐색 및 특이성 검사를 게놈 전체 로드 대신 5MB 청크 스캔 방식으로 변경
- 후보 프라이머를 페널티(= |Tm 오차| + |말단 안정성 오차|)로 정렬 후 상위 50개로 제한
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| app/api/v1/endpoints/design.py | 후보군에 penalty를 부여해 정렬하고 상위 50개만 응답하도록 제한 |
| app/algorithms/PrimerDesigner.py | dG 계산식 수정 및 템플릿 탐색/특이성 검사 로직을 5MB 청크 스캔으로 전환 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 사항들
1. 깁스 자유에너지 수식 오류 수정 (Bug Fix)
기존 문제: 프라이머 3' 말단 안정성 계산 시 엔탈피 값만 합산하여, 모든 후보군이 필터를 통과하지 못하고 증발하는 버그가 있었습니다.
수정 내용: 엔탈피와 엔트로피를 모두 반영한 표준 깁스 자유에너지 수식으로 교정하여 정상적으로 프라이머 후보가 생성되도록 수정했습니다.
2. 메모리 최적화: 청크(Chunk) 기반 게놈 스캔 도입 (Performance & Stability)
기존 문제:
chr1과 같은 대용량 염색체(약 250MB)를 한 번에 메모리에 로드하려고 시도할 때, 서버 메모리 초과(OOM)로 인한500 Internal Server Error가 발생했습니다.수정 내용: 게놈 서열 탐색 및 특이성 검사 로직을 5MB 단위 청크 분할 스캔 방식으로 변경했습니다. 이를 통해 메모리 점유율을 획기적으로 낮추어 안정적인 서비스 운용이 가능해졌습니다.
3. 페널티 기반 상위 N개 필터링 및 정렬 (UX Improvement)
기존 문제: 설계 조건에 따라 프라이머 후보가 수천 개씩 반환되는 경우, 클라이언트(브라우저) 환경에서 렌더링 부하로 인해 프리징 현상이 발생했습니다.
수정 내용: