Mercurial > repos > nick > duplex
diff 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 diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utils/msa2fa.awk Thu Feb 02 18:44:31 2017 -0500 @@ -0,0 +1,22 @@ +# 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++; +} \ No newline at end of file