Posts

Showing posts from February, 2025
 A. Treatment of Sequences No. 1 #Extract FASTA Sequences from another file using sequence IDs in another file #Write two separate scripts with file names FastaToTbl and TblToFasta with the following content: FastaToTbl: #!/usr/bin/awk -f {         if (substr($1,1,1)==">")         if (NR>1)                     printf "\n%s\t", substr($0,2,length($0)-1)         else              printf "%s\t", substr($0,2,length($0)-1)         else                  printf "%s", $0 }END{printf "\n"} TblToFasta: #! /usr/bin/awk -f {   sequence=$NF   ls = length(sequence)   is = 1   fld  = 1   while (fld < NF)   {      if (fld == 1){printf ">"}      printf "%s " , $fld      if (fld == NF-1)     ...