Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on: merge.group #90

Open
apoosakkannu opened this issue Aug 4, 2022 · 3 comments
Open

Question on: merge.group #90

apoosakkannu opened this issue Aug 4, 2022 · 3 comments

Comments

@apoosakkannu
Copy link

Hi, I am working on mothur for processing my data. I need to make a following command for several samples.
make.group(fasta=sample1.fasta-sample2.fasta-sample3.fasta, groups=A-B-C)

I find it difficult to type 351 sample names in the above command. Could you give me any pointer on it to proceed for multiple samples?

I am working on high performance computing remote server.

Thanks in advance!

@pschloss
Copy link
Contributor

pschloss commented Aug 4, 2022

You could do this with bash commands like cat and sed from the command line. For example, with the example above...

cat sample1.fasta sample2.fasta sample3.fasta > samples.fasta

> sample.groups
for fasta in sample?.fasta
do
sample_id=`echo $fasta | sed s/.fasta//`
grep ">" $fasta | sed "s/>//" | sed "s/$/\t$sample_id/" >> sample.groups
done

This will use the file name (except for the .fasta) as the group name in the groups file.

@mothur-westcott
Copy link
Collaborator

@pschloss, perhaps this would be a good place for some enhancements?

  1. Modify make.file so it could look for fasta files in a folder, and generate a file that could be used with the make.group command.
  2. Add the file option to make.group

mothur > make.file(inputdir=./, type=fasta)
mothur > make.group(file=current)

@pschloss
Copy link
Contributor

pschloss commented Aug 9, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants