본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트51k · #3507

nmrglue

하는 일

이 도구는 원시 1차원 핵자기공명(NMR) 데이터를 처리해 더 선명한 스펙트럼을 만들고, 피크를 식별하며, 적분 면적을 계산합니다. 주파수 축(ppm)을 확인하고 조정하며, 필터를 적용하고 베이스라인을 보정하도록 돕습니다.

사용하는 경우

  • ✓원시 1차원 NMR 데이터가 있고 이를 쓸 수 있는 스펙트럼으로 바꾸고 싶을 때.
  • ✓NMR 스펙트럼의 위상과 베이스라인을 조정할 때.
  • ✓NMR 스펙트럼에서 정확한 피크 면적 값을 얻고 싶을 때.

스킬 링크

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/nmrglue/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/nmrglue/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 1차원 NMR 데이터 파일(fid.npz)을 이 설정(processing.json)으로 처리하고, 결과를 ‘my_spectrum’으로 저장해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 원시 NMR 데이터와 매개변수가 담긴 설정 파일을 읽습니다. 푸리에 변환 같은 수학적 변환과 스펙트럼 품질을 높이는 조정을 적용하고, 피크와 면적 같은 정보를 추출합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

nmrglue: calibrated 1D FID processing

When to use

Use for a uniformly sampled complex 1D FID whose acquisition parameters and complex frequency convention are available. The helper produces a descending ppm spectrum, positive peak candidates, signed region integrals, and a reproducible processing report. It does not identify compounds or assign resonances.

The executable accepts a NumPy .npz containing exactly one complex fid array or a canonical 1D complex time-domain NMRPipe file. NMRPipe reading is tested with a synthetic write/read round trip, known-spectrum recovery, and a small upstream NMRPipe-generated binary fixture. Experimental Bruker, Varian, and JEOL imports are not verified by this suite. For those formats, first inspect the relevant nmrglue reader and acquisition metadata. Opening a converted file does not validate the original acquisition decoding. Read references/acquisition-and-validation.md for conversion boundaries, axis calibration, and quantitative limits.

Workflow

  1. Preserve the raw FID. Establish spectral width in Hz, positive observation frequency in MHz, carrier in ppm, observed nucleus, and the sign convention from the acquisition or a known reference. Determine whether digital-filter/group-delay removal has already occurred. Do not infer these from array length or typical instrument defaults.
  2. Copy assets/processing.json and replace its synthetic example values with the measured parameters and explicit processing choices. Its sign -i means a resonance at offset f = (ppm - carrier_ppm) * observation_mhz has time dependence exp(-2*pi*i*f*t). Select +i only for the opposite convention; the helper conjugates it before processing. Validate with a known reference peak.
  3. Choose nonnegative exponential line broadening (Hz), an even zero-filled size at least as large as the acquired FID, first-point scaling, and phase angles. Zero filling improves interpolation, not acquired spectral resolution. First-point scaling 0.5 is suitable for the supplied causal synthetic example; acquisition and prior preprocessing may require another value.
  4. Run the helper, inspect the real and imaginary spectra, and revise manual phase if needed. phase0_deg + phase1_deg * index / zero_fill_points is applied after FT; index zero is the high-ppm edge. There is no implicit pivot or automatic phase estimate.
  5. Only fit a linear baseline when explicitly supplied ppm regions are signal-free. Set baseline to linear and add baseline_regions_ppm containing at least two regions. Inspect residuals and broad peaks; fitting through signals biases integrals.
  6. Compare peak positions with references, inspect peak candidates for artifacts, and integrate specified regions. Report overlapped peaks as overlapped. Preserve negative areas as diagnostic evidence of phase/baseline problems instead of taking absolute values.

Execute

Tested with Python 3.12, nmrglue 0.12, NumPy 2.5.3, and SciPy 1.18.1:

uv run --no-project --python 3.12 --with nmrglue==0.12 --with numpy==2.5.3 --with scipy==1.18.1 \
  python skills/nmrglue/scripts/process_1d.py fid.npz processing.json nmr-result

Paths assume the collection root. Adjust them when installed elsewhere. The output directory must be new, so repeated processing keeps previous results reviewable.

For an existing 1D NMRPipe FID, add --input-format nmrpipe and supply its path in place of fid.npz. The helper requires the canonical FDF2 direct dimension, complex quadrature, a time-domain flag, and agreement between header and JSON spectral width, observation frequency, and carrier. JSON settings remain explicit; a mismatch fails instead of silently recalibrating. FDF2TDSIZE must equal the stored complex-point count, and FDF2CENTER / FDF2ORIG must describe a canonical centered axis. Previously zero-filled, truncated, or recentered files need a separate acquisition-aware workflow. The nucleus/complex sign and previous digital-filter corrections still need acquisition evidence. A time-domain flag alone does not establish an unprocessed FID.

This executable synthetic example matches the supplied settings, generates resonances at 3 and 7 ppm in a 1:2 amplitude ratio, and does not represent an experimental sample:

import numpy as np

t = np.arange(8192) / 4000.0
fid = sum(a * np.exp(-np.pi * 2.0 * t)

…
자주 묻는 질문

이 도구는 화합물을 식별하나요?

아닙니다. 이 도구는 화합물을 식별하지 않습니다. 원시 데이터를 처리해 분석하고 해석할 수 있도록 할 뿐입니다.

2차원이나 3차원 NMR 데이터에도 쓸 수 있나요?

아닙니다. 이 도구는 1차원 NMR 데이터만을 위한 것입니다.

‘ppm’과 ‘FID’는 무엇인가요?

PPM(백만분율)은 NMR 스펙트럼에서 신호의 위치를 나타내는 단위입니다. FID(자유 유도 감쇠)는 처리 전 NMR 장비가 측정하는 원시 신호입니다.

상세 정보

작성자의 원본 설명

Processes calibrated one-dimensional complex NMR free-induction decays with nmrglue into phased spectra, peak candidates, and signed integration regions. Use for raw 1D NMR processing, ppm-axis verification, apodization, Fourier transformation, manual phasing, baseline correction, or reproducible spectral integration.

repo: K-Dense-AI/scientific-agent-skills

인기도

GitHub 스타
51k
순위
#3507
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬