Skip to content

Convert Fasta files located in different directories into one file

Notifications You must be signed in to change notification settings

Vladislav-Shevtsov/Fa_to_one

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Goal

The script combines fasta files of different loci located in different directories into one fasta file for each sample.

To achieve the distribution of locus files to folders that correspond to the name of the locus, please see the "move_to_folder" script https://github.com/Vladislav-Shevtsov/Sort-files-by-pattern

input

The script receive files in .fasta format

example : file.fasta

Example of files distribution before run the script:

  • folder_1_sample_1:

     locus_1.fasta
    
     locus_2.fasta
    
     locus_3.fasta
    
     ........
    
     ........
    
     locus_n.fasta
    
  • Folder_2_sample_2:

    locus_1.fasta
    
    locus_2.fasta
    
    locus_3.fasta
    
     ........
    
     ........
    
     locus_n.fasta
    
  • Folder_3_sample_3:

     locus_1.fasta
    
     locus_2.fasta
    
     locus_3.fasta
    
     ........
    
     ........
    
     locus__n.fasta
    

output

As a result, the script will generate following files:

Sample_1_all_loci_in_one_file.fasta

Sample_2_all_loci_in_one_file.fasta

Sample_3_all_loci_in_one_file.fasta

output represents files(reads) with .fasta extension located in output folder that you specify in code.

command line examples

The script receives two arguments: path to folder containing fasta files and output directory

python3 Fa_to_one.py /path/to/folders_containing_fasta_files /path/to/out_dir #This will generate bash file named "fa_to_one.sh"

./fa_to_one.sh #This will execute the bash file

#written by Shevtsov V. xatabadich(at)gmail.com

About

Convert Fasta files located in different directories into one file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages