Bash: selecting directory and fasta files from assembly
0
0
Entering edit mode
5.2 years ago
rah ▴ 20

I'm doing de novo assembling of several .fasta files using the Unicycler tool, and i want to handle the output directories of the assembly as well as the original .fasta file.

When the assembling finishes it creates a directory for each assembly, and i'm naming it similarly to the name of the original input fasta file. As an example of the assembly code

unicycler -t 6 -l test.fasta -o test.fasta_assembly

with the input being test.fasta and the output then being a directory, containing all the assembly files

test.fasta_assembly/

When the assembly fails the directory only contains 1 file, else it contains several. So i want to split the directories and their corresponding files up, by moving the succesful (both original .fasta and the created directory) to a directory called Succes/

I can move the succesful assemble directories using

mv $(find . -type f | cut -d/ -f2 | sort | uniq -d) Success/

With the find pipe selecting those directories with a number of files > 1. My problem is I also want to move the original .fasta file corresponding to the successfull directories to the Success/ folder. I've tried matching based on the similar name of the .fasta file and the directory to move the file into the directory, but i cant get it to work.

Could any of you help me with this, or have any ideas? Thank you.

Assembly fasta unix bash assembly • 1.1k views
ADD COMMENT
0
Entering edit mode

What code did you use/try to match based on the similar names?

ADD REPLY

Login before adding your answer.

Traffic: 2871 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6