'; verGetPost(array("contig", "start", "end")); $fcontig="Fasta/Contigs/Contig".$contig; if ($start > $end) $reverse= 1; if ( !(is_readable($fcontig)) ) $genopar->error("

N�o foi poss�vel ler contig do arquivo: $fcontig"); $file = fopen($fcontig, 'r'); $line = fgets($file, 4096); #Eliminar primeira linha $SEQ=''; for ($linha= 1; !feof($file); $linhas++){ $line = fgets($file, 4096); $SEQ.= trim($line); } $seq= substr($SEQ,$start-1,$end-$start+1); if ($reverse) { $size = $start-$end+1; $array = str_split(substr($SEQ, 0, $size)); $array = array_reverse($array); $seq = ''; foreach ($array as $nt){ $seq .= complement($nt); } } $seqn=""; $cols = 50; $rows = 5; for($i=0;$i$seqn"; exit(); } $genopar = new Genopar(__FILE__); $genopar->abrePagina("Busca de ORFs"); $mtgs = obtemMtgs($genopar); echo ' '; $genopar->abreBanco(); echo '
'; echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; #monta tabela de Status $genopar->queryBanco("SELECT * FROM validation WHERE code<99"); while ($lin= $genopar->getArray()) $statusList[$lin['code']]= $lin['status']; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ''; echo ''; echo ''; echo '
Busca de ORF
"; echo "Assembly: "; echo ""; $genopar->select("mtg", $mtgs, $mtg,"", TRUE); echo "
Status:  ";$genopar->select("status", $statusList, $status, "", TRUE);echo"
ID: 
Gene name: 
Function: 
Product: 
EC Number: 
COG Number: 
Notes: 
Comments (report): 
Annotator: 
Reviewer: 
'; echo "

"; echo '

'; // echo 'Annotation Status'; echo '

'; echo "

"; // if (!$mtg) $genopar->fechaPagina(); ########################################################## if ($processa == "Pesquisar ORF") { $genopar->queryBanco("SELECT * FROM validation"); $STATUS=array(); while ($lin= $genopar->getArray()) $STATUS[$lin['status']]= $lin['code']; $STATUS[99]= 'Updated'; if ($mtg != '') $whereMtg = "WHERE a.idMontagem='$mtg'"; $where = array(); if ($id!='') $where[] = "a.id='$id'"; if ($status!='') $where[] = "a.validation=".$STATUS[$status]; if ($gene_name!='') $where[] = "(a.orfName like '%$gene_name%' OR a.synonym like '%$gene_name%')"; if ($function!='') $where[] = "a.function like '%$function%'"; if ($product!='') $where[] = "a.product like '%$product%'"; if ($ec) $where[] = "(a.EC_number='$ec' OR a.EC_number2='$ec')"; if ($cog) $where[] = "a.COGnumber like '%$cog%'"; if ($notes!='') $where[] = "a.note like '%$notes%'"; if ($report!='') $where[] = "a.relatorio like '%$report%'"; if ($anotador!='') $where[] = "a.anotador like '%$anotador%'"; if ($reviewer!='') $where[] = "a.revisor like '%$reviewer%'"; $where = implode(' AND ', $where); if ($whereMtg && $where) $where = $whereMtg." AND ".$where.""; elseif ($whereMtg) $where = $whereMtg; elseif ($where) $where = "WHERE ".$where; // if (!$where) $genopar->fechaPagina(); $query= "SELECT a.*, v.status FROM anotacao a JOIN validation v ON v.code=a.validation $where order by id"; // echo $query;exit; $n= $genopar->queryBanco($query); if ($n > 0) { echo "
$n ORFs encontradas."; echo ''; echo ''; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ''; $num=0; while ($lin=$genopar->getArray()) { $orf= $lin["id"]; echo ''; echo ""; echo ""; echo ""; echo ""; // echo ""; echo ""; echo ""; echo ""; echo ""; // echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ''; } echo '
#ORFMontagemGeneStatusCOG#FunctionProductEC#NoteComments (report)AnnotatorReviewer
".number_format(++$num,0,",",".")."$orf".$lin['idMontagem']."".$lin['orfName']." ".$lin['synonym']." ".$lin['status']." ".$lin['COGnumber']." ".$lin['function']." ".$lin['product']." ".$lin['category1']."
".$lin['category2']." 
".$lin['EC_number']."
".$lin['EC_number2']." 
".$lin['note']." ".$lin['relatorio']." ".$lin['anotador']." ".$lin['revisor']." 
'; } else { echo "
Nenhuma ORF encontrada."; } } $genopar->fechaPagina(); ######### FUNCOES function obtemMtgs($genopar){ $mtgs = array(); $genopar->abreBanco(); $q = "SELECT DISTINCT idMontagem FROM contig"; $n = $genopar->queryBanco($q); if($n > 0) while($res = $genopar->getArray()){ array_push($mtgs, $res['idMontagem']); } $genopar->fechaBanco(); return $mtgs; } function complement($nt){ switch ($nt){ case 'A': case 'a': return 'T'; case 'T'; case 't': return 'A'; case 'C': case 'c': return 'G'; case 'G': case 'g': return 'C'; } return $nt; } ?>