get.oturep sequence names

Hello,

I’m trying to use get.oturep to recover fasta sequences for my OTUs for use with Arb. However, the fasta file output ends up with these enormous names, and I’m wondering if there’s a simple way to get rid of them; specifically, everything past the OTU number and counts. Example:

MISEQ_31_000000000-AW0EW_1_1101_19671_15407 Otu000001|235327|JP_V4_PCRneg-N10_V4_JP_C_F-N10_V4_JP_D_F-N11_V4_JP_CH_M-N11_V4_JP_C_M-N11_V4_JP_D_M-N11_V4_JP_V_M-N12_V4_JP_CH_M-N12_V4_JP_C_M-N12_V4_JP_D_M-N12_V4_JP_V_M-N13_V4_JP_CH_M-N13_V4_JP_C_M-N13_V4_JP_D_M-N13_V4_JP_V_M-N13_V4_PF_C-N13_V4_PF_CH-N13_V4_PF_V-N14_V4_PF_C-N15_V4_JP_CH_M-N15_V4_JP_C_M-N15_V4_JP_D_M-N15_V4_JP_V_M-N15_V4_PF_CH-N16_V4_JP_C_M-N16_V4_JP_D_M-N16_V4_JP_V_M-N16_V4_PF_C-N16_V4_PF_V-N17_V4_JP_CH_M-N17_V4_JP_C_M-N17_V4_JP_D_M-N17_V4_JP_V_M-N17_V4_PF_C-N17_V4_PF_CH-N17_V4_PF_V-N18_V4_JP_CH_M-N18_V4_JP_C_M-N18_V4_JP_D_M-N19_V4_JP_CH_M-N19_V4_JP_C_M-N19_V4_JP_D_M-N19_V4_JP_V_M-N1_V4_JP_CH_F-N1_V4_JP_C_F-N1_V4_JP_D_F-N1_V4_JP_V_F-N20_V4_JP_CH_M-N20_V4_JP_C_M-N20_V4_JP_D_M-N20_V4_JP_V_M-N21_V4_JP_CH_M-N21_V4_JP_C_M-N21_V4_JP_D_M-N21_V4_JP_V_M-N22_V4_JP_CH_M-N22_V4_JP_C_M-N22_V4_JP_V_M-N2_V4_JP_CH_F-N2_V4_JP_C_F-N2_V4_JP_V_F-N3_V4_JP_CH_F-N3_V4_JP_D_F-N3_V4_JP_V_F-N4_V4_JP_CH_F-N4_V4_JP_C_F-N4_V4_JP_D_F-N4_V4_JP_V_F-N5_V4_JP_CH_F-N5_V4_JP_C_F-N5_V4_JP_V_F-N6_V4_JP_CH_F-N6_V4_JP_C_F-N6_V4_JP_D_F-N6_V4_JP_V_F-N7_V4_JP_CH_F-N7_V4_JP_C_F-N7_V4_JP_D_F-N7_V4_JP_V_F-N7_V4_PF_C-N7_V4_PF_V-N8_V4_JP_CH_F-N8_V4_JP_C_F-N8_V4_JP_D_F-N8_V4_JP_V_F-N8_V4_PF_CH-N8_V4_PF_D-N8_V4_PF_V-N9_V4_JP_CH_F-N9_V4_JP_C_F-N9_V4_JP_D_F-N9_V4_JP_V_F-N9_V4_PF_C-Soil_V4_JP
TAC–GT-AG-GGT----GCG-A-G–C--G–T-T–AA-T-CGG-AA—TT-A–C-T–GG-GC—GT–A--AA-GC-GT-GC----G-CA-G-G-C-G—G–T-TA-T-A-T------AA–G-T-C-A----G-A-T–G--TG–A-AA-TC–C-C-CG-G-G—CT-C-AA----------------C-C-T-G-G-G-A–C-C—T-G–C-A–T-T—T–GA-G-A–C--T–G-T–AT–A-G-C-----------------------------------------------------------------T-A-G-A-G-T–A-----C-GG----TA-G-A–G-G-G-G—GA-T------GG–A--ATT-----C-C-G-C-GT–GT-A-G-CA-GT-G–A-A-A—TG-C-GT-AG–AT-A-TG--------C-G—G-A–G-G-A-AC-A-CC-----GA–T--G–GC-GAA-G–G-C—A------A–T-C-C-C—CTG–G--AC-C-T------G-T-----A-C-T–GA–CG-C—T-C–A-TG–C-A-CG-A–AA-G-C----G-TG–GG-G–AG-C-A-AA-CAGG
MISEQ_31_000000000-AW0EW_1_1113_4167_9419 Otu000002|226099|JP_V4_PCRneg-N10_V4_JP_C_F-N10_V4_JP_D_F-N10_V4_PF_C-N10_V4_PF_CH-N10_V4_PF_D-N10_V4_PF_V-N11_V4_JP_CH_M-N11_V4_JP_C_M-N11_V4_JP_D_M-N11_V4_JP_V_M-N11_V4_PF_C-N11_V4_PF_CH-N11_V4_PF_D-N11_V4_PF_V-N12_V4_JP_CH_M-N12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P_D_F-N3_V4_JP_V_F-N3_V4_PF_C-N3_V4_PF_D-N3_V4_PF_V-N4_V4_JP_CH_F-N4_V4_JP_C_F-N4_V4_JP_D_F-N4_V4_JP_V_F-N4_V4_PF_C-N4_V4_PF_CH-N4_V4_PF_D-N5_V4_JP_CH_F-N5_V4_JP_C_F-N5_V4_JP_V_F-N5_V4_PF_C-N5_V4_PF_CH-N5_V4_PF_D-N5_V4_PF_V-N6_V4_JP_CH_F-N6_V4_JP_C_F-N6_V4_JP_D_F-N6_V4_JP_V_F-N6_V4_PF_C-N6_V4_PF_CH-N6_V4_PF_D-N7_V4_JP_CH_F-N7_V4_JP_C_F-N7_V4_JP_D_F-N7_V4_JP_V_F-N7_V4_PF_C-N7_V4_PF_CH-N7_V4_PF_D-N7_V4_PF_V-N8_V4_JP_CH_F-N8_V4_JP_C_F-N8_V4_JP_D_F-N8_V4_JP_V_F-N8_V4_PF_C-N8_V4_PF_CH-N8_V4_PF_V-N9_V4_JP_CH_F-N9_V4_JP_C_F-N9_V4_JP_D_F-N9_V4_JP_V_F-N9_V4_PF_C-N9_V4_PF_CH-N9_V4_PF_D-N9_V4_PF_V-Neg17_18_V4_PF-Neg1_V4_PF-Neg2_V4_PF-Soil_V4_JP-Soil_V4_PF-Water_V4_PF
TAC–GG-AG-GGT----GCA-A-G–C--G–T-T–AT-C-CGG-AT—TT-A–T-T–GG-GT—TT–A--AA-GG-GT-CC----G-TA-G-G-C-G—G–G-CT-A-G-T------AA–G-T-C-A----G-T-G–G--TG–A-AA-TC–T-C-GA-T-G—CT-T-AA----------------C-A-T-C-G-A-A–A-C—T-G–C-C–A-T—T–GA-T-A–C--T–G-C–TA–G-C-C-----------------------------------------------------------------T-T-G-A-G-T–A-----A-GG----TA-G-A–G-G-T-A—GC-T------GG–A--ATA-----A-G-T-A-GT–GT-A-G-CG-GT-G–A-A-A—TG-C-AT-AG–AT-A-TT--------A-C—T-T–A-G-A-AC-A-CC-----AA–T--T–GC-GAA-G–G-C—A------G–G-T-T-A—CCA–T--GT-C-T------T-A-----A-C-T–GA–CG-C—T-G–A-GG–G-A-CG-A–AA-G-C----G-TG–GG-G–AG-C-G-AA-CAGG
MISEQ_31_000000000-AW0EW_1_1102_10783_24000 Otu000003|114487|JP_V4_PCRneg-N10_V4_JP_C_F-N10_V4_JP_D_F-N10_V4_PF_C-N10_V4_PF_CH-N10_V4_PF_D-N10_V4_PF_V-N11_V4_JP_CH_M-N11_V4_JP_C_M-N11_V4_JP_D_M-N11_V4_JP_V_M-N11_V4_PF_C-N11_V4_PF_CH-N11_V4_PF_D-N11_V4_PF_V-N12_V4_JP_CH_M-N12_V4_JP_C_M-N12_V4_JP_D_M-N12_V4_JP_V_M-N12_V4_PF_C-N12_V4_PF_CH-N12_V4_PF_D-N12_V4_PF_V-N13_V4_JP_CH_M-N13_V4_JP_C_M-N13_V4_JP_D_M-N13_V4_JP_V_M-N13_V4_PF_C-N13_V4_PF_CH-N13_V4_PF_D-N13_V4_PF_V-N14_V4_JP_CH_M-N14_V4_JP_C_M-N14_V4_JP_V_M-N14_V4_PF_C-N14_V4_PF_CH-N14_V4_PF_D-N14_V4_PF_V-N15_V4_JP_CH_M-N15_V4_JP_C_M-N15_V4_JP_D_M-N15_V4_JP_V_M-N15_V4_PF_C-N15_V4_PF_CH-N15_V4_PF_D-N15_V4_PF_V-N16_V4_JP_C_M-N16_V4_JP_D_M-N16_V4_JP_V_M-N16_V4_PF_C-N16_V4_PF_CH-N16_V4_PF_D-N16_V4_PF_V-N17_V4_JP_CH_M-N17_V4_JP_C_M-N17_V4_JP_D_M-N17_V4_JP_V_M-N17_V4_PF_C-N17_V4_PF_CH-N17_V4_PF_D-N17_V4_PF_V-N18_V4_JP_CH_M-N18_V4_JP_C_M-N18_V4_JP_D_M-N18_V4_PF_C-N18_V4_PF_CH-N18_V4_PF_D-N18_V4_PF_V-N19_V4_JP_CH_M-N19_V4_JP_C_M-N19_V4_JP_D_M-N19_V4_JP_V_M-N1_V4_JP_CH_F-N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–GT-AG-GGT----GCA-A-G–C--G–T-T–AA-T-CGG-AA—TT-A–C-T–GG-GC—GT–A--AA-GC-GT-GC----G-CA-G-G-C-G—G–C-TT-T-G-C------AA–G-A-C-A----G-A-T–G--TG–A-AA-TC–C-C-CG-G-G—CT-C-AA----------------C-C-T-G-G-G-A–A-C—T-G–C-A–T-T—T–GT-G-A–C--T–G-C–AA–G-G-C-----------------------------------------------------------------T-A-G-A-G-T–A-----C-GG----TA-G-A–G-G-G-G—AG-T------GG–A--ATT-----C-C-G-C-GT–GT-A-G-CA-GT-G–A-A-A—TG-C-GT-AG–AT-A-TG--------C-G—G-A–G-G-A-AC-A-CC-----GA–T--G–GC-GAA-G–G-C—A------G–C-T-C-C—CTG–G--AC-C-T------G-T-----A-C-T–GA–CG-C—T-C–A-TG–C-A-CG-A–AA-G-C----G-TG–GG-G–AG-C-A-AA-CAGG

Thank you,
Patric

If you’re using a Linux/Mac computer, you could just use the cut command on the terminal:

cut -f1 input.fasta > outut.fasta

This worked very well. Thank you. I added -d"|" flag so I could keep the OTU number, and used “sed” to replace the tab with “_” in the name.

From the terminal:

mothur get.oturep(column=stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.dist, list=stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.an.unique_list.list, fasta=stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.fasta, count=stability.count_table)

Output (with names for my actual samples, not stability.names):

MISEQ_31_000000000-AW0EW_1_1101_19671_15407 Otu000001|235327|JP_V4_PCRneg-N10_V4_JP_C_F-N10_V4_JP_D_F-N11_V4_JP_CH_M-N11_V4_JP_C_M-N11_V4_JP_D_M-N11_V4_JP_V_M-N12_V4_JP_CH_M-N12_V4_JP_C_M-N12_V4_JP_D_M-N12_V4_JP_V_M-N13_V4_JP_CH_M-N13_V4_JP_C_M-N13_V4_JP_D_M-N13_V4_JP_V_M-N13_V4_PF_C-N13_V4_PF_CH-N13_V4_PF_V-N14_V4_PF_C-N15_V4_JP_C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-GT-GC----G-CA-G-G-C-G—G–T-TA-T-A-T------AA–G-T-C-A----G-A-T–G--TG–A-AA-TC–C-C-CG-G-G—CT-C-AA----------------C-C-T-G-G-G-A–C-C—T-G–C-A–T-T—T–GA-G-A–C--T–G-T–AT–A-G-C-----------------------------------------------------------------T-A-G-A-G-T–A-----C-GG----TA-G-A–G-G-G-G—GA-T------GG–A--ATT-----C-C-G-C-GT–GT-A-G-CA-GT-G–A-A-A—TG-C-GT-AG–AT-A-TG--------C-G—G-A–G-G-A-AC-A-CC-----GA–T--G–GC-GAA-G–G-C—A------A–T-C-C-C—CTG–G--AC-C-T------G-T-----A-C-T–GA–CG-C—T-C–A-TG–C-A-CG-A–AA-G-C----G-TG–GG-G–AG-C-A-AA-CAGG

mv stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.pick.an.unique_list.unique.rep.fasta stability.repOTU.fasta
cut -d"|" -f1 stability.repOTU.fasta > stability.repOTU.output.fasta
head stability.repOTU.output.fasta

MISEQ_31_000000000-AW0EW_1_1101_19671_15407 Otu000001
TAC–GT-AG-GGT----GCG-A-G–C--G–T-T–AA-T-CGG-AA—TT-A–C-T–GG-GC—GT–A--AA-GC-GT-GC----G-CA-G-G-C-G—G–T-TA-T-A-T------AA–G-T-C-A----G-A-T–G--TG–A-AA-TC–C-C-CG-G-G—CT-C-AA----------------C-C-T-G-G-G-A–C-C—T-G–C-A–T-T—T–GA-G-A–C--T–G-T–AT–A-G-C-----------------------------------------------------------------T-A-G-A-G-T–A-----C-GG----TA-G-A–G-G-G-G—GA-T------GG–A--ATT-----C-C-G-C-GT–GT-A-G-CA-GT-G–A-A-A—TG-C-GT-AG–AT-A-TG--------C-G—G-A–G-G-A-AC-A-CC-----GA–T--G–GC-GAA-G–G-C—A------A–T-C-C-C—CTG–G--AC-C-T------G-T-----A-C-T–GA–CG-C—T-C–A-TG–C-A-CG-A–AA-G-C----G-TG–GG-G–AG-C-A-AA-CAGG

And some options for cleaning up:

sed -i 's/-//g' stability.repOTU.output.fasta
sed -i 's/ /_/g' stability.repOTU.output.fasta
head stability.repOTU.output.fasta

MISEQ_31_000000000AW0EW_1_1101_19671_15407_Otu000001
TACGTAGGGTGCGAGCGTTAATCGGAATTACTGGGCGTAAAGCGTGCGCAGGCGGTTATATAAGTCAGATGTGAAATCCCCGGGCTCAACCTGGGACCTGCATTTGAGACTGTATAGCTAGAGTACGGTAGAGGGGGATGGAATTCCGCGTGTAGCAGTGAAATGCGTAGATATGCGGAGGAACACCGATGGCGAAGGCAATCCCCTGGACCTGTACTGACGCTCATGCACGAAAGCGTGGGGAGCAAACAGG