ylab-hi / ScanNeo2

Snakemake-based computational workflow for neoantigen prediction from diverse sources
MIT License
12 stars 1 forks source link

Error happend!: Command 'regtools junctions extract -i 5 -I 10000000' #36

Closed androidpifu closed 2 months ago

androidpifu commented 2 months ago

Hi,Error happend! Command 'regtools junctions extract -i 5 -I 10000000‘ is in scripts/scanexitron/ScanExitron.py. I checked the usage if 'regtools junctions extract' I checked the documentation for the Command 'regtools junctions extract' and there is no parameter -i, -I. Documentation url: https://regtools.readthedocs.io/en/latest/commands/junctions-extract/ Could you help me with this?

Here is the full error message: regtools junctions extract -i 5 -I 10000000 rna_tumor_final_STAR.hq.bam -o rna_tumor_final_STAR.hq.bed Calling junctions start Error happend!: Command 'regtools junctions extract -i 5 -I 10000000 rna_tumor_final_STAR.hq.bam -o rna_tumor_final_STAR.hq.bed' returned non-zero exit status 1. b'\nProgram:\tregtools\nVersion:\t1.0.0\nextract: invalid option -- \'i\'\nUsage:\t\tregtools junctions extract [options] indexed_alignments.bam\nOptions:\n\t\t-a INT\tMinimum anchor length. Junctions which satisfy a minimum \n\t\t\t anchor length on both sides are reported. [8]\n\t\t-m INT\tMinimum intron length. [70]\n\t\t-M INT\tMaximum intron length. [500000]\n\t\t-o FILE\tThe file to write output to. [STDOUT]\n\t\t-r STR\tThe region to identify junctions \n\t\t\t in "chr:start-end" format. Entire BAM by default.\n\t\t-s INT\tStrandness mode \n\t\t\t XS, use XS tags provided by aligner; RF, first-strand; FR, second-strand. REQUIRED\n\t\t-t STR\tTag used in bam to label strand. [XS]\n\t\t-b STR\tThe file containing the barcodes of interest for single cell data.\n\nError parsing inputs!(1)\n\n\n' Traceback (most recent call last): File "/mnt/work/zhumc/software/ScanNeo2/ScanNeo2/workflow/scripts/scanexitron/ScanExitron.py", line 394, in main() File "/mnt/work/zhumc/software/ScanNeo2/ScanNeo2/workflow/scripts/scanexitron/ScanExitron.py", line 385, in main janno_file = junction_caller(bam_file=out_bam, ref=args.ref, config=config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/mnt/work/zhumc/software/ScanNeo2/ScanNeo2/workflow/scripts/scanexitron/ScanExitron.py", line 129, in junction_caller cmd = 'regtools junctions annotate {0} {1} {2} -o {3}.janno'.format(bed, fasta, gtf, out_name) ^^^ UnboundLocalError: cannot access local variable 'bed' where it is not associated with a value [Tue Aug 27 10:46:51 2024] Error in rule scanexitron: jobid: 120 input: results/T24002/rnaseq/align/rna_tumor_final_STAR.bam, results/T24002/rnaseq/align/rna_tumor_final_STAR.bam.bai, resources/refs/genome.fasta, resources/refs/genome.gtf, resources/refs/CDS.bed, resources/scanexitron_config.ini output: results/T24002/rnaseq/exitron/rna_tumor.exitron log: logs/scanexitron_T24002_rna_tumor.log (check log file(s) for error details) shell:

    python3 workflow/scripts/scanexitron/ScanExitron.py           -t 30           --mapq 30           --ao 3           --pso 0.05           -c ../../../resources/scanexitron_config.ini           -i results/T24002/rnaseq/align/rna_tumor_final_STAR.bam           -r hg38
    mv rna_tumor_final_STAR.exitron results/T24002/rnaseq/exitron/rna_tumor.exitron
    mv rna_tumor_final_STAR* results/T24002/rnaseq/exitron/

    (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
riasc commented 2 months ago

Hi, thanks for reporting this. Just to be sure, have you used this with the software-deployment-method apptainer option (e.g. singularity/apptainer)? The reason is that ScanNeo2 relies on a docker container that is downloaded in the background (https://hub.docker.com/r/yanglabinfo/scanneo2-scanexitron) and resolves the dependencies. In particular, it loads regtools v0.4.2 that works with ScanExitron - newer version do not work as these also have different parameter settings:

Program:        regtools
Version:        0.4.2
Usage:          regtools junctions extract [options] indexed_alignments.bam
Options:
        -a INT  Minimum anchor length. Junctions which satisfy a minimum anchor length on both sides are reported. [8]
                -i INT  Minimum intron length. [70]
                -I INT  Maximum intron length. [500000]
                -o FILE The file to write output to. [STDOUT]
                -r STR  The region to identify junctions in "chr:start-end" format. Entire BAM by default.
androidpifu commented 2 months ago

Thank you for your prompt response and for sharing the details about the software deployment. I wanted to clarify that I have not used the software-deployment-method apptainer, nor have I utilized a Docker container for this purpose.

I have installed regtools version 1.0.0 and have made modifications to your script to accommodate this version. Specifically, I have altered the script as follows:

Original script command:

regtools junctions extract -i 5 -I 10000000 {} -o {}.bed

My modified script command:

regtools junctions extract -s RF {} -o {}.bed

I would like to inquire if this modification could potentially affect the outcome of the results. I understand the importance of maintaining consistency, especially when different versions of a tool may have varying parameter settings and functionality.

I have reviewed the changes and believe they are necessary for compatibility with the regtools version I am using. However, I am open to any suggestions or recommendations you may have to ensure the integrity and accuracy of the results.

Please let me know if there are any concerns or if further adjustments are needed.

Thank you for your guidance.

riasc commented 2 months ago

Well, in principle, this could work as -i and -I merely set the intron minimum and maximum length. However, I have no idea if >v0.4.2 results in a different output file and how this works. Is there a reason you installed 1.0.0? I assume you cannot use docker/singularity?

But if you want to follow this approach, you can test it with the original ScanExitron (https://github.com/ylab-hi/ScanExitron) and test the output.

androidpifu commented 2 months ago

Yes, we are unable to use docker/singularity, so I have manually configured the required environment myself. I will attempt to use the original ScanExitron for testing.

I also have another question I would like to consult with you about. When I have multiple samples, how should I configure the data in config.yaml? The example you provided is for a single sample's data configuration.

riasc commented 2 months ago

ScanExitron was updated to regtools v0.5.0 (but never versions are currently incompatible), which we can use via Conda. Hence, we ditched Singularity. You can try this with v0.3.x.

About your second question, in principle, you can add another sample simply using a (e.g., rna_tumor). This would occur with the under group. However, we never really implemented this for multiple samples, as this would only extend the runtime (running the samples one after another).

If you are executing this on a cluster, the snakemake cluster configuration was helpful in the past. But I haven't looked at the new profile feature. I will try to think of a solution.

Thanks

androidpifu commented 2 months ago

Thanks,I will try it