来源信息
- 仓库
- brycewang-stanford/Auto-Empirical-Research-Skills
- 最近来源活动
- 2026年4月3日 02:07
- 检测到的 SKILL.md 语言
- 英语
- 星标
- 3,291
- 分支
- 432
安装方式
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
检查来源文件
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
菜单
默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。
决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/brycewang-stanford/Auto-Empirical-Research-Skills --skill spectroscopy-analysis-guide命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Route empirical-research requests through the Auto-Empirical Research Skills catalog when this whole repository is installed as one skill in Codex, CodeBuddy, Claude Code, or another IDE. Use to choose and load the right vendored AERS skill for causal inference, econometrics, replication, data acquisition, manuscript writing, peer review and referee responses, citation checking, de-AIGC editing, or full empirical-paper workflows without reading the entire repository at once.
中英双语学术降 AIGC / bilingual academic de-AIGC skill. Removes AI-generated writing signatures from empirical papers in economics, management, and the social sciences — in both English and Chinese. Covers Turnitin AI, GPTZero, Originality.ai on the English side and 知网 AMLC, 万方, 维普 on the Chinese side. Uses a six-step loop (intake → audit → claim-evidence check → differentiated rewrite → five-dimension self-score → cold-reader recheck) with two pattern libraries (22 English + 17 Chinese patterns), section-by-section strategies for empirical papers, and hard protections that keep every number, coefficient, and citation intact.
Use when a research task needs reproducible Kaggle discovery, metadata inspection, bounded public-data downloads, competition or kernel discovery, model discovery, or an explicitly approved Kaggle write/delete operation through the official CLI.
基于 SOC 职业分类
正在显示 SKILL.md
| name | spectroscopy-analysis-guide |
| description | Spectral data analysis for NMR, IR, mass spectrometry, and UV-Vis |
| metadata | {"openclaw":{"emoji":"🔬","category":"domains","subcategory":"chemistry","keywords":["spectroscopy","nmr","mass-spectrometry","infrared","uv-vis","analytical-chemistry"],"source":"wentor"}} |
A skill for processing and interpreting spectroscopic data in chemistry research. Covers NMR, IR, mass spectrometry, and UV-Vis spectroscopy including data formats, baseline correction, peak detection, spectral matching, and structure elucidation workflows.
| Format | Spectroscopy | Description |
|---|---|---|
| JCAMP-DX (.jdx, .dx) | All types | IUPAC standard exchange format |
| Bruker (1r, fid, acqu) | NMR | Raw and processed Bruker data |
| mzML / mzXML | MS | Open mass spectrometry format |
| SPC (.spc) | IR, UV-Vis | Galactic/Thermo spectral format |
| CSV / TXT | All | Simple x,y pairs (wavelength/wavenumber, intensity) |
import numpy as np
from scipy.signal import find_peaks, savgol_filter
def read_jcamp(filepath: str) -> dict:
"""
Read a JCAMP-DX spectral file.
Returns x (wavenumber/chemical shift/m/z) and y (intensity) arrays.
"""
x_data, y_data = [], []
metadata = {}
with open(filepath, "r") as f:
for line in f:
line = line.strip()
if line.startswith("##"):
key_val = line[2:].split("=", 1)
if len(key_val) == 2:
metadata[key_val[0].strip()] = key_val[1].strip()
elif line and not line.startswith("$$"):
parts = line.split()
try:
values = [float(v) for v in parts]
if len(values) >= 2:
x_data.append(values[0])
y_data.extend(values[1:])
except ValueError:
continue
return {
"x": np.array(x_data),
"y": np.array(y_data[:len(x_data)]),
"metadata": metadata,
}
import nmrglue as ng
def process_1h_nmr(bruker_dir: str) -> dict:
"""
Process 1H NMR data from Bruker format using nmrglue.
bruker_dir: path to Bruker experiment directory
"""
# Read raw data
dic, data = ng.bruker.read(bruker_dir)
# Apply processing
data = ng.bruker.remove_digital_filter(dic, data)
data = ng.proc_base.zf_size(data, 65536) # zero-fill
data = ng.proc_base.fft(data) # Fourier transform
data = ng.proc_autophase.autops(data, "acme") # automatic phasing
data = ng.proc_base.rev(data) # reverse spectrum
data = ng.proc_base.di(data) # discard imaginary
# Generate chemical shift axis (ppm)
udic = ng.bruker.guess_udic(dic, data)
uc = ng.fileiobase.uc_from_udic(udic)
ppm = uc.ppm_scale()
return {
"ppm": ppm,
"spectrum": data.real,
"sf": dic["acqus"]["SFO1"], # spectrometer frequency (MHz)
"sw_ppm": dic["acqus"]["SW"], # sweep width (ppm)
}
def pick_nmr_peaks(ppm: np.ndarray, spectrum: np.ndarray,
threshold: float = 0.05) -> list[dict]:
"""
Automatic peak picking for 1H NMR.
threshold: minimum peak height as fraction of max intensity.
"""
min_height = threshold * np.max(spectrum)
indices, properties = find_peaks(
spectrum, height=min_height, distance=, prominence=min_height *
)
peaks = []
idx indices:
peaks.append({
: ((ppm[idx]), ),
: (spectrum[idx]),
})
peaks.sort(key= p: p[], reverse=)
peaks
| Chemical Shift (ppm) | Functional Group |
|---|---|
| 0.8-1.0 | CH3 (methyl, alkyl) |
| 1.2-1.4 | CH2 (methylene, alkyl chain) |
| 2.0-2.5 | CH next to C=O |
| 3.3-3.9 | CH next to O or N (ethers, amines) |
| 4.5-5.5 | Vinyl C=CH2, OCH |
| 6.5-8.5 | Aromatic H |
| 9.0-10.0 | Aldehyde CHO |
| 10.0-12.0 | Carboxylic acid OH |
from pyteomics import mzml
import numpy as np
def read_mzml_spectra(filepath: str, ms_level: int = 1) -> list[dict]:
"""
Read mass spectra from an mzML file.
ms_level: 1 for MS1 (survey scans), 2 for MS/MS
"""
spectra = []
with mzml.read(filepath) as reader:
for spectrum in reader:
if spectrum.get("ms level") == ms_level:
spectra.append({
"scan": spectrum["index"],
"rt": spectrum["scanList"]["scan"][0].get(
"scan start time", 0
),
"mz": spectrum["m/z array"],
"intensity": spectrum["intensity array"],
"tic": np.sum(spectrum["intensity array"]),
})
return spectra
def find_molecular_ion(mz: np.ndarray, intensity: np.ndarray,
expected_mw: float = None,
tolerance_da: float = 0.5) -> list[dict]:
"""
Identify molecular ion peaks ([M+H]+, [M+Na]+, [M-H]-).
"""
top_indices = np.argsort(intensity)[::-][:]
candidates = []
adducts = {
: ,
: ,
: ,
: -,
: ,
}
idx top_indices:
peak_mz = mz[idx]
peak_int = intensity[idx]
expected_mw:
adduct_name, adduct_mass adducts.items():
calc_mw = peak_mz - adduct_mass
(calc_mw - expected_mw) < tolerance_da:
candidates.append({
: ((peak_mz), ),
: (peak_int),
: adduct_name,
: (calc_mw, ),
: ((calc_mw - expected_mw), ),
})
:
candidates.append({
: ((peak_mz), ),
: (peak_int),
})
candidates
# Standard IR functional group frequency table
IR_ASSIGNMENTS = {
(3200, 3600): "O-H stretch (broad: alcohol, acid; sharp: free OH)",
(3300, 3500): "N-H stretch (primary amine: 2 bands; secondary: 1 band)",
(2850, 3000): "C-H stretch (sp3: 2850-2960; sp2: 3000-3100)",
(2100, 2260): "Triple bond stretch (C-triple-N: 2210-2260; C-triple-C: 2100-2150)",
(1680, 1750): "C=O stretch (ketone ~1715; ester ~1735; acid ~1710; amide ~1650)",
(1600, 1680): "C=C stretch (alkene ~1640; aromatic ~1600, 1500)",
(1000, 1300): "C-O stretch (ether, ester, alcohol)",
}
def assign_ir_peaks(wavenumber: np.ndarray, absorbance: np.ndarray,
threshold: float = 0.1) -> list[dict]:
"""Detect and assign IR absorption peaks to functional groups."""
# Invert for peak detection (absorbance peaks are positive)
peaks, properties = find_peaks(absorbance, height=threshold, prominence=0.05)
assignments = []
for idx in peaks:
wn = float(wavenumber[idx])
assignment = "unassigned"
for (low, high), group in IR_ASSIGNMENTS.items():
if low <= wn <= high:
assignment = group
break
assignments.append({
"wavenumber_cm-1": (wn, ),
: ((absorbance[idx]), ),
: assignment,
})
(assignments, key= x: x[], reverse=)
def baseline_correction(y: np.ndarray, lam: float = 1e6,
p: float = 0.001, n_iter: int = 10) -> np.ndarray:
"""
Asymmetric least squares baseline correction (Eilers and Boelens, 2005).
lam: smoothness parameter (larger = smoother baseline)
p: asymmetry parameter (smaller = more emphasis on fitting below peaks)
"""
from scipy.sparse import diags, csc_matrix
from scipy.sparse.linalg import spsolve
L = len(y)
D = diags([1, -2, 1], [0, -1, -2], shape=(L, L - 2)).toarray()
H = lam * D.dot(D.T)
w = np.ones(L)
for _ in range(n_iter):
W = diags(w, 0, shape=(L, L))
Z = csc_matrix(W + H)
baseline = spsolve(Z, w * y)
w = p * (y > baseline) + (1 - p) * (y < baseline)
return y - baseline
def smooth_spectrum(y: np.ndarray, window: int = 11,
polyorder: int = 3) -> np.ndarray:
"""Apply Savitzky-Golay smoothing to a spectrum."""
return savgol_filter(y, window, polyorder)