snippy
snippy copied to clipboard
Super new to Snippy: How to change the output file instead of the default snps.XXX?
Hello, I am super new to the world of code/script etc. I am doing Covid-19 phylogenetic work. I used snippy-multi to generate indel profile before confirming using IGV and editing them in Jalview
snippy-multi input.tab --ref ref.fasta --cpus 16 > runme.sh less runme.sh sh ./runme.sh
I have 2 questions:
- The output file is all named as snps.XXX by default and I would like to name them according to my sample ( which is the directory name by default).
- Once the name has been changed, how could I concatenate all of the .consensus.fa into one multifasta file. Thank you for your help!
for your first question : imagine that your output dir has the name workdir:
for file in $(find workdir -type f -name "snps.*");\
do name=$(echo $file | cut -d"/" -f 2); mv "$file" "`dirname $file`/${name}.${file##*.}";done
for the second one:
for file in $(find workdir -type f -name "*consensus.fa");`\
do cut $file >> all.consensus.fa;done