This is a test version of Biostars. For the public version, visit https://www.biostars.org.
concatenate all my fasta files in a directory into one file with Python

Hi all, I actually have to cat all my fasta files into directory but with python. In bash command it would be:

cat ./* > newfile

I guess it should be something like that:

with open(new_directory_0035+"/merged.txt", 'w') as f:
    for line in fileinput.input(glob.glob(new_directory_0035+"/*")):
        f.write(line)
    fileinput.close()

but it is still running after 20 minutes, do you know if I wrote something wrong? And it seems to take to much memory as well... Thanks

concatenate python

Hello benjamin!

We believe that this post does not fit the main topic of this site.

Not really bioinformatics, search StackOverflow maybe?

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.