eof()) { $s=$parser->fetch(); $parser->Move_Next(); } } /* * I execute SPIDEY, parse the result and add the mRNA features to my sequence object * for that I used as input genomic.fa and for instance refseq.fa * repbase is a fasta file with repeat sequence that has been formatted with formatdb */ $mrna_features = array(); exec(CGI_DIR . 'spidey.linux -i ' . TMP_DIR . 'genomic.fa -m ' . TMP_DIR . 'refseq.fa -p 0 -o ' . TMP_DIR . 'resultatspidey -R ' . CGI_DIR . 'repbase'); $fh_spidey = fopen(TMP_DIR . "resultatspidey", r); $importer = new parse_spidey($fh_spidey); while(!feof($importer->source)) { $f = $importer->fetchNext(); } $mrna_features[] = $importer->mrna_features; $s->features[mRNA] = $mrna_features; /* * I draw my pics * * */ $panel1 = new panel( array( 'length' => $s->seqlength, 'start' => 0, 'stop' => $s->seqlength, 'pad_top' => 20, 'pad_bottom' => 20, 'pad_left' => 40, 'pad_right' => 40, 'width' => 900, 'spacebetweentracks' => 30 ) ); $panel1->add_track( array( 'type' => 'text', 'color' => 'red', 'text' => 'Genomic annotation of PAK1', 'position' =>'center' ) ); $panel1->add_track( array( 'type' => 'scale', 'color' => 'black' ) ); $panel1->add_track( array( 'type' => 'sequence', 'color' => 'blue', 'first_description' => 'Chromosome ', 'color_first_description' => 'black', 'second_description' => $s->accession, 'color_second_description' => 'cyan' ) ); $panel1->add_track( array( 'type' => 'text', 'color' => 'blue', 'text' => 'Just one refseq for the BioPHP group ;-)', 'position' =>'left' ) ); if (isset($s->features[mRNA])) { foreach($s->features[mRNA] as $mrna) { $panel1->add_track( array( 'type' => 'mRNA', 'location' => $mrna[location], 'location_color' => green, 'location_link' => FALSE, 'accession' => $mrna[acc], 'accession_color' => 'cyan', 'accession_link' => FALSE, 'strand' => $mrna[strand], 'spidey' => TRUE ) ); } } $panel1->gd(TMP_DIR . "PAK1.png"); ?>