Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ jobs:
uses: actions/cache@v4
with:
path: ./src/
key: ${{ runner.os }}-src-grch37
restore-keys: |
${{ runner.os }}-src-
key: ${{ runner.os }}-src-grch37-6eb14374

- name: Download GRCh37.tar.gz if not present
- name: Download corrected GRCh37 archive if not present
run: |
if [ ! -f ./src/GRCh37.tar.gz ]; then
wget --connect-timeout=10 --tries=20 ftp://alexandrovlab-ftp.ucsd.edu/pub/tools/SigProfilerMatrixGenerator/GRCh37.tar.gz -P ./src/
fi
echo '6eb14374fbaabe4b1f4c15bc9ca8d2cb58025ce73776864632ef6308bd19aaa3 ./src/GRCh37.tar.gz' | sha256sum --check

- name: Install package with tests
run: |
Expand Down
29 changes: 27 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,34 @@ jobs:
run: |
python -m twine check dist/*

- name: Verify GRCh38 reference resources
- name: Verify reference resources
run: |
python -c "import glob, zipfile; wheel=glob.glob('dist/*.whl')[0]; names=[name.rsplit('/', 1)[-1] for name in zipfile.ZipFile(wheel).namelist()]; assert not any('GRCh38_TSBv2' in name for name in names); assert sum(name.startswith(('context_counts_GRCh38_Legacy_', 'context_distribution_GRCh38_Legacy_')) for name in names) == 48; assert sum(name.startswith(('context_counts_GRCh38_', 'context_distribution_GRCh38_')) and 'GRCh38_Legacy_' not in name for name in names) == 48"
python - <<'PY'
import glob
import zipfile

wheel = glob.glob("dist/*.whl")[0]
context_prefix = (
"SigProfilerMatrixGenerator/references/chromosomes/"
"context_distributions/"
)
with zipfile.ZipFile(wheel) as archive:
names = set(archive.namelist())
manifest_name = context_prefix + "context_table_manifest.txt"
assert manifest_name in names
expected = {
line.strip()
for line in archive.read(manifest_name).decode("utf-8").splitlines()
if line.strip() and not line.startswith("#")
}
observed = {
name.removeprefix(context_prefix)
for name in names
if name.startswith(context_prefix) and name.endswith(".csv")
}
assert expected == observed
assert not any("_TSBv2" in name or "_pending" in name for name in names)
PY

- name: Verify package version
run: |
Expand Down
21 changes: 17 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Register `GRCh38_Legacy` with the chromosome checksums and context tables from
the previously distributed GRCh38 reference so historical results remain
reproducible.
- Register `GRCh37_Legacy` against a copy of the untouched historical archive
named `GRCh37_Legacy.tar.gz`
archive and preserve its supporting tables for reproducible older analyses.
- Record the exact Ensembl GRCh37 FASTA and annotation sources, checksums, and
retained historical transcript scope used to rebuild the corrected reference.

### Changed
- Promote the corrected transcription-strand reference to the default `GRCh38`
identity, including validated strand-aware whole-genome and exome context-count
and distribution tables. Existing installations of the former `GRCh38`
reference must be reinstalled after upgrading.
- Promote corrected GRCh37 transcription-strand labels and strand-dependent
opportunity tables to the default `GRCh37` identity.
- Resolve logical reference names to their physical archive filenames and
stage archive extraction so a historical internal directory can be safely
installed under a distinct Legacy identity.

### Fixed
- Rebuild SBS context-distribution tables from the shared five-base opportunity
Expand Down Expand Up @@ -44,10 +54,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
retaining the CNV48 schema (from `fix/facets-cnv48-tcn1-loh`).

### Reference Data
- `GRCh38.tar.gz` now contains the corrected transcription-strand reference.
The previously distributed data is preserved as `GRCh38_Legacy.tar.gz`.
Both archives must be published under these exact filenames before network
installation can succeed.
- Corrected `GRCh38` continues to resolve to its already-published
`GRCh38.tar.gz`; the separately registered `GRCh38_Legacy` archive remains
available for old analyses.
- Corrected `GRCh37` resolves to `GRCh37.tar.gz`.
`GRCh37_Legacy` resolves to `GRCh37_Legacy.tar.gz` with the historical bytes.
Older MatrixGenerator releases cannot verify the corrected archive under
the original name and should upgrade before reinstalling.

## [1.3.6] - 2025-10-28

Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ View the table below for the full list of parameters.
| ------ | ----------- | ----------- | ----------- |
| Required | | | |
| | project | String | The name of the project. |
| | reference_genome | String | The name of the reference genome. Full list of genomes under **Supported Genomes** section. Supported values include the following: {c_elegans, dog, ebv, GRCh37, GRCh38, GRCh38_Legacy, mm9, mm10, mm39, rn6, yeast} |
| | reference_genome | String | The name of the reference genome. Full list of genomes under **Supported Genomes** section. Supported values include the following: {c_elegans, dog, ebv, GRCh37, GRCh37_Legacy, GRCh38, GRCh38_Legacy, mm9, mm10, mm39, rn6, yeast} |
| | path_to_input_files | String | The path to the input files. |
| Optional | | | |
| | exome | Boolean | Downsamples mutational matrices to the exome regions of the genome. Default value False. |
Expand Down Expand Up @@ -235,6 +235,11 @@ references use the same GRCh38 DNA sequence.
GRCh37.p13 [GRCh37] (Genome Reference Consortium Human Reference 37), INSDC
Assembly GCA_000001405.14, Feb 2009. Released April 2011. Last updated September 2013. This genome was downloaded from ENSEMBL database version 93.37.

`GRCh37` uses the corrected transcription-strand reference for new analyses.
Use `GRCh37_Legacy` only to reproduce results generated with the historical
pre-correction archive. Both identities use the same GRCh37.p13 DNA assembly;
strand-independent contexts are unchanged.

GRCm39 [mm39] (Genome Reference Consortium Mouse Reference 39), INSDC
Assembly GCA_000001635.9, Jun 2020. Last updated August 2020. This genome was downloaded from ENSEMBL database version 103.

Expand All @@ -255,7 +260,7 @@ CanFam3.1 [dog] GCA_000002285.2, Sep 2011. Last updated Jun 2019. This genome wa

WBcel235 [c_elegans] GCA_000002985.3, Oct 2014. Last updated Jan 2019. This genome was downloaded from ENSEMBL database version 100.

*One can specify "_havana" to the end of the genome to include annotations in t-cell receptor genes and IG clusters (available for GRCh37, GRCh38, and mm10).
*One can specify "_havana" to the end of the genome to include annotations in t-cell receptor genes and IG clusters (available for GRCh37, GRCh38, and mm10). These historical Havana references are known to contain the pre-correction transcription-strand boundary and overlap defect. No corrected Havana archives are currently available. MatrixGenerator emits a runtime warning and continues so that historical analyses remain reproducible; transcription-strand-aware results may be affected.*

**LOG FILES**

Expand Down
4 changes: 2 additions & 2 deletions SigProfilerMatrixGenerator/controllers/cli_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def parse_arguments_install(args: List[str]) -> argparse.Namespace:
parser = argparse.ArgumentParser(description="Install reference genome files.")
parser.add_argument(
"genome",
help="The reference genome to install. Supported genomes include {c_elegans, dog, ebv, GRCh37, GRCh38, GRCh38_Legacy, mm9, mm10, mm39, rn6, rn7, yeast}.",
help="The reference genome to install. Supported genomes include {c_elegans, dog, ebv, GRCh37, GRCh37_Legacy, GRCh38, GRCh38_Legacy, mm9, mm10, mm39, rn6, rn7, yeast}.",
)
parser.add_argument(
"-l",
Expand Down Expand Up @@ -86,7 +86,7 @@ def parse_arguments_matrix_generator(args: List[str]) -> argparse.Namespace:
parser.add_argument("project", help="The name of the project.")
parser.add_argument(
"reference_genome",
help="The name of the reference genome. Supported values {c_elegans, dog, ebv, GRCh37, GRCh38, GRCh38_Legacy, mm9, mm10, mm39, rn6, rn7, yeast}.",
help="The name of the reference genome. Supported values {c_elegans, dog, ebv, GRCh37, GRCh37_Legacy, GRCh38, GRCh38_Legacy, mm9, mm10, mm39, rn6, rn7, yeast}.",
)
parser.add_argument("path_to_input_files", help="The path to the input files.")

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
,X,Y,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
B:C,244470,14535,375742,325391,588813,237766,198103,319061,280756,219535,144113,252653,287182,364195,26484,296186,247797,305322,322480,91155,311325,139053,202562,132398
B:T,336625,19205,465032,442265,818776,362535,248416,430817,380586,288140,181051,329015,344356,485442,40168,364072,348808,329001,333830,111855,324421,150103,264976,118257
N:C,40866161,7985883,49000698,55662130,39484694,45017298,43187770,38617751,33225332,34321485,29148120,28857004,28755961,27486024,24607397,20137609,16852480,18589259,15177324,17886893,11273471,14051563,8502866,7522636
N:T,63650029,12361715,70063558,83527595,61602936,73868815,67701633,59627494,48922902,51477355,42854201,40867499,42123360,40880260,39977346,29895128,23256604,24239421,18994161,27699952,13166310,18263361,13066958,8366112
T:C,9095150,230777,21340790,18807930,18035421,13425054,13477673,13945462,14280320,11929599,10604057,12950754,12638874,12319323,5818552,6985911,8877473,6753335,10447004,5523864,7599792,5100222,3118983,4551626
T:T,13297376,367590,29084262,28080243,26311585,21176234,20030569,20983761,20291516,17221825,14674422,18001477,17076740,17485644,9010275,9622347,12017150,7674175,12065753,8087506,7618301,6066676,4229815,4920819
U:C,9473367,762358,23323672,21067010,19214363,13096489,13355015,13424415,15522211,10935971,9743106,12546613,12822806,13082479,6375031,8679372,8498202,9684104,9481471,6200413,7804805,6966390,2510491,4538518
U:T,14137294,1242422,31626715,30291863,28740515,20477441,19496057,20046265,22449976,16494980,12794205,17509630,17080205,18377978,9734605,12308911,11596208,11310116,10973154,9055519,7710538,8768128,3209927,4744103
B:C,246624,14539,397369,362777,659964,299079,277443,350457,308467,233679,147407,303396,330165,416457,38796,327831,270516,332967,366185,111550,379509,139574,228937,136566
B:T,338903,19205,484793,494772,910629,451756,366421,477747,417068,304510,183523,389327,403042,550466,59225,399071,382769,351750,380548,137699,395887,150521,294159,121245
N:C,40865874,7985871,48999966,55661724,39484366,45017052,43187510,38617406,33225009,34321247,29147789,28856737,28755526,27485680,24607274,20137397,16852265,18589003,15176938,17886797,11272973,14051353,8502790,7522457
N:T,63649567,12361681,70062484,83526903,61602398,73868379,67701157,59626955,48922450,51476996,42853829,40867103,42122729,40879732,39977171,29894845,23256310,24239023,18993606,27699804,13165654,18263094,13066845,8365918
T:C,9428257,507154,22810433,20372005,18989636,13513542,13660145,13974602,15204542,11674630,10407793,13028962,12968858,12941100,6249671,7999349,8885065,8365270,10135564,5977481,7771169,6153658,2858484,4641562
T:T,13071540,753830,28998278,27851564,26294800,19929032,18831010,19619749,20405561,16129324,13051329,16816326,16337488,17118377,8946824,10397951,11228837,9039657,10965987,8181821,7289947,7082770,3527285,4572985
U:C,9138393,485989,21833134,19465955,18189325,12946934,13093463,13364224,14570601,11177034,9936407,12417929,12450274,12408784,5931723,7634501,8468106,8044780,9749593,5726497,7565742,5912643,2744691,4444593
U:T,14361314,856216,31694012,30468727,28665985,21635858,20578087,21363886,22299901,17571470,14415198,18634865,17761402,18680749,9779174,11498591,12350854,9922283,12026757,8935508,7968082,7751883,3883387,5089143
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
,X,Y,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,MT,M
B:C,21846,719,52085,36352,62005,17256,20461,45509,29355,20072,22834,27862,55421,35876,4206,37862,15662,54751,59928,11372,49097,16942,17010,14373,0,0
B:T,24773,546,44891,37330,60987,18177,18691,39053,27649,17903,20749,24561,49562,31795,4387,36269,16936,43573,48130,10793,36557,12831,14657,10708,0,0
N:C,20245,1544,14280,20162,10851,7489,5599,11525,46580,9784,8241,12387,25706,9276,3224,47548,11953,13634,13558,3250,22065,5275,1886,11639,0,0
N:T,24005,1756,13692,20848,8440,8960,6252,14017,34844,8539,8367,11340,25067,9782,4633,45933,12026,10280,11306,3352,19366,5092,1926,9205,0,0
T:C,472883,13260,1411964,893817,769109,415325,511983,671974,565733,446619,559379,503887,800874,722534,215635,420535,469118,567757,909257,161628,1007408,376304,130465,340074,0,0
T:T,487260,17100,1334966,1005761,782907,517983,535767,708854,554678,436552,516824,513590,703469,718406,258178,411267,469031,443508,751104,191571,710508,300928,126078,245328,0,0
U:C,492445,21156,1440224,859956,730705,470279,639299,643376,600469,390434,572856,520770,813369,689944,204547,385963,439194,691322,811454,191174,994884,385054,141353,326043,0,0
U:T,520560,28329,1358088,911225,745886,554914,694543,657547,591688,421663,518530,542199,714217,696260,244280,392523,423787,517265,652061,213690,697299,319550,128056,239780,0,0
B:C,22032,719,55415,40584,67144,17524,21776,47417,32484,21844,24182,31710,57143,40860,4206,39614,17400,59773,66208,12573,60990,16945,17708,14842,0,0
B:T,24891,546,47193,42895,65576,18601,19858,40726,30491,19017,21605,28048,52052,37026,4389,38240,18861,46373,52611,12397,45916,12832,15280,10938,0,0
N:C,20235,1544,14237,20141,10840,7479,5588,11505,46571,9770,8228,12374,25677,9259,3219,47537,11944,13626,13538,3246,22035,5269,1880,11630,0,0
N:T,23994,1755,13630,20832,8419,8952,6246,13969,34822,8531,8343,11329,24999,9749,4626,45919,12024,10271,11273,3347,19331,5078,1919,9200,0,0
T:C,487875,17979,1427817,890389,756295,455881,584920,666469,584081,425810,566709,516945,796998,709395,215479,408577,459601,622923,852935,179334,972186,378899,137635,328799,0,0
T:T,512613,23050,1354685,966326,766081,543011,622948,690844,573933,431791,523774,536411,701607,707293,253842,405176,450689,481137,706180,205592,718589,314721,126931,244338,0,0
U:C,477277,16437,1421084,859173,738391,429465,565058,646993,579001,409485,564191,503877,815552,698116,204708,396180,446982,631142,861516,172271,1018243,382462,133491,336858,0,0
U:T,495100,22380,1336129,945111,758144,529470,606201,673932,569613,425318,510748,515902,713657,702175,248621,396657,440206,476845,692537,198070,679894,305770,126587,240545,0,0
Loading
Loading