General-purpose toolkit for bioinformatics, data analysis, plotting, and text processing
Project description
jsrc
A CLI toolkit for data processing, analysis, and visualization.
Installation
PyPI (recommended):
pip install jsrc
uv:
uv pip install jsrc
From source:
git clone https://github.com/imjiaoyuan/jsrc.git
cd jsrc
uv venv
uv sync --extra dev
Run jsrc --help to get started.
For detailed usage, see the Documentation.中文文档请参阅 文档。
Quick Start
jsrc --help
jsrc <module> --help
jsrc <module> <subcommand> --help
Examples:
jsrc seq --help
jsrc analyze phylo --help
jsrc vision extract --help
Module Overview
| module | focus | typical use |
|---|---|---|
seq |
Sequence extraction, translation, QC, k-mer, sliding window | jsrc seq extract ... |
plot |
Gene/exon/chromosome/domain and other plots | jsrc plot gene ... |
analyze |
Phylogeny, motif, consensus, SNP/INDEL, QC | jsrc analyze phylo ... |
gs |
Genomic selection dataset build/split/train | jsrc gs train ... |
grn |
GRN conversion, centrality, local viewer | jsrc grn net2json ... |
vision |
Object extraction, morphology traits, EFD | jsrc vision extract ... |
job |
Background job submit/list/log/kill/history | jsrc job submit "cmd" |
math |
Statistics and ML-style CLI utilities | jsrc math statistics ... |
Error Output Conventions
- Input and validation failures are reported in unified format:
Error: <message>. - Missing files, invalid parameters, and incompatible inputs follow the same style across subcommands.
- Use
--helpon the target module/subcommand first when argument combinations are unclear.
A Glance of jsrc's Functions
vision module
jsrc vision extract -i test/leaf1.jpg -o test/efd --channel a --invert --save-mask
jsrc vision efd -i test/efd -o test/efd --harmonics 20
Contour extraction & EFD reconstruction (20 harmonics):
EFD coefficients (first 5 rows):
an,bn,cn,dn
0.7004, 0.0127, -0.0412, 1.0018
-0.0100, -0.0083, -0.0400, 0.0293
0.0948, -0.0055, -0.0285, -0.1134
0.0085, -0.0702, 0.0777, -0.0099
Morphological traits:
jsrc vision traits -i test/leaf1.jpg --channel a --invert
| trait | value |
|---|---|
| area | 461833.5 |
| perimeter | 3479.84 |
| aspect_ratio | 0.671 |
| circularity | 0.479 |
| extent | 0.535 |
| solidity | 0.837 |
grn module
Generate 1000-gene random network viewer with full-view mode (top 200 nodes):
jsrc grn net2json -i test/grn/network.tsv -o test/grn/json/grn.json -n test/grn/annotation.tsv -z test/grn/grn-viewer.zip -s
Centrality ranking (top 5):
jsrc grn centrality -i test/grn/network.tsv --top 5
| rank | node | in_degree | out_degree | total_degree |
|---|---|---|---|---|
| 1 | GENE_0504 | 24.14 | 34.97 | 59.12 |
| 2 | GENE_0785 | 26.37 | 29.51 | 55.88 |
| 3 | GENE_0165 | 42.81 | 12.21 | 55.01 |
| 4 | GENE_0394 | 14.82 | 33.04 | 47.86 |
| 5 | GENE_0427 | 36.50 | 10.60 | 47.10 |
seq module
jsrc seq extract -fa test/seq/test.fa -gff test/seq/test.gff -ids test/seq/ids.txt -o test/seq/extracted.fa -feature gene -match ID
Extract sequences by gene ID from FASTA+GFF, rename via CSV map, run QC stats, k-mer counting, and sliding-window analysis.
QC: 2 sequences, 268 bp total, GC 56.7%, N50 160.
k-mer (k=3): top ATC (40), TCG (40), CGA (39).
analyze module
jsrc analyze msa_consensus -fa test/analyze/aln.fa --json
jsrc analyze snpindel -fa test/analyze/aln.fa
jsrc analyze motif -fa test/analyze/aln.fa -o test/analyze/motif_out -minw 3 -maxw 5 -nmotifs 3
jsrc analyze phylo -fa test/analyze/aln.fa -o test/analyze/tree.nwk
- Consensus:
ATGCTAGCTAGCTAGCTAGC, mean conservation 0.983 - SNP: seq1 vs seq3 has 1 SNP (alignment score 19/20)
- Motif (top):
GCT(12),CTA(12),TAG(12) - Phylogeny:
(seq1:0.00000,seq2:0.00000,seq3:0.05000)Inner1:0.00000;
job module
Submit, monitor, and inspect background jobs:
jsrc job submit "echo 'job module test' && sleep 1 && echo done" -N test-job
job_id 1
pid 90288
log /home/user/.local/share/jsrc/job-logs/1.log
status running
jsrc job ls --limit 5
job_id status pid runtime rss_mb ... command
------ ------ ----- ------- ------ ----------------------------------------------
1 exited 90288 4s 0.0 echo 'job module test' && sleep 1 && echo done
jsrc job logs 1
job module test
done
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jsrc-0.1.6.tar.gz.
File metadata
- Download URL: jsrc-0.1.6.tar.gz
- Upload date:
- Size: 67.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc098b5fbe05a23420d569e4881bd66952cdac33ab6c2d1bed14ab62e74e73b5
|
|
| MD5 |
8f363e4808b15fa3e7f452147a529427
|
|
| BLAKE2b-256 |
74df47a6863d5aad78693147213868c1b2ce640b82931a9e7d056faf2c0504cc
|
Provenance
The following attestation bundles were made for jsrc-0.1.6.tar.gz:
Publisher:
publish.yml on imjiaoyuan/jsrc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsrc-0.1.6.tar.gz -
Subject digest:
dc098b5fbe05a23420d569e4881bd66952cdac33ab6c2d1bed14ab62e74e73b5 - Sigstore transparency entry: 1419010061
- Sigstore integration time:
-
Permalink:
imjiaoyuan/jsrc@f12382c92d920c5b31671c69f7f507624d581190 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/imjiaoyuan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f12382c92d920c5b31671c69f7f507624d581190 -
Trigger Event:
push
-
Statement type:
File details
Details for the file jsrc-0.1.6-py3-none-any.whl.
File metadata
- Download URL: jsrc-0.1.6-py3-none-any.whl
- Upload date:
- Size: 87.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb6cc75c92edf4c40dac936e27488a1c0501b79b089e38cbdebc2a973c676f2c
|
|
| MD5 |
ec8a4332dec0388ddfe2b48f3280b89d
|
|
| BLAKE2b-256 |
58a74531d2b7fde6b327fb515e6eaed5e87189625b088f68b5d6a2a7b5959d3a
|
Provenance
The following attestation bundles were made for jsrc-0.1.6-py3-none-any.whl:
Publisher:
publish.yml on imjiaoyuan/jsrc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jsrc-0.1.6-py3-none-any.whl -
Subject digest:
bb6cc75c92edf4c40dac936e27488a1c0501b79b089e38cbdebc2a973c676f2c - Sigstore transparency entry: 1419010127
- Sigstore integration time:
-
Permalink:
imjiaoyuan/jsrc@f12382c92d920c5b31671c69f7f507624d581190 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/imjiaoyuan
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f12382c92d920c5b31671c69f7f507624d581190 -
Trigger Event:
push
-
Statement type: