Permalink
Browse files

[rosalind] Add directory for Rosalind (http://rosalind.info) solutions

  • Loading branch information...
1 parent 294bc61 commit 162158753689f73003cc9b6e7b0fffb3eb576b53 @gerdr gerdr committed Oct 30, 2012
Showing with 40 additions and 0 deletions.
  1. +11 −0 rosalind/README
  2. +3 −0 rosalind/dna-gerdr.pl
  3. +20 −0 rosalind/gc-gerdr.pl
  4. +3 −0 rosalind/revc-gerdr.pl
  5. +3 −0 rosalind/rna-gerdr.pl
View
@@ -0,0 +1,11 @@
+Rosalind
+========
+http://rosalind.info/
+
+This is a directory to post solutions to Rosalind problems (Rosalind is a
+Project Euler inspired platform for teaching bioinformatics).
+
+Use the file format <id>-<author>.pl replacing <id> with the (lowercase)
+problem ID and <author> with your name.
+
+Have fun!
View
@@ -0,0 +1,3 @@
+use v6;
+
+<A C G T>.map({ +.comb(/$^symbol/) }).say given slurp;
View
@@ -0,0 +1,20 @@
+use v6;
+
+grammar FASTA {
+ token TOP { ^ \n* <DNA-string>+ }
+ token DNA-string { '>' (\N+) \n (<[ACGT\n]>+) }
+}
+
+my $actions = class {
+ method TOP($/) {
+ make $<DNA-string>>>.ast
+ }
+
+ method DNA-string($/) {
+ make [~$0, 100 * +.comb(/<[GC]>/) / +.comb(/<[ACGT]>/)]
+ given ~$1
+ }
+};
+
+FASTA.parse($_, :$actions).ast.sort(*.[1]).[*-1] ~ '%' ==> say()
+ given slurp;
View
@@ -0,0 +1,3 @@
+use v6;
+
+.flip.trans('ACGT' => 'TGCA').say given slurp;
View
@@ -0,0 +1,3 @@
+use v6;
+
+.trans('T' => 'U').say given slurp;

0 comments on commit 1621587

Please sign in to comment.