Hi,

I was wondering if there was a way to sort a fasta file so that the chromosomes are in numeric order. Currently, the fasta file is computationally sorted where the chromosomes are order like this

    >chr1
    >chr10
    >chr11
    ....
    >chr2
    >chr20

I was wondering if there was a way to sort the fasta file so the chromosomes are sorted numerically like this

    >chr1
    >chr2
    >chr3
    ...
    >chr10
    >chr11
Try:

    bioawk -c fastx '{print}' in.fa | sort -k1,1V | awk '{print ">"$1;print $2}'

or any of:

https://www.biostars.org/p/18929/

