ConesaLab / SQANTI3

Tool for the Quality Control of Long-Read Defined Transcriptomes
GNU General Public License v3.0
198 stars 49 forks source link

[BUG] sqanti3_qc.py :: use sys.executable instead of plain python3 call for inner command #354

Open EricDeveaud opened 20 hours ago

EricDeveaud commented 20 hours ago

Is there an existing issue for this?

Have you loaded the SQANTI3.env conda environment?

Problem description

Hello,

sqanti3_qc.py use plain hard coded python3 call for inner commands.

ISOANNOT_CMD = "python3 "+ ISOANNOT_PROG + " {g} {c} {j} -gff3 {t} -o {o} -novel -stdout {i}".format(g=correctedGTF , c=outClassFile, j=outJuncFile, t=gff3_opt, o=iso_out, i=isoAnnot_sum)
sqanti3_qc.py:        ISOANNOT_CMD = "python3 "+ ISOANNOT_PROG + " {g} {c} {j} -o {o} -novel".format(g=correctedGTF , c=outClassFile, j=outJuncFile, o=iso_out)

when running with another interpreter than the one in PATH this may break.

PYTHON3 = sys.executable
ISOANNOT_CMD = sys.executale + " "+ ISOANNOT_PROG + " {g} {c} {j} -gff3 {t} -o {o} -novel -stdout {i}".format(g=correctedGTF , c=outClassFile, j=outJuncFile, t=gff3_opt, o=iso_out, i=isoAnnot_sum)
sqanti3_qc.py:        ISOANNOT_CMD = sys.executable + " " + ISOANNOT_PROG + " {g} {c} {j} -o {o} -novel".format(g=correctedGTF , c=outClassFile, j=outJuncFile, o=iso_out)

will be more robust and coinsistent.

regards

Eric

Code sample

No response

Error

No response

Anything else?

No response

EricDeveaud commented 20 hours ago

same apply to sqanti_reads.py python hardcoded

                cmd_sqanti = f"python {sqantiqcPath}/sqanti3_qc.py {gtf_files} {args.annotation} {args.genome} --skipORF --min_ref_len {args.min_ref_len} --aligner_choice {args.aligner_choice} -t {args.cpus} -d {args.input_dir}/{file_acc} -o {sampleID} -s {args.sites}"
                cmd_sqanti = f"python {sqantiqcPath}/sqanti3_qc.py {fastq_files} {args.annotation} {args.genome} --skipORF --min_ref_len {args.min_ref_len} --aligner_choice {args.aligner_choice} -t {args.cpus} -d {args.input_dir}/{file_acc} -o {sampleID} -s {args.sites} --fasta"
    cmd_plotting = f"python {plotting_script_path} --ref {args.annotation} --design {args.inDESIGN} -o {args.dir} --gene-expression {args.ANNOTEXP} --jxn-expression {args.JXNEXP} --perc-coverage {args.PERCCOV} --perc-junctions {args.PERCMAXJXN}"
EricDeveaud commented 19 hours ago

the same way sqanti3_rescue.py may replace python_path = distutils.spawn.find_executable('python') by python_path=sys.executable

NB depending on the OS, the packager, python may be python3 maybe not ;-)

eg on RHEL8

[gensoft]maestro-builder:SQANTI3/5.2.2 > python --version
Python 2.7.17
[gensoft]maestro-builder:SQANTI3/5.2.2 > python3 --version
Python 3.6.8