Skip to content

Commit

Permalink
Merge pull request #174 from AlexandrovLab/ebv
Browse files Browse the repository at this point in the history
Update v1.2.24: Fix ebv matrix generation
  • Loading branch information
mdbarnesUCSD authored Feb 9, 2024
2 parents 9b12f7d + 70db87d commit 518e22b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1417,11 +1417,12 @@ def SigProfilerMatrixGeneratorFunc(
chrom_start = None
if i != 1:
for file in vcf_files:
chrom = file.split("_")[0]
if reference_genome.lower() != "ebv":
chrom = file.split("_")[0]
else:
chrom = "gi_82503188_ref_NC_007605"
if not os.path.exists(chrom_path + chrom + ".txt"):
continue
if reference_genome == "ebv":
chrom = "_".join([x for x in file.split("_")[:-1]])
with open(vcf_path + file) as f:
lines = [line.strip().split() for line in f]
lines = sorted(lines, key=lambda x: (x[0], int(x[2])))
Expand Down Expand Up @@ -1953,7 +1954,7 @@ def SigProfilerMatrixGeneratorFunc(
for file in vcf_files:
chrom = file.split("_")[0]
if reference_genome == "ebv":
chrom = "_".join([x for x in file.split("_")[:-1]])
chrom = "gi_82503188_ref_NC_007605"
with open(vcf_path + file) as f:
lines = [line.strip().split() for line in f]
lines = sorted(lines, key=lambda x: (x[0], int(x[2])))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from __future__ import print_function

import os
import pdb
import re
import sys

from SigProfilerMatrixGenerator.scripts import MutationMatrixGenerator as spm

Expand Down Expand Up @@ -76,7 +73,7 @@ def convertVCF(project, vcf_path, genome, output_path, ncbi_chrom, log_file):
if len(line) == 0:
continue
chrom = line[0]
if len(chrom) > 2:
if len(chrom) > 2 and genome.lower() != "ebv":
chrom = chrom[3:]
if chrom in ncbi_chrom:
chrom = ncbi_chrom[chrom]
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from setuptools import setup

VERSION = "1.2.23"
VERSION = "1.2.24"

# remove the dist folder first if exists
if os.path.exists("dist"):
Expand All @@ -23,7 +23,7 @@ def write_version_py(filename="SigProfilerMatrixGenerator/version.py"):
# THIS FILE IS GENERATED FROM SIGPROFILEMATRIXGENERATOR SETUP.PY
short_version = '%(version)s'
version = '%(version)s'
Update = 'v1.2.23: Add SV and CNV matrix generation to CLI. Add Dockerfile.'
Update = 'v1.2.24: Fix ebv input processing.'
"""
fh = open(filename, "w")
Expand Down

0 comments on commit 518e22b

Please sign in to comment.