# Parallelizing a perl script that is executed from a python script

**URL:** <https://community.seqera.io/t/parallelizing-a-perl-script-that-is-executed-from-a-python-script/284>\
**Category:** Ask for help\
**Created:** [November 11, 2023, 5:24am UTC](https://community.seqera.io/t/parallelizing-a-perl-script-that-is-executed-from-a-python-script/284 "2023-11-11T05:24:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gableo](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@Gableo](https://community.seqera.io/u/Gableo)\
**Post date:** [November 11, 2023, 5:24am UTC](https://community.seqera.io/t/parallelizing-a-perl-script-that-is-executed-from-a-python-script/284/1 "2023-11-11T05:24:24Z")

</div>

Is it possible for a Perl script to run in parallel if it’s executed from a Python script that is executed by the Nextflow script?

I’m hoping that Nextflow will iterate over files in a path and parallelize the execution of the perl script even though it was called by a python script. I’m following the instructions here: [Processes — Nextflow 23.10.0 documentation](https://www.nextflow.io/docs/latest/process.html#input-type-path)

I think I might have to pass the filepath to the python script which then passes it to the perl script, so then Nextflow knows to run the script in parallel?

---

<div class="post-metadata">

**Author:** ![ewels](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/ewels/32/1_2.png) [@ewels](https://community.seqera.io/u/ewels)\
**Post date:** [November 13, 2023, 9:55am UTC](https://community.seqera.io/t/parallelizing-a-perl-script-that-is-executed-from-a-python-script/284/2 "2023-11-13T09:55:40Z")

</div>

Could you elaborate with some examples about how you see this working?

I’m a bit unclear by what you mean when you say the Perl script is executed by a Python script.

---

<div class="post-metadata">

**Author:** ![steve](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/steve/32/125_2.png) [@steve](https://community.seqera.io/u/steve)\
**Post date:** [December 1, 2023, 6:31pm UTC](https://community.seqera.io/t/parallelizing-a-perl-script-that-is-executed-from-a-python-script/284/3 "2023-12-01T18:31:20Z")

</div>

it sounds like you should just call the Perl script directly from Nextflow. No need for a Python intermediary. Typically in these kinds of situations we end up re-writing whatever custom behavior that was being performed in the Python wrapper directly into Nextflow instead.

---

<div class="post-metadata">

**Author:** ![Gableo](https://avatars.discourse-cdn.com/v4/letter/g/cc9497/32.png) [@Gableo](https://community.seqera.io/u/Gableo)\
**Post date:** [December 1, 2023, 9:28pm UTC](https://community.seqera.io/t/parallelizing-a-perl-script-that-is-executed-from-a-python-script/284/4 "2023-12-01T21:28:17Z")

</div>

It seems like the Nextflow script that I got wasn’t set up well. It runs a Perl script that then runs a lot more Perl scripts and other CLI commands. I replaced the main Perl script with a Python one because the code quality was very poor. I now realize that the Perl scripts should not have been called by the main script in the first place for a number of reasons.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/system/32/2402_2.png) [@system](https://community.seqera.io/u/system)\
**Post date:** [December 8, 2023, 9:29pm UTC](https://community.seqera.io/t/parallelizing-a-perl-script-that-is-executed-from-a-python-script/284/5 "2023-12-08T21:29:01Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
