Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range in coral seed #31

Open
GACGAMA opened this issue Feb 3, 2025 · 1 comment · May be fixed by #24
Open

IndexError: list index out of range in coral seed #31

GACGAMA opened this issue Feb 3, 2025 · 1 comment · May be fixed by #24

Comments

@GACGAMA
Copy link

GACGAMA commented Feb 3, 2025

Hi all

I'm trying to run CoRAL on PacBio HIFI tumor reads from a publicly available dataset.
I've subsampled the total reads to 300.000 to test and benchmark different tools

When running CoRAL on non-phased samples, I get the following error:

/home/ggama1/.cache/pypoetry/virtualenvs/coral-3Ikf4PsN-py3.11/bin/coral seed --cn-seg /scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor.cns --output-prefix /scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor
Performing seeding mode with options: {'cn_seg': <_io.TextIOWrapper name='/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor.cns' mode='r' encoding='UTF-8'>, 'output_prefix': '/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor', 'gain': 6.0, 'min_seed_size': 100000.0, 'max_seg_gap': 300000.0}
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /scratch4/nsobrei2/programs/coral/CoRAL/coral/cli.py:106 in seed                                 │
│                                                                                                  │
│   103 │   ] = 300000,                                                                            │
│   104 ) -> None:                                                                                 │
│   105 │   print(f"Performing seeding mode with options: {ctx.params}")                           │
│ ❱ 106 │   run_seeding(cn_seg, output_prefix, gain, min_seed_size, max_seg_gap)                   │
│   107                                                                                            │
│   108                                                                                            │
│   109 @coral_app.command(help="Reconstruct focal amplifications")                                │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │        cn_seg = <_io.TextIOWrapper                                                           │ │
│ │                 name='/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor.cns'    │ │
│ │                 mode='r' encoding='UTF-8'>                                                   │ │
│ │           ctx = <click.core.Context object at 0x155520c2f4d0>                                │ │
│ │          gain = 6.0                                                                          │ │
│ │   max_seg_gap = 300000.0                                                                     │ │
│ │ min_seed_size = 100000.0                                                                     │ │
│ │ output_prefix = '/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor'             │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                  │
│ /scratch4/nsobrei2/programs/coral/CoRAL/coral/cnv_seed.py:123 in run_seeding                     │
│                                                                                                  │
│   120 │   │   │   cn_cutoff_chrarm = gain                                                        │
│   121 │   │   │   if sum_seed_len > CNSIZE_MAX:                                                  │
│   122 │   │   │   │   cn_cutoff_chrarm = 1.2 * gain                                              │
│ ❱ 123 │   │   │   if seed[-1][2] <= chr_arms[seed[-1][0]][0][0]:  # p arm                        │
│   124 │   │   │   │   cn_cutoff_chrarm = (                                                       │
│   125 │   │   │   │   │   cn_cutoff_chrarm + chr_arms[seed[-1][0]][-1][0] - 2.0                  │
│   126 │   │   │   │   )                                                                          │
│                                                                                                  │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ blocked_intervals = [                                                                        │ │
│ │                     │   ['chr1', 121700000, 123400000],                                      │ │
│ │                     │   ['chr1', 123400000, 125100000],                                      │ │
│ │                     │   ['chr10', 38000000, 39800000],                                       │ │
│ │                     │   ['chr10', 39800000, 41600000],                                       │ │
│ │                     │   ['chr11', 51000000, 53400000],                                       │ │
│ │                     │   ['chr11', 53400000, 55800000],                                       │ │
│ │                     │   ['chr12', 33200000, 35500000],                                       │ │
│ │                     │   ['chr12', 35500000, 37800000],                                       │ │
│ │                     │   ['chr13', 16500000, 17700000],                                       │ │
│ │                     │   ['chr13', 17700000, 18900000],                                       │ │
│ │                     │   ... +38                                                              │ │
│ │                     ]                                                                        │ │
│ │             ccn_p = 2.0                                                                      │ │
│ │             ccn_q = 0.78350804860195                                                         │ │
│ │               chr = 'chrY'                                                                   │ │
│ │          chr_arms = {                                                                        │ │
│ │                     │   'chr1': [                                                            │ │
│ │                     │   │   [121700000, 125100000],                                          │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [('chr1', 14941, 44034756, 2.02479773679671)],               │ │
│ │                     │   │   │   [('chr1', 143279586, 248946422, 1.7165465721184396)]         │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [121700000, 123856422],                                          │ │
│ │                     │   │   [2.0, 1.7165465721184396]                                        │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr10': [                                                           │ │
│ │                     │   │   [38000000, 41600000],                                            │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [('chr10', 14999, 38000000, 1.6564664690232718)],            │ │
│ │                     │   │   │   [                                                            │ │
│ │                     │   │   │   │   ('chr10', 41693521, 130950462, 1.765063393696224),       │ │
│ │                     │   │   │   │   ('chr10', 130950462, 133787422, 2.5948083743219703)      │ │
│ │                     │   │   │   ]                                                            │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [38000000, 92197422],                                            │ │
│ │                     │   │   [1.6564664690232718, 1.765063393696224]                          │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr11': [                                                           │ │
│ │                     │   │   [51000000, 55800000],                                            │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [                                                            │ │
│ │                     │   │   │   │   ('chr11', 60000, 3575093, 2.623565847719062),            │ │
│ │                     │   │   │   │   ('chr11', 3575093, 50821348, 1.6921060618915154)         │ │
│ │                     │   │   │   ],                                                           │ │
│ │                     │   │   │   [                                                            │ │
│ │                     │   │   │   │   ('chr11', 55800000, 60770310, 1.5453889635017657),       │ │
│ │                     │   │   │   │   ('chr11', 60770310, 78899539, 2.075396231637425),        │ │
│ │                     │   │   │   │   ('chr11', 78904539, 111832251, 1.5900586710281381),      │ │
│ │                     │   │   │   │   ('chr11', 111857250, 135076622, 1.9261328329795273)      │ │
│ │                     │   │   │   ]                                                            │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [51000000, 79286622],                                            │ │
│ │                     │   │   [1.6921060618915154, 1.9261328329795273]                         │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr12': [                                                           │ │
│ │                     │   │   [33200000, 37800000],                                            │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [('chr12', 14999, 33200000, 1.7138537455323226)],            │ │
│ │                     │   │   │   [('chr12', 37800000, 133260308, 1.7424581425621857)]         │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [33200000, 95475309],                                            │ │
│ │                     │   │   [1.7138537455323226, 1.7424581425621857]                         │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr13': [                                                           │ │
│ │                     │   │   [16500000, 18900000],                                            │ │
│ │                     │   │   [[], []],                                                        │ │
│ │                     │   │   [16500000, 95464328],                                            │ │
│ │                     │   │   [2.0, 2.0]                                                       │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr14': [                                                           │ │
│ │                     │   │   [16100000, 18200000],                                            │ │
│ │                     │   │   [[], []],                                                        │ │
│ │                     │   │   [16100000, 88843718],                                            │ │
│ │                     │   │   [2.0, 2.0]                                                       │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr15': [                                                           │ │
│ │                     │   │   [17500000, 20500000],                                            │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [],                                                          │ │
│ │                     │   │   │   [                                                            │ │
│ │                     │   │   │   │   ('chr15', 65075634, 81675142, 2.0079298674204624),       │ │
│ │                     │   │   │   │   ('chr15', 81675142, 101981189, 1.7088502781055213)       │ │
│ │                     │   │   │   ]                                                            │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [17500000, 81491189],                                            │ │
│ │                     │   │   [2.0, 2.0]                                                       │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr16': [                                                           │ │
│ │                     │   │   [35300000, 38400000],                                            │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [                                                            │ │
│ │                     │   │   │   │   ('chr16', 10000, 4905394, 2.8388409060473494),           │ │
│ │                     │   │   │   │   ('chr16', 4905394, 35300000, 1.7071573040867074)         │ │
│ │                     │   │   │   ],                                                           │ │
│ │                     │   │   │   [('chr16', 46425679, 90228345, 1.5076776445389057)]          │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [35300000, 51938345],                                            │ │
│ │                     │   │   [1.7071573040867074, 1.5076776445389057]                         │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr17': [                                                           │ │
│ │                     │   │   [22700000, 27400000],                                            │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [                                                            │ │
│ │                     │   │   │   │   ('chr17', 99814, 9954814, 2.092253266691848),            │ │
│ │                     │   │   │   │   ('chr17', 9954814, 16365375, 1.598392811520143),         │ │
│ │                     │   │   │   │   ('chr17', 16365375, 22700000, 2.102532352540003)         │ │
│ │                     │   │   │   ],                                                           │ │
│ │                     │   │   │   [                                                            │ │
│ │                     │   │   │   │   ('chr17', 27400000, 71947262, 1.7861187485852656),       │ │
│ │                     │   │   │   │   ('chr17', 71947262, 83247441, 2.3281967792169795)        │ │
│ │                     │   │   │   ]                                                            │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [22700000, 55857441],                                            │ │
│ │                     │   │   [2.092253266691848, 1.7861187485852656]                          │ │
│ │                     │   ],                                                                   │ │
│ │                     │   'chr18': [                                                           │ │
│ │                     │   │   [15400000, 21500000],                                            │ │
│ │                     │   │   [                                                                │ │
│ │                     │   │   │   [('chr18', 10000, 15400000, 1.6835540042525923)],            │ │
│ │                     │   │   │   [('chr18', 21500000, 80258285, 1.7524836688191447)]          │ │
│ │                     │   │   ],                                                               │ │
│ │                     │   │   [15400000, 58873285],                                            │ │
│ │                     │   │   [1.6835540042525923, 1.7524836688191447]                         │ │
│ │                     │   ],                                                                   │ │
│ │                     │   ... +14                                                              │ │
│ │                     }                                                                        │ │
│ │                cn = 0.78350804860195                                                         │ │
│ │  cn_cutoff_chrarm = 6.0                                                                      │ │
│ │       cn_seg_file = <_io.TextIOWrapper                                                       │ │
│ │                     name='/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor.cn… │ │
│ │                     mode='r' encoding='UTF-8'>                                               │ │
│ │               cns = ('chrY', 11043736, 57212403, 0.78350804860195)                           │ │
│ │         cnv_seeds = [[]]                                                                     │ │
│ │          cur_seed = []                                                                       │ │
│ │                fp = <_io.TextIOWrapper                                                       │ │
│ │                     name='/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor_CN… │ │
│ │                     mode='w' encoding='UTF-8'>                                               │ │
│ │              gain = 6.0                                                                      │ │
│ │              line = 'chrY\t11043736\t57212403\t-\t-1.35198\t0.000277797\t3\t2604.78\t-2.298… │ │
│ │       max_seg_gap = 300000.0                                                                 │ │
│ │     min_seed_size = 100000.0                                                                 │ │
│ │   output_filename = '/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor_CNV_SEE… │ │
│ │     output_prefix = '/scratch4/nsobrei2/ggama1/longread_cnv_sv/coral/cns/test_tumor'         │ │
│ │                 s = [                                                                        │ │
│ │                     │   'chrY',                                                              │ │
│ │                     │   '11043736',                                                          │ │
│ │                     │   '57212403',                                                          │ │
│ │                     │   '-',                                                                 │ │
│ │                     │   '-1.35198',                                                          │ │
│ │                     │   '0.000277797',                                                       │ │
│ │                     │   '3',                                                                 │ │
│ │                     │   '2604.78',                                                           │ │
│ │                     │   '-2.2987',                                                           │ │
│ │                     │   '-0.708471'                                                          │ │
│ │                     ]                                                                        │ │
│ │              scns = [('chrY', 11043736, 57212403, 0.78350804860195)]                         │ │
│ │              seed = []                                                                       │ │
│ │      sum_cns_len_ = 46168667                                                                 │ │
│ │  sum_cns_len_parm = 0                                                                        │ │
│ │  sum_cns_len_qarm = 46168667                                                                 │ │
│ │      sum_seed_len = 0                                                                        │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
IndexError: list index out of range
@Soniazumalave
Copy link

I am encountering the same error in approximately 10% of my samples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants