# Make.file naming

**URL:** <https://forum.mothur.org/t/make-file-naming/21578>\
**Category:** Commands in mothur\
**Created:** [October 12, 2022, 6:33pm UTC](https://forum.mothur.org/t/make-file-naming/21578 "2022-10-12T18:33:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![bakerdyl](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@bakerdyl](https://forum.mothur.org/u/bakerdyl)\
**Post date:** [October 12, 2022, 6:33pm UTC](https://forum.mothur.org/t/make-file-naming/21578/1 "2022-10-12T18:33:05Z")

</div>

Hi, I have a quick question about what make.file is doing. I know Pat said it takes everything from the first underscore to the left as the “sample name”, however this doesn’t seem to be the case in my situation. I have mulitple fastq files that start with the same names that I ultimately want to be part of the same group. Here is an example:

```auto
P1	P1_D0_R1_022um_R1_sub.fastq.gz	P1_D0_R1_022um_R2_sub.fastq.gz	
P1_D0	P1_D0_R1_03um_R1_sub.fastq.gz	P1_D0_R1_03um_R2_sub.fastq.gz	
P1_D0_2	P1_D0_R2_022um_R1_sub.fastq.gz	P1_D0_R2_022um_R2_sub.fastq.gz	
P1_D0_3	P1_D0_R2_03um_R1_sub.fastq.gz	P1_D0_R2_03um_R2_sub.fastq.gz	
P1_D0_4	P1_D0_R3_022um_R1_sub.fastq.gz	P1_D0_R3_022um_R2_sub.fastq.gz	
P1_D0_5	P1_D0_R3_03um_R1_sub.fastq.gz	P1_D0_R3_03um_R2_sub.fastq.gz	

```

Why is the first sample name it runs into called “P1” but then the next sample that is run into is named “P1\_D0” (followed by 2-5 appended afterward)? How can I fix this, or make sure all of these sequence files will be regarded as the same group?

To clarify, these are all replicates of the .22um and 3um fractions and I would like to combine them all. If it is not suggested to combine replicates, how do I ensure these are at least regarded as the same group?

Thanks!

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [October 14, 2022, 3:21pm UTC](https://forum.mothur.org/t/make-file-naming/21578/2 "2022-10-14T15:21:49Z")

</div>

Hi there,

This does seem a bit weird. Is it possible to rename your files to replace those `_` characters with something else? Alternatively, you can definitely make your own files file where you can give give the files that need to be pooled. You can do this from scratch or you could edit this file.

Pat

---

<div class="post-metadata">

**Author:** ![bakerdyl](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@bakerdyl](https://forum.mothur.org/u/bakerdyl)\
**Post date:** [October 14, 2022, 3:42pm UTC](https://forum.mothur.org/t/make-file-naming/21578/3 "2022-10-14T15:42:17Z")

</div>

Thanks Pat, I did end up using the rename command (in unix) to remove any unnecessary underscores and that seems to have done the trick. How do you specify which files get pooled? Would the first column be group, then followed by sample name, then the paired fastq files?

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [October 14, 2022, 3:56pm UTC](https://forum.mothur.org/t/make-file-naming/21578/4 "2022-10-14T15:56:38Z")

</div>

Close - it’s the name in the first column that’s used. So you would leave the fastq files in columns 2 and 3 and give a name for the pooled group. Alternatively, you could use [merge.groups](https://mothur.org/wiki/merge.groups/) to pool things after going through `make.contigs`

Pat

---

<div class="post-metadata">

**Author:** ![bakerdyl](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@bakerdyl](https://forum.mothur.org/u/bakerdyl)\
**Post date:** [October 14, 2022, 4:06pm UTC](https://forum.mothur.org/t/make-file-naming/21578/5 "2022-10-14T16:06:26Z")

</div>

Okay that makes sense. Do all of the samples need to be included in a design file or just the ones I want to group together? Because I have other samples that I just want to stand alone

---

<div class="post-metadata">

**Author:** ![pschloss](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/pschloss/32/4_2.png) [@pschloss](https://forum.mothur.org/u/pschloss)\
**Post date:** [October 14, 2022, 4:49pm UTC](https://forum.mothur.org/t/make-file-naming/21578/6 "2022-10-14T16:49:16Z")

</div>

Yeah, they all need to be there - but you can put them in their own group. For example…

```auto
A1 A
A2 A
B B
C C
D1 D
D2 D
D3 D

```

---

<div class="post-metadata">

**Author:** ![bakerdyl](https://avatars.discourse-cdn.com/v4/letter/b/d78d45/32.png) [@bakerdyl](https://forum.mothur.org/u/bakerdyl)\
**Post date:** [October 14, 2022, 5:41pm UTC](https://forum.mothur.org/t/make-file-naming/21578/7 "2022-10-14T17:41:26Z")

</div>

Okay I got the merge to work! Merge.groups takes a while with almost 500 samples, thought it wasn’t working for a second lol.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/system/32/2_2.png) [@system](https://forum.mothur.org/u/system)\
**Post date:** [October 24, 2022, 5:41pm UTC](https://forum.mothur.org/t/make-file-naming/21578/8 "2022-10-24T17:41:56Z")

</div>

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