Skip to content

Instantly share code, notes, and snippets.

@TomK32
Last active November 13, 2015 05:24
Show Gist options
  • Save TomK32/164138 to your computer and use it in GitHub Desktop.
Save TomK32/164138 to your computer and use it in GitHub Desktop.
ant dna
example map for
strenght: .AG. GC.. ...A ..GC | AC.. GT.. T.TC ....
size: CG.. .... ...C ..T. | ..AC .... ...C ..A.
ant 1: TTTC AAAG GGGG GAGC TGTA AGGA TTCT CCAG
ant 2: CCGC GGGC AGGT TTAC TACT TGGA TACC ACTC
Then we match each gene in strength and size against the ant unless it's a '.'
If we have match the score is increased. If we have a similarity (A<->G or C<->T)
the score is not changed and otherwise it's decreased.
For a fully working example script that works with strings:
http://gist.github.com/164135
example output:
CCGT TGTA GTAC GACT CCAA GCTT GCGT GTTG
size: 1
strength: 0
weight: -2
ATCT GGGT GGAC GCAC TTTA TTGG CGCC GCTG
size: 2
strength: 0
weight: -3
GCAG ACTA CCAT TGTA CCAC CCCC ACGT CAGG
size: 0
strength: -2
weight: 4
CAGA CCTT CTCC TTAC CCGA CCTA CCAG TATT
size: 0
strength: 2
weight: 5
GTTG TGTC TTGT CTAA TTCC CGAA TAGC CTTC
size: 1
strength: 0
weight: -2
TAGT ACTG TCAT TTTG TTCG GTAA TTCG GACT
size: -2
strength: 3
weight: 3
ACCA GCAA GCCG ATAC CCCT CTTA TCTG TGGA
size: -2
strength: 5
weight: 3
AAAC CTCG TGGA TCTC TTAG ATAA ACAA CGCA
size: 1
strength: 0
weight: 1
AGCT CTCG CAAC AGTT TAGC CCTC ATGG CCTA
size: 3
strength: -4
weight: 3
GCTT CCCC CCAC CATT TACG CTAG TAGA TGGC
size: 1
strength: 2
weight: -6
GCAA GTCT AAAA CATC GTGC GCAA ATAC TCAC
size: 3
strength: 0
weight: 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment