Created
March 25, 2019 00:55
-
-
Save tobigithub/f203df6f17104958fa976bc748dafb93 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # requires input file HUMAN.fasta (or others) writes it sorted by sequence length to HUMAN-sort.fasta | |
| # source https://www.biostars.org/p/153999/ | |
| awk '/^>/ {printf("%s%s\t",(N>0?"\n":""),$0);N++;next;} {printf("%s",$0);} END {printf("\n");}' HUMAN.fasta |\ | |
| awk -F '\t' '{printf("%d\t%s\n",length($2),$0);}' |\ | |
| sort -k1,1n | cut -f 2- | tr "\t" "\n" > HUMAN-sort.fasta | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment