Skip to content

Commit d7deef0

Browse files
authored
Merge pull request #194 from SigProfilerSuite/ci-switch
Ci switch
2 parents 26a966c + caa3bbb commit d7deef0

14 files changed

+219
-184
lines changed

.github/workflows/ci.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version: ['3.9', '3.12']
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install system dependencies
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y poppler-utils
34+
35+
- name: Upgrade pip, setuptools, and packaging
36+
run: |
37+
python -m pip install --upgrade pip setuptools packaging
38+
39+
- name: Cache src directory
40+
uses: actions/cache@v4
41+
with:
42+
path: ./src/
43+
key: ${{ runner.os }}-src-grch37
44+
restore-keys: |
45+
${{ runner.os }}-src-
46+
47+
- name: Download GRCh37.tar.gz if not present
48+
run: |
49+
if [ ! -f ./src/GRCh37.tar.gz ]; then
50+
wget --connect-timeout=10 --tries=20 ftp://alexandrovlab-ftp.ucsd.edu/pub/tools/SigProfilerMatrixGenerator/GRCh37.tar.gz -P ./src/
51+
fi
52+
53+
- name: Install package with tests
54+
run: |
55+
pip install .[tests]
56+
57+
- name: Install genome
58+
run: |
59+
python install_genome.py ${{ github.workspace }}/src/
60+
61+
- name: Run unit tests
62+
run: |
63+
pytest tests
64+
65+
- name: Run integration test
66+
run: |
67+
python3 test.py
68+
69+
- name: Build and push Docker image
70+
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && matrix.python-version == '3.12'
71+
run: |
72+
echo "Starting Docker deployment to GHCR for sigprofilersuite..."
73+
74+
VERSION_TAG=$(grep "VERSION = " setup.py | cut -d'"' -f2)
75+
76+
# Get the repository name and convert it to lowercase
77+
REPO_NAME=$(basename ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
78+
IMAGE_NAME="ghcr.io/sigprofilersuite/$REPO_NAME"
79+
80+
echo "Building version: $VERSION_TAG for image: $IMAGE_NAME"
81+
82+
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io \
83+
--username "${{ github.actor }}" \
84+
--password-stdin
85+
86+
docker build \
87+
--build-arg COMMIT_SHA=${{ github.sha }} \
88+
-t $IMAGE_NAME:$VERSION_TAG \
89+
-t $IMAGE_NAME:latest .
90+
91+
docker push $IMAGE_NAME:$VERSION_TAG
92+
docker push $IMAGE_NAME:latest
93+
94+
echo "Docker deployment to GHCR successful"

.travis.yml

Lines changed: 0 additions & 69 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## [Unreleased]
88

9+
## [1.1.2] - 2026-01-23
10+
### Fixed
11+
- Fixed Python 3.12 compatibility issues with pandas DataFrame/Series indexing and method calls:
12+
- Updated `to_csv()` calls to use keyword arguments (`sep="\t"`) instead of positional arguments
13+
- Changed DataFrame/Series index access from `[0]` to `.iloc[0]` throughout the codebase
14+
- Fixed dtype assignment when converting columns to strings with "%" suffix
15+
16+
### Changed
17+
- Switched CI/CD from Travis CI to GitHub Actions. Updated README badge to reflect the new CI/CD platform.
18+
919
## [1.1.1] - 2026-01-06
1020
### Added
1121
- Added missing COSMIC v3.5 signature files: exome versions for all supported genome builds, mm39 genome build signatures, and rn7 genome build signatures.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://osf.io/mz79v/wiki/home/)
22
[![License](https://img.shields.io/badge/License-BSD\%202--Clause-orange.svg)](https://opensource.org/licenses/BSD-2-Clause)
3-
[![Build Status](https://api.travis-ci.com/AlexandrovLab/SigProfilerAssignment.svg?branch=main)](https://app.travis-ci.com/AlexandrovLab/SigProfilerAssignment)
3+
[![CI](https://github.com/SigProfilerSuite/SigProfilerAssignment/actions/workflows/ci.yml/badge.svg)](https://github.com/SigProfilerSuite/SigProfilerAssignment/actions/workflows/ci.yml)
44

55
<img src="SigProfilerAssignment/figures/SigProfilerAssignment.png" alt="drawing" width="1000"/>
66

SigProfilerAssignment/DecompositionPlots/PlotDecomposition_CNV48.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,11 +254,11 @@ def plot_7_plus(bases, project, c_draw, denovo_plots_dict, basis_plots_dict):
254254
# c_draw - (Canvas) The canvas to draw the graph decomposition on.
255255
# statistics - (Pandas Dataframe) Dataframe w/ calculations
256256
def draw_statistics(c_draw, statistics, sig_version, custom_text):
257-
cos_sim = statistics["Cosine Similarity"][0]
258-
cor_coeff = statistics["Correlation Coefficient"][0]
259-
l1_norm_percent = statistics["L1 Norm %"][0]
260-
l2_norm_percent = statistics["L2 Norm %"][0]
261-
kl_divergence = statistics["KL Divergence"][0]
257+
cos_sim = statistics["Cosine Similarity"].iloc[0]
258+
cor_coeff = statistics["Correlation Coefficient"].iloc[0]
259+
l1_norm_percent = statistics["L1 Norm %"].iloc[0]
260+
l2_norm_percent = statistics["L2 Norm %"].iloc[0]
261+
kl_divergence = statistics["KL Divergence"].iloc[0]
262262

263263
c_draw.drawString(
264264
WIDTH_GAP + 15,

SigProfilerAssignment/DecompositionPlots/PlotDecomposition_DBS78.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ def plot_6_plus(bases, project, c_draw, denovo_plots_dict, basis_plots_dict):
251251
# c_draw - (Canvas) The canvas to draw the graph decomposition on.
252252
# statistics - (Pandas Dataframe) Dataframe w/ calculations
253253
def draw_statistics(c_draw, statistics, sig_version, custom_text):
254-
cos_sim = statistics["Cosine Similarity"][0]
255-
cor_coeff = statistics["Correlation Coefficient"][0]
256-
l1_norm_percent = statistics["L1 Norm %"][0]
257-
l2_norm_percent = statistics["L2 Norm %"][0]
258-
kl_divergence = statistics["KL Divergence"][0]
254+
cos_sim = statistics["Cosine Similarity"].iloc[0]
255+
cor_coeff = statistics["Correlation Coefficient"].iloc[0]
256+
l1_norm_percent = statistics["L1 Norm %"].iloc[0]
257+
l2_norm_percent = statistics["L2 Norm %"].iloc[0]
258+
kl_divergence = statistics["KL Divergence"].iloc[0]
259259

260260
c_draw.drawString(
261261
WIDTH_GAP + 15,

SigProfilerAssignment/DecompositionPlots/PlotDecomposition_ID83.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -245,13 +245,13 @@ def plot_6_plus(bases, project, c_draw, denovo_plots_dict, basis_plots_dict):
245245
# c_draw - (Canvas) The canvas to draw the graph decomposition on.
246246
# statistics - (Pandas Dataframe) Dataframe w/ calculations
247247
def draw_statistics(c_draw, statistics, sig_version, custom_text):
248-
cos_sim = statistics["Cosine Similarity"][0]
249-
cos_dist = statistics["Cosine Distance"][0]
250-
cor_dist = statistics["Correlation Distance"][0]
251-
cor_coeff = statistics["Correlation Coefficient"][0]
252-
l1_norm_percent = statistics["L1 Norm %"][0]
253-
l2_norm_percent = statistics["L2 Norm %"][0]
254-
kl_divergence = statistics["KL Divergence"][0]
248+
cos_sim = statistics["Cosine Similarity"].iloc[0]
249+
cos_dist = statistics["Cosine Distance"].iloc[0]
250+
cor_dist = statistics["Correlation Distance"].iloc[0]
251+
cor_coeff = statistics["Correlation Coefficient"].iloc[0]
252+
l1_norm_percent = statistics["L1 Norm %"].iloc[0]
253+
l2_norm_percent = statistics["L2 Norm %"].iloc[0]
254+
kl_divergence = statistics["KL Divergence"].iloc[0]
255255

256256
c_draw.drawString(
257257
WIDTH_GAP + 15,

SigProfilerAssignment/DecompositionPlots/PlotDecomposition_SBS1536.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ def plot_6_plus(bases, project, c_draw, denovo_plots_dict, basis_plots_dict):
251251
# c_draw - (Canvas) The canvas to draw the graph decomposition on.
252252
# statistics - (Pandas Dataframe) Dataframe w/ calculations
253253
def draw_statistics(c_draw, statistics, sig_version, custom_text):
254-
cos_sim = statistics["Cosine Similarity"][0]
255-
cor_coeff = statistics["Correlation Coefficient"][0]
256-
l1_norm_percent = statistics["L1 Norm %"][0]
257-
l2_norm_percent = statistics["L2 Norm %"][0]
258-
kl_divergence = statistics["KL Divergence"][0]
254+
cos_sim = statistics["Cosine Similarity"].iloc[0]
255+
cor_coeff = statistics["Correlation Coefficient"].iloc[0]
256+
l1_norm_percent = statistics["L1 Norm %"].iloc[0]
257+
l2_norm_percent = statistics["L2 Norm %"].iloc[0]
258+
kl_divergence = statistics["KL Divergence"].iloc[0]
259259

260260
c_draw.drawString(
261261
WIDTH_GAP + 15,

SigProfilerAssignment/DecompositionPlots/PlotDecomposition_SBS288.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,11 @@ def plot_6_plus(bases, project, c_draw, denovo_plots_dict, basis_plots_dict):
260260
# c_draw - (Canvas) The canvas to draw the graph decomposition on.
261261
# statistics - (Pandas Dataframe) Dataframe w/ calculations
262262
def draw_statistics(c_draw, statistics, sig_version, custom_text):
263-
cos_sim = statistics["Cosine Similarity"][0]
264-
cor_coeff = statistics["Correlation Coefficient"][0]
265-
l1_norm_percent = statistics["L1 Norm %"][0]
266-
l2_norm_percent = statistics["L2 Norm %"][0]
267-
kl_divergence = statistics["KL Divergence"][0]
263+
cos_sim = statistics["Cosine Similarity"].iloc[0]
264+
cor_coeff = statistics["Correlation Coefficient"].iloc[0]
265+
l1_norm_percent = statistics["L1 Norm %"].iloc[0]
266+
l2_norm_percent = statistics["L2 Norm %"].iloc[0]
267+
kl_divergence = statistics["KL Divergence"].iloc[0]
268268

269269
c_draw.drawString(
270270
WIDTH_GAP + 15,

SigProfilerAssignment/DecompositionPlots/PlotDecomposition_SBS96.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ def plot_6_plus(bases, project, c_draw, denovo_plots_dict, basis_plots_dict):
278278
# c_draw - (Canvas) The canvas to draw the graph decomposition on.
279279
# statistics - (Pandas Dataframe) Dataframe w/ calculations
280280
def draw_statistics(c_draw, statistics, sig_version, custom_text):
281-
cos_sim = statistics["Cosine Similarity"][0]
282-
cor_coeff = statistics["Correlation Coefficient"][0]
283-
l1_norm_percent = statistics["L1 Norm %"][0]
284-
l2_norm_percent = statistics["L2 Norm %"][0]
285-
kl_divergence = statistics["KL Divergence"][0]
281+
cos_sim = statistics["Cosine Similarity"].iloc[0]
282+
cor_coeff = statistics["Correlation Coefficient"].iloc[0]
283+
l1_norm_percent = statistics["L1 Norm %"].iloc[0]
284+
l2_norm_percent = statistics["L2 Norm %"].iloc[0]
285+
kl_divergence = statistics["KL Divergence"].iloc[0]
286286

287287
c_draw.drawString(
288288
WIDTH_GAP + 15,

0 commit comments

Comments
 (0)