Last active
February 8, 2017 15:45
-
-
Save ShaiberAlon/a61880daf8d23463c488072ecf07968f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import anvio.utils as utils | |
fasta_suffix = '.fna' | |
output_file = 'merged_fasta.fna' | |
samples_list = 'samples.txt' | |
output_fasta_dictionary = {} | |
with open(samples_list,'r') as s: | |
for sample in s: | |
sample=sample.strip() | |
sample_fasta = "".join([sample,fasta_suffix]) | |
print(sample) | |
print(sample_fasta) | |
fasta_dic = utils.get_FASTA_file_as_dictionary(sample_fasta) | |
for contig_name in fasta_dic: | |
new_contig_name = sample + '_' + contig_name | |
output_fasta_dictionary[new_contig_name] = fasta_dic[contig_name] | |
utils.store_dict_as_FASTA_file(output_fasta_dictionary, output_file) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment