# creating .names and .groups files

**URL:** <https://forum.mothur.org/t/creating-names-and-groups-files/93>\
**Category:** Commands in mothur\
**Created:** [January 11, 2010, 9:44pm UTC](https://forum.mothur.org/t/creating-names-and-groups-files/93 "2010-01-11T21:44:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lisab](https://avatars.discourse-cdn.com/v4/letter/l/838e76/32.png) [@lisab](https://forum.mothur.org/u/lisab)\
**Post date:** [January 11, 2010, 9:44pm UTC](https://forum.mothur.org/t/creating-names-and-groups-files/93/1 "2010-01-11T21:44:44Z")

</div>

I feel that this should be so obvious but which command(s) in mothur will create a .names and .groups file? Or do I create these myself using a program like Excel?

---

<div class="post-metadata">

**Author:** ![mbakker](https://avatars.discourse-cdn.com/v4/letter/m/82dd89/32.png) [@mbakker](https://forum.mothur.org/u/mbakker)\
**Post date:** [January 11, 2010, 10:18pm UTC](https://forum.mothur.org/t/creating-names-and-groups-files/93/2 "2010-01-11T22:18:21Z")

</div>

list.seqs will generate the names file.

The groups file is where you specify which sequences belong in which treatment/sample; the program has no way of knowing this, so I believe you have to define this yourself ahead of time. However, there are functions in mothur that can help with this if you have a large number of sequences. For example, you can use list.seqs to pull out the names, then use a simple sed statement (this step NOT in mothur, just at the command line) such as:  
sed ‘s/$/ AppendThisStringToEachLine/’ InputFileName \> OutputFileName  
to add the group name to each record in the names file. Do this for each sample/names file, then use merge.files in mothur to put them all together into a single groups file.

---

<div class="post-metadata">

**Author:** ![westcott](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.mothur.org/westcott/32/18_2.png) [@westcott](https://forum.mothur.org/u/westcott)\
**Post date:** [January 12, 2010, 11:56am UTC](https://forum.mothur.org/t/creating-names-and-groups-files/93/3 "2010-01-12T11:56:34Z")

</div>

unique.seqs will also generate a .names file.

---

<div class="post-metadata">

**Author:** ![gatdan](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gatdan](https://forum.mothur.org/u/gatdan)\
**Post date:** [December 4, 2014, 3:46pm UTC](https://forum.mothur.org/t/creating-names-and-groups-files/93/4 "2014-12-04T15:46:18Z")

</div>

Hi,  
This is all very new to me, so it’s probably a silly question: I’m going through the MiSeq SOP but avoiding the first stage of make.contigs. I’ve been trying to creat a \*.groups file manually by manipulating the fasta file using Excel (please don’t laugh). When running screen.seqs on the fasta and groups files I get these error massages: “Your groupfile does not include the sequence “X” please correct”, but only for some of the sequences. Manually I can find this sequence name in the groups file.  
If I try to run around this by avoiding a groups file in this stage and creating it with the fasta file created after preforming unique.seqs and then moving on to count.seqs, I get this: “[ERROR]: “X” is not in your groupfile” for all of my sequences.  
I’m using 2 processors.  
Thank you very much!
