This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to merge multi-chromosomes for sacCer3 -- a kind of yeast

I have fasta sequence of sacCer3 strain of yeast downloaded form http://hgdownload.cse.ucsc.edu/goldenPath/sacCer3/chromosomes/.

Because I need to mapping mu sequence data to this specie, I have to merge them together. Could you tell me how to merge them ( chrI.fa, chrII.fa, chrIII.fa ...) ? May I cat them all together directly by using the script (cat *.fa > all.fa) ?

Any help would be great appreciated.

rna-seq sequencing

1 answer

find . -maxdepth 1 -name "chr*.fa" | xargs cat > merged.fa

Don't do cat *.fa > merged.fa because it has been reported that sometimes (and I do not know the reasons) the cat command might recognize the output merged.fa and infinitely keeps adding its content to itself.

Also, please use the search function next time as this is a standard task asked many times before ;-)

I ve never experienced this infinite loop for cat, but I suppose you can avoid this by using an alternative extension like:

cat *.fa > merged.fasta

Thanks a lot for your help.

Log in to answer this question.