Skip to content
cccskills
FreePublished on GitHub

gene-protein-expression-matrix-normalization

Use when normalizing bulk gene or protein expression matrices with log2 transform, z-score standardization, or min-max scaling before downstream visualization or exploratory analysis. NOT for count-model normalization such as TPM/DESeq2 size factors, batch correction, or single-cell preprocessing.

The English summary is being prepared. Showing the original description.

See how to install

Files included (15)

  • SKILL.md6.0 KB
  • DESCRIPTION523 B
  • eval_report_gene-protein-expression-matrix-normalization_result.json15.6 KB
  • references/algorithm.md1.5 KB
  • references/cli-guide.md2.3 KB
  • references/troubleshooting.md1.5 KB
  • scripts/cli_options.R2.1 KB
  • scripts/functions.R2.9 KB
  • scripts/io.R2.8 KB
  • scripts/main.R945 B
  • scripts/recording.R1.4 KB
  • scripts/run_analysis.R4.2 KB
  • scripts/utils.R2.6 KB
  • tests/data/expression_matrix.csv1020.0 KB
  • tests/run_tests.R5.2 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Source: https://github.com/aipoch/medical-research-skills

Gene Protein Expression Matrix Normalization

When to Use

Use this skill when the user wants to normalize a numeric expression matrix before plotting, clustering, or exploratory comparison.

Typical requests:

  • "Normalize this gene expression matrix with log2"
  • "Do z-score scaling across samples"
  • "Map protein abundance values into 0 to 1"

When Not to Use

Do not use this skill for:

  • Count-model normalization such as CPM, TPM, TMM, or DESeq2 size factors
  • Batch correction or covariate adjustment
  • Single-cell preprocessing workflows
  • Matrices that contain missing, Inf, or NaN values unless they are cleaned first

When to Read External Files

When executing the analysis, run:

Rscript scripts/main.R --input_file <matrix.csv> --output_dir <output_dir> --method <log2|zscore|minmax>
SituationFile to ReadPurpose
Need to execute the workflowscripts/main.RCLI entry point
Need algorithm detailsreferences/algorithm.mdMethod definitions and assumptions
Encounter an errorreferences/troubleshooting.mdStandard error codes and fixes
Need examples or baseline run detailsreferences/cli-guide.mdReady-to-run commands and test record
Need dependency declarationsDESCRIPTIONRuntime package list

Usage

Rscript scripts/main.R \
  --input_file tests/data/expression_matrix.csv \
  --output_dir ./output \
  --method log2 \
  --pseudo_count 1 \
  --seed 42

Arguments

ShortLongTypeDefaultDescription
-i--input_filefilerequiredExpression matrix in CSV or TSV format
-o--output_dirdir./outputOutput directory
-m--methodstringlog2Normalization method: log2, zscore, minmax
-r--marginstringcolumnApply normalization by row or column
-p--pseudo_countnumeric1Added before log2 transformation
-c--centerbooleantrueCenter values for z-score
-s--scale_valuesbooleantrueScale values for z-score
-t--timeout_secondsinteger0Optional timeout; 0 disables it
-d--delimiterstringautoInput delimiter: auto, csv, or tsv
--seedinteger42Random seed
--verbosebooleantruePrint progress logs

Input Format

The first column must contain feature identifiers. Remaining columns must be finite numeric sample values.

Missing values and non-finite values such as NA, NaN, Inf, and -Inf are rejected.

feature,S1,S2,S3
TP53,10,20,30
EGFR,3,5,9

This skill accepts gene or protein expression matrices. It does not infer count-model normalization such as CPM, TPM, TMM, or DESeq2 size factors.

Output Files

If --output_dir already exists, result files with the same names are overwritten. When --verbose=true, the workflow prints a warning before writing into a non-empty output directory.

For single-sample inputs, feature_summary.csv reports per-feature standard deviations as 0 by design because each feature contributes one observed value.

FileDescription
table/normalized_matrix.csvNormalized matrix with the original feature column preserved
table/feature_summary.csvPer-feature min, max, mean, and SD before and after normalization
table/sample_summary.csvPer-sample min, max, mean, and SD before and after normalization
data/normalized_matrix.rdsSerialized normalized matrix and run metadata
run_record.txtStructured execution record
output_manifest.txtOutput file manifest
session_info.txtR session information

Methods

log2

Computes log2(x + pseudo_count) for each numeric value.

zscore

Centers and scales along the selected margin. margin=column standardizes each sample; margin=row standardizes each feature.

When center=false and scale_values=true, the workflow divides by standard deviation without subtracting the mean first.

minmax

Rescales values to [0, 1] along the selected margin. Constant vectors are returned as zeros to avoid division-by-zero errors.

Error Handling

ErrorCauseSolution
SKILL_FILE_NOT_FOUNDInput file path is invalidCheck the input path
SKILL_MISSING_COLUMNSMatrix has fewer than two columnsProvide one feature column and at least one sample column
SKILL_INVALID_PARAMETERCLI value is unsupported or malformed, or the matrix contains non-finite valuesReview the argument table and inspect the matrix values
SKILL_TIMEOUTThe run exceeded --timeout_secondsIncrease the timeout or simplify the input size
SKILL_EMPTY_DATANo usable rows or columns remainCheck the input matrix

Testing

Rscript scripts/main.R --help

Rscript tests/run_tests.R

Rscript tests/run_tests.R audit_output_check

Rscript tests/test_skill.R

Rscript tests/test_skill.R audit_output_check --skip-prepare

tests/run_tests.R executes bundled log2, zscore, and minmax runs and writes their outputs under tests/output/.

When you pass a relative directory name such as audit_output_check, the test runner writes outputs under tests/output/audit_output_check/.

Run tests/run_tests.R before tests/test_skill.R when you want to validate pre-generated outputs explicitly. The validation script can also prepare missing outputs on its own.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Transform lengthy academic papers into concise, structured 250-word abstracts.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Precision editing tool that reduces abstract word count through intelligent compression techniques, maintaining scientific rigor while meeting strict journal and conference requirements.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Refines long medical academic texts into SCI-style unstructured Chinese and English abstracts; use when you need to condense drafts/reports/summaries into bilingual abstracts and generate Summary_Report.md.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Generates submission-ready Elsevier/SCI Highlights from manuscript text or extracted PDF/DOCX/TXT content. Use when a user needs 3-5 concise, evidence-grounded highlight bullets for a research paper, review, meta-analysis, case report, or bioinformatics manuscript.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Generates complete FAERS pharmacovigilance study designs for multi-drug or class-level safety comparison inside one predefined SOC or AE family using active comparators, disproportionality analysis, subgroup characterization, and reviewer-facing evidence control.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

Analyze data with `adme-property-predictor` using a reproducible workflow, explicit validation, and structured outputs for review-ready interpretation.

The English summary is being prepared. Showing the original description.

aipoch/medical-research-skills2KUpdated Sep 17, 2026

See all skills by aipoch

Report a problem with this skill