Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit 162158753689f73003cc9b6e7b0fffb3eb576b53 1 parent 294bc61
@gerdr gerdr authored
View
11 rosalind/README
@@ -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
3  rosalind/dna-gerdr.pl
@@ -0,0 +1,3 @@
+use v6;
+
+<A C G T>.map({ +.comb(/$^symbol/) }).say given slurp;
View
20 rosalind/gc-gerdr.pl
@@ -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
3  rosalind/revc-gerdr.pl
@@ -0,0 +1,3 @@
+use v6;
+
+.flip.trans('ACGT' => 'TGCA').say given slurp;
View
3  rosalind/rna-gerdr.pl
@@ -0,0 +1,3 @@
+use v6;
+
+.trans('T' => 'U').say given slurp;
Please sign in to comment.
Something went wrong with that request. Please try again.