Wednesday, March 14, 2001


sweeter.


sweet.

Back home! Listening to SomaFm, mmm, chilled ambient beats. So nice.

Tuesday, March 13, 2001

Hee hee, check this out:

//
// Enumerated Mountain Rule
//

struct PathList;

// One item in a path
struct PathItem {
int indx; // Index into clones[]
struct PathItem *next; // Next PathItem in the list

struct PathList *links;
};

// One path
struct PathList {
struct PathItem *head;
struct PathItem *z;
};

// All the paths
struct PathCollection {
struct PathList *head;
struct PathList *z;
};



Hee hee! Lots of recursive data structures here! Isn't the PathList in PathItem a cute multi-dimensional treat?
Man, I love coding little cute algorithms, I love thinking about the most efficient way to implement
algorithms, weird little data structures.. Cool.


I find in C that I stick with simpler data structures like arrays, not like how I used to work in C++,
but then there is more to keep track of in C, which makes it fun and challenging.

Interesting day today, got a great start on the Enumerated Mountain Rule, wrote this cute little bit of code:


int compare_sulstons(const void* a, const void* b)
{

if((*(struct MatrixListItem**)a)->score < (*(struct MatrixListItem**)b)->score) return -1;
if((*(struct MatrixListItem**)a)->score > (*(struct MatrixListItem**)b)->score) return 1;
return 0;
}
int build_bestlist(struct Clone **clones, struct Contig **contigs, int ctgnum, int tolerance)
{
int i, j, k;
int num, tot;

// 1) Allocate memory for list and clear list
num = contigs[ctgnum]->num_show;
tot = num * (num - 1) / 2;
bestlist = (struct MatrixListItem **) malloc (sizeof (struct MatrixListItem*) * tot);

for (i = 0; i < tot; i++) {
bestlist[i] = (struct MatrixListItem *) malloc (sizeof (struct MatrixListItem));
bestlist[i]->indx1 = -1;
bestlist[i]->indx2 = -1;
bestlist[i]->score = 0.0;
}

// 2) Build the list (half the matrix)
k = 0;
for (i = 0; i < num; i++)
for (j = i+1; j < num; j++) {
bestlist[k]->indx1 = contigs[ctgnum]->show_indx[i];
bestlist[k]->indx2 = contigs[ctgnum]->show_indx[j];
bestlist[k]->score = sulston(clones[contigs[ctgnum]->show_indx[i]],clones[contigs[ctgnum]->show_indx[j]]);
if (DEBUG >= 2)
printf("Adding %3i %3i %3i\t\t1=%3i\t2=%3i\t%.1e\n",i,j,k,bestlist[k]->indx1,bestlist[k]->indx2,bestlist[k]->score);
k++;
}

// 3) Sort this list by sulston score
qsort(bestlist, tot, sizeof(struct MatrixListItem*), compare_sulstons);

// 4) Print the list out
if (DEBUG)
for (i = 0; i < tot; i++) {
printf("Score = %.1e\ti = %i\tClone A %3i (%s)\tClone B %3i (%s)\n",bestlist[i]->score,i,
bestlist[i]->indx1, clones[bestlist[i]->indx1]->clonename,
bestlist[i]->indx2, clones[bestlist[i]->indx2]->clonename);
}


return tot;


}


Isn't that cute? :)

Monday, March 12, 2001

Wow! More fun work today! Pulled out all the code from ,gactg and put it into ga.c and ga.h, then made gactg just call these routines to do it's work. Then, used ga.[ch] to add gactg functionality to contiger! So, now you can look at your contigs, and interactively run
genetic algorithms on them to fix them up. Hopefully will put this right into FPC which would rock, but might be difficult. I'll get it going in contiger first, then go crazy after that.

Sunday, March 11, 2001

Did a little redesign on the main site. Productive blue.

// gactg.c

// Read in an fpc file and do a genetic algorithm to fix the named contig
//
// Genetic operators
//
// Crossover probability percentages, should add up to 100
#define CROSSOVER 25
#define MUTATION 25
#define FIXWORST 25
#define BLOCKSHIFT 25
#define MOUNTAIN 25

#define POPSIZE 20
#define NUMGENS 10000
#define NUMREPLACE 3

// Types of scoring metrics
#define RUNSCORE 1
#define NEIGHBOURSCORE 2
#define NEIGHBOURCONF 3
#define SULSTONNEIGHBOUR 4
// Which score we are using
int score_method = SULSTONNEIGHBOUR;


gactg, my new program name. cool, eh?!

Saturday, March 10, 2001

Wow, had an *incredible* week! Wrote over 1500 lines of code, got a
full GA up and running that looks very promising for doing our contig
ordering!



This takes 15 seconds to run at home (600 MHz Pentium III) for 10000
generations. Order is perfect, except that 8 should be at the leftmost
end.



Scores are all the sulston exponents between each neighbour and the next.
This tries to minimize that quantity. It's very fast.



Cool, eh!





-----------------------------------------------------------------
Best = 0 Score = 581

499 446 426 399 385 374 311 292 251 224 195 190 162 139 124 94 61 31 8 958 920 892 841 633 626 617 596 562

Total Mutations = 7624 Good Mutations = 36
Total Crossovers = 3707 Good Crossovers = 6
Total SpanXovers = 3724 Good SpanXovers = 8
Total Fix Worst = 7537 Good Fix Worst = 212
Total BlockShift = 7408 Good BlockShift = 27
Total Mountain = 0 Good Mountain = 0
-----------------------------------------------------------------
shakti 107 [~/GDEV/contiger] %




The inital contig order was randomly shuffled 1000 times, giving clones
like below:




Gen = 1 best = 211 (4)
399 311 446 499 162 958 374 633 841 139 190 195 251 292 892 31 61 94 596 426 562 617 626 385 8 920 224 124


This was the best order at the start.



Friday, March 09, 2001

Oh blogger is confused. It's putting my new articles in an archive....
Mittelstandskinder - Ohne Strom - Bug

Thursday, March 08, 2001

Another earthquake?

Wednesday, March 07, 2001

Rush - Tom Sawyer Remix
Blogger, please post the posts. Please work.

Tuesday, March 06, 2001

March 5th already! Wow, this year is going by very quickly!
TranceGlobalNation - Boiler - Humate Remix

Monday, March 05, 2001

Listening to Run Lola Run.
Saw SNFU this weekend. Chi Pig is just as hardcore as ever. Also, you know
it's a good punk concert when somebody is carried out, head bandaged, on a stretcher.

Friday, March 02, 2001

At the request of Simon I'm posting in my blog again. :)
I've been working on programs to order fingerprinted contigs in the Mouse map, and have been
SUPER busy. More updates soon, I promise.