view utils/msa2fa.awk @ 18:e4d75f9efb90 draft

planemo upload commit b'4303231da9e48b2719b4429a29b72421d24310f4\n'-dirty
author nick
date Thu, 02 Feb 2017 18:44:31 -0500
parents af383638de66
children
line wrap: on
line source

# A quick script to convert the .msa.tsv output of sscs.py back into FASTA format.

BEGIN {
  FS = "\t";
  OFS = "\t";
}

$2 == "CONSENSUS" {
  if ($1 == last) {
    mate = 2;
  } else {
    mate = 1;
  }
  printf(">%s.%d:%d\n", $1, mate, pairs);
  print $3;
  pairs = 0;
  last = $1;
}

$2 != "CONSENSUS" {
  pairs++;
}