From c1424d9d6f7854474d88daeadeb20489726aff5c Mon Sep 17 00:00:00 2001 From: Jens Luebeck Date: Tue, 12 Dec 2023 17:29:58 -0800 Subject: [PATCH] improve handling of cnseg file for different window sizes --- README.md | 4 ++-- src/bam_to_breakpoint.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 00f1b03..b446188 100644 --- a/README.md +++ b/README.md @@ -250,8 +250,8 @@ Thickness of the arc qualitatively depicts the amount of paired-end read support The SV view file may be uploaded to web interface for Cycle view to visualize the cycles in conjunction with the SV view. -### 5. [Intermediate] Copy number segmentation file `{out}_{CHROM}_{START}_{END}_cnseg.txt` -This files provides the segmentation of an interval based on coverage alone. Here `{CHROM}_{START}_{END}` represent the coordinates of the interval. First line represents the header. Tab-separated fields: +### 5. [Intermediate] Copy number segmentation file `{out}_{CHROM}_{START}_{END}_ws10000_cnseg.txt` +This files provides the segmentation of an interval based on coverage alone. The value after `ws` indicates the window size used for the segmentation. Here `{CHROM}_{START}_{END}` represent the coordinates of the interval. First line represents the header. Tab-separated fields: - `{CHROM}`: Chromosome name - `{START}`: Coordinate of the first basepair in the segment - `{END}`: Coordinate of the last basepair in the segment diff --git a/src/bam_to_breakpoint.py b/src/bam_to_breakpoint.py index d5bd39d..dce2567 100755 --- a/src/bam_to_breakpoint.py +++ b/src/bam_to_breakpoint.py @@ -751,8 +751,8 @@ def meanshift_refined(self, i, window_size0=10000, window_size1=300, gcc=False, def get_meanshift(self, i, window_size0=10000, window_size1=300, gcc=False): logging.debug("get_meanshift on " + str(i)) - file_name = "%s_%s_%s_%s_cnseg.txt" % (self.sample_name, i.chrom, i.start, i.end) - if os.path.exists(file_name) and i.end - i.start > 50000: + file_name = "%s_%s_%s_%s_ws%s_cnseg.txt" % (self.sample_name, i.chrom, i.start, i.end, window_size0) + if os.path.exists(file_name) and i.end - i.start > 50000 and window_size0 == 10000: logging.debug("Re-using cn-seg info in " + file_name) msfile = open(file_name) msr = []