# Input file name collision - There are multiple input files

**URL:** <https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660>\
**Category:** Ask for help\
**Created:** [April 16, 2024, 7:07pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660 "2024-04-16T19:07:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![complexgenome](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/complexgenome/32/392_2.png) [@complexgenome](https://community.seqera.io/u/complexgenome)\
**Post date:** [April 16, 2024, 7:07pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660/1 "2024-04-16T19:07:59Z")

</div>

Hi there,

I created a channel using:

```auto
mutation_burden.out.mutation_burden_txt | collect(flat: false) | transpose()| buffer(skip: 1)| map { it[0] } | set { mutation_burden_collected_files}

```

The file names are same. I’ve following collected file channel as:

`[mnt/data1/users/sanjeev/nextflow/meta_structure/work/ab/7bb0748ddba567583c4236c0d33d1f/mutation_burden.txt, /mnt/data1/users/sanjeev/nextflow/meta_structure/work/88/47dba5991e1192651aa9aec4f7b6ef/mutation_burden.txt, /mnt/data1/users/sanjeev/nextflow/meta_structure/work/56/f9becc216df3f672527dea1170f756/mutation_burden.txt]`

I pass then into process:

```auto
input:
    path(mut_files, stageAs: 'temp_merge_mut_burden/*')

```

When I pass this channel into a process, I get following error:

Error:

> ERROR ~ Error executing process \> ‘wes:merge\_mutation\_burden (1)’
> 
> Caused by:  
> Process `wes:merge_mutation_burden` input file name collision – There are multiple input files for each of the following file names: temp\_merge\_mut\_burden/mutation\_burden.txt
> 
> Tip: you can replicate the issue by changing to the process work dir and entering the command `bash .command.run`
> 
> – Check ‘.nextflow.log’ file for details

Dummy channel:

```auto

ch_mutation=channel.of([[batch:"SEMA-MM-003", timepoint:"MM-0256-T-03", tissue:"normal", sequencing_type:"wes"],
file( "HRDresults.txt")],
[[batch:"SEMA-MM-004", timepoint:"MM-4607-T-01", tissue:"normal", sequencing_type:"wes"],
file("HRDresults.txt")],
[[batch:"SEMA-MM-002", timepoint:"MM-2692-T-01", tissue:"normal", sequencing_type:"wes"], 
file("HRDresults.txt")]
)

ch_mutation | collect(flat: false) | transpose()| buffer(skip: 1)| map { it[0] } | view

```

I cannot change the output file name `HRDresults.txt` as it’s hard-coded.

How do I resolve this when taking them as an input?

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [April 16, 2024, 7:11pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660/2 "2024-04-16T19:11:47Z")

</div>

Nextflow is complaining about input files, not output files. You’re passing many `mutation_burden.txt` files to the following process. Instead, make the previous process have different output filenames, e.g. `mutation_burden_someIDhere.txt`, so that when they’re symlinked to the work directory of the following process, there will be no filename collision.

---

<div class="post-metadata">

**Author:** ![complexgenome](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/complexgenome/32/392_2.png) [@complexgenome](https://community.seqera.io/u/complexgenome)\
**Post date:** [April 16, 2024, 7:18pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660/3 "2024-04-16T19:18:56Z")

</div>

@mribeirodantas  
I understand the issue of file name being same and complain of the nextflow.

is there a way to address this without touching the output file name in the previous step?

---

<div class="post-metadata">

**Author:** ![mribeirodantas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/mribeirodantas/32/235_2.png) [@mribeirodantas](https://community.seqera.io/u/mribeirodantas)\
**Post date:** [April 16, 2024, 7:30pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660/4 "2024-04-16T19:30:26Z")

</div>

Yes, touching the input file names in the next step, with `stageAs`, but it’s more complicated to do it like that. Is there a good reason for not renaming the output files in the previous step?

---

<div class="post-metadata">

**Author:** ![complexgenome](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/complexgenome/32/392_2.png) [@complexgenome](https://community.seqera.io/u/complexgenome)\
**Post date:** [April 16, 2024, 7:38pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660/5 "2024-04-16T19:38:14Z")

</div>

OK. Let me see what can be done.  
It’s an output of an in-house script that I didn’t write.

---

<div class="post-metadata">

**Author:** ![muffato](https://dub1.discourse-cdn.com/flex013/user_avatar/community.seqera.io/muffato/32/275_2.png) [@muffato](https://community.seqera.io/u/muffato)\
**Post date:** [April 18, 2024, 3:08pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660/6 "2024-04-18T15:08:30Z")

</div>

@complexgenome

Can you also try this `stageAs` pattern ?

```auto
    path(mut_files, stageAs: 'temp_merge_mut_burden??/*')

```

This will put the input files in different directories and it shouldn’t cause the issue if they have the same name

---

<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:** [April 25, 2024, 3:08pm UTC](https://community.seqera.io/t/input-file-name-collision-there-are-multiple-input-files/660/7 "2024-04-25T15:08:53Z")

</div>

Closed on April 25, 2024, 3:08pm UTC

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