# Renaming groups in shared files due to '-' within the name

**URL:** <https://forum.mothur.org/t/renaming-groups-in-shared-files-due-to-within-the-name/2220>\
**Category:** Commands in mothur\
**Created:** [January 26, 2015, 2:21pm UTC](https://forum.mothur.org/t/renaming-groups-in-shared-files-due-to-within-the-name/2220 "2015-01-26T14:21:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aschoster](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@aschoster](https://forum.mothur.org/u/aschoster)\
**Post date:** [January 26, 2015, 2:21pm UTC](https://forum.mothur.org/t/renaming-groups-in-shared-files-due-to-within-the-name/2220/1 "2015-01-26T14:21:16Z")

</div>

Hi everyone

I made the mistake of naming my samples (groups) using ‘-’ within the name (e.g. C-CC1-HF). I have about 150 samples named that way. Now I have run my analysis and come to the point where I would like to use the get.groups or remove.groups command to analyze a subsample of the sequences. I cannot do that as the command requires ‘-’ in-between samples or groups to be removed from my shared file. Any ideas how to fix that?

Can I change my sample names in the shared file? Or can I somehow use a different symbol other than ‘-’ in the get.groups command?

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:** [January 26, 2015, 3:08pm UTC](https://forum.mothur.org/t/renaming-groups-in-shared-files-due-to-within-the-name/2220/2 "2015-01-26T15:08:06Z")

</div>

You could change it in the shared file manually or you should be able to use a \ before the - in get.groups. It also might just be easier in the long run to go back to the beginning and rename the group names in the files or oligos files.

Pat

---

<div class="post-metadata">

**Author:** ![aschoster](https://avatars.discourse-cdn.com/v4/letter/a/ba8739/32.png) [@aschoster](https://forum.mothur.org/u/aschoster)\
**Post date:** [January 26, 2015, 3:26pm UTC](https://forum.mothur.org/t/renaming-groups-in-shared-files-due-to-within-the-name/2220/3 "2015-01-26T15:26:22Z")

</div>

Thanks Pat

I tried going into the shared file (opening it through Excel) and changing the names by removing the ‘-’. I then saved the file (I got a message then some of the features of the file will no longer be available) and tried the command again. I tried to remove 6 of the groups  
mothur \> get.groups(shared=stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.an.unique\_list.0.03.subsample.shared,groups=CAL2H-CBC2S-CBP2HD-CCC2HF-CCC2S-CDS2HD)

then it told me:  
CAL2H is not a valid group, and will be disregarded.  
CBC2S is not a valid group, and will be disregarded.  
CBP2HD is not a valid group, and will be disregarded.  
CCC2HF is not a valid group, and will be disregarded.  
CCC2S is not a valid group, and will be disregarded.  
CDS2HD is not a valid group, and will be disregarded.  
You provided no valid groups. I will run the command using all the groups in your file.  
Selected groups: CAL2H, CBC2S, CBP2HD, CCC2HF, CCC2S, CDS2HD from your shared file.

I tried you other suggestion with \ as well as - and both don’t work - same error message as aboveâ€¦

Any other suggestions other than to redo the analysis? Or am I doing something wrong when changing the names in the shared file?

Thanks for your help

---

<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:** [February 2, 2015, 3:02pm UTC](https://forum.mothur.org/t/renaming-groups-in-shared-files-due-to-within-the-name/2220/4 "2015-02-02T15:02:55Z")

</div>

Did you run something like:

mothur \> get.groups(shared=abrecovery.an.shared, groups=A-B-C)

In our current version, 1.34, mothur will select groups A-B and C with the above command.
