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 #40

Open
Donbbit opened this issue Dec 5, 2024 · 4 comments
Open

IndexError: list index out of range #40

Donbbit opened this issue Dec 5, 2024 · 4 comments

Comments

@Donbbit
Copy link

Donbbit commented Dec 5, 2024

Hi, when I install ScanNeo2 using: snakemake --cores all --software-deployment-method conda
I got this error:
<path/to/reads> is not a valid file
Traceback (most recent call last):
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/lib/python3.12/site-packages/snakemake/cli.py", line 1898, in args_to_api
dag_api = workflow_api.dag(
^^^^^^^^^^^^^^^^^
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/lib/python3.12/site-packages/snakemake/api.py", line 326, in dag
return DAGApi(
^^^^^^^
File "", line 6, in init
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/lib/python3.12/site-packages/snakemake/api.py", line 436, in post_init
self.workflow_api._workflow.dag_settings = self.dag_settings
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/lib/python3.12/site-packages/snakemake/api.py", line 383, in _workflow
workflow.include(
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/lib/python3.12/site-packages/snakemake/workflow.py", line 1382, in include
exec(compile(code, snakefile.get_path_or_uri(), "exec"), self.globals)
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/soft/ScanNeo2/workflow/Snakefile", line 30, in
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/lib/python3.12/site-packages/snakemake/workflow.py", line 1382, in include
exec(compile(code, snakefile.get_path_or_uri(), "exec"), self.globals)
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/soft/ScanNeo2/workflow/rules/common.smk", line 126, in
config['data'] = data_structure(config['data'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/soft/ScanNeo2/workflow/rules/common.smk", line 8, in data_structure
config['data']['dnaseq'], filetype, readtype = handle_seqfiles(config['data']['dnaseq'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/soft/ScanNeo2/workflow/rules/common.smk", line 64, in handle_seqfiles
return mod_seqdata, filetype[0], readtype[0]
^^^^^^^^^^^^^^
IndexError: list index out of range

How can I solve this problem?

@riasc
Copy link
Collaborator

riasc commented Dec 5, 2024

Hi, thank you for reporting this. So, by default, ScanNeo2 will use the configuration file located at config/config.yml. I will cause this error when it hasn't been configured:

rna_tumor: <path/to/to/reads>

Alternatively you can also set the path via --configfile

Could you set up your configfile and try it again?

I will look into it how to exit ScanNeo2 more gracefully when it hasn't been configured... thanks

@Donbbit
Copy link
Author

Donbbit commented Dec 10, 2024

Hi, thank you for reporting this. So, by default, ScanNeo2 will use the configuration file located at config/config.yml. I will cause this error when it hasn't been configured:

rna_tumor: <path/to/to/reads>

Alternatively you can also set the path via --configfile

Could you set up your configfile and try it again?

I will look into it how to exit ScanNeo2 more gracefully when it hasn't been configured... thanks

Thanks for your reply! I believe I have successfully installed the ScanNeo2. However, when I followed the test config to set it up and run it, I encountered the following error:
snakemake --cores all --configfile ../config/config.yaml
Config file ../config/config.yaml is extended by additional config specified via the command line.
Assuming unrestricted shared filesystem usage for local execution.
Building DAG of jobs...
MissingInputException in rule all in file /hsfscqjf1/ST_CQ/P23Z32300N0005/software/miniconda3/envs/scanneo2/soft/scanneo2/workflow/Snakefile, line 9:
Missing input files for rule all:
affected files:
results/test/prioritization

My ../config/config.yaml is like:

Reference

General settings

reference:
release: 111
nonchr: false
threads: 30
mapq: 30 # overall required mapping quality
basequal: 20 # overall required base quality

data:
name: test
dnaseq:
dan_normal: /hsfscqjf1/ST_CQ/P24Z32300N0028/pipe_test/test_data/testdata/normal_DNA_R1.fastq.gz /hsfscqjf1/ST_CQ/P24Z32300N0028/pipe_test/test_data/testdata/normal_DNA_R2.fastq.gz
dna_tumor: /hsfscqjf1/ST_CQ/P24Z32300N0028/pipe_test/test_data/testdata/tumor_DNA_R1.fastq.gz /hsfscqjf1/ST_CQ/P24Z32300N0028/pipe_test/test_data/testdata/tumor_DNA_R2.fastq.gz
rnaseq:
rna_tumor: /hsfscqjf1/ST_CQ/P24Z32300N0028/pipe_test/test_data/testdata/tumor_RNA_R1.fastq.gz /hsfscqjf1/ST_CQ/P24Z32300N0028/pipe_test/test_data/testdata/tumor_RNA_R2.fastq.gz
normal: dna_normal

custom:
variants:
hlatyping:
MHC-I:
MHC-II:
………………

My Snakefile is like:
from snakemake.utils import min_version

set minimum snakemake version

min_version("8.0.0")

setup

configfile: "../config/config.yaml"

rule all:
input:
expand("results/{sample}/prioritization/",
sample=config['data']['name'])

load rules

include: "rules/prelim.smk"
#include: "rules/ref.smk"
#include: "rules/common.smk"
#include: "rules/hlatyping.smk"
#include: "rules/preproc.smk"
#include: "rules/align.smk"
#include: "rules/quantification.smk"
#include: "rules/genefusion.smk"
#include: "rules/altsplicing.smk"
#include: "rules/exitron.smk"
#include: "rules/indel.smk"
#include: "rules/custom.smk"
#include: "rules/germline.smk"
#include: "rules/annotation.smk"
#include: "rules/prioritization.smk"

Could you please advise me on how to resolve this issue? I greatly appreciate your assistance and look forward to your response.

@riasc
Copy link
Collaborator

riasc commented Dec 13, 2024

Hi there, thank you for your reply. So, in principle, you have to call it with the software-deployment-method conda option, as this resolves all the dependencies. So it should be like this:

snakemake --cores all --software-deployment-method conda --configfile ../config/config.yaml

Have you included this option? This should get you started and you should see how the environments are getting downloaded.

Just to be sure.. can you please check if the workflow runs when using some of the testconfigurations. Like this:

snakemake --cores all --software-deployment-method conda --configfile .tests/integration/custom-test/config/config.yaml

This should then generate an output in the results/custom-test/prioritization folder

@riasc
Copy link
Collaborator

riasc commented Dec 13, 2024

You should also see how different rules are being executed:

Activating conda environment: .snakemake/conda/0fefea5a05b3bb4b2272b1b1648a84d6_
[Fri Dec 13 10:15:15 2024]
Finished job 2.
1 of 3 steps (33%) done
Select jobs to execute...
Execute 1 jobs...

[Fri Dec 13 10:15:15 2024]
Job 1: Prioritize on sample:custom-test
Reason: Missing output files: results/custom-test/prioritization; Input files updated by another job: results/custom-test/annotation/custom.vcf

Activating conda environment: .snakemake/conda/c2b265c505e0c1b777dab76aa8ea2e42_
[Fri Dec 13 10:16:44 2024]
Finished job 1.
2 of 3 steps (67%) done
Select jobs to execute...
Execute 1 jobs...

[Fri Dec 13 10:16:44 2024]
localrule all:
    input: results/custom-test/prioritization
    jobid: 0
    reason: Input files updated by another job: results/custom-test/prioritization
    resources: tmpdir=/tmp

[Fri Dec 13 10:16:44 2024]
Finished job 0.
3 of 3 steps (100%) done

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

No branches or pull requests

2 participants