Exemplo n.º 1
0
void twinOrfStats(char *axtFile, char *raFile, char *outFile)
/* twinOrfStats - Collect stats on refSeq cDNAs aligned to another species via axtForEst. */
{
struct hash *rsiHash = readRefRa(raFile);
struct lineFile *lf = lineFileOpen(axtFile, TRUE);
FILE *f = mustOpen(outFile, "w");
struct axt *axt;
static struct countMatrix kozak[10], all, utr5, utr3, cds;
static struct c2Counts c2All, c2Utr5, c2Utr3, c2Cds;
char label[64];
char *predictFile = optionVal("predict", NULL);
int i;
struct codonCounts codons;

initCounts(&codons, 1);

threshold = optionFloat("threshold", threshold);
while ((axt = axtRead(lf)) != NULL)
    {
    struct refSeqInfo *rsi = hashFindVal(rsiHash, axt->tName);
    if (rsi != NULL && rsi->cdsStart >= 5)
        {
	if (checkAtg(axt, rsi->cdsStart))
	    {
	    for (i=0; i<10; ++i)
		addPos(&kozak[i], axt, rsi->cdsStart - 5 + i);
	    addRange(&all, &c2All, axt, 0, rsi->size);
	    addRange(&utr5, &c2Utr5, axt, 0, rsi->cdsStart);
	    addRange(&cds, &c2Cds, axt, rsi->cdsStart, rsi->cdsEnd);
	    addRange(&utr3, &c2Utr3, axt, rsi->cdsEnd, rsi->size);
	    addCodons(&codons, axt, rsi->cdsStart, rsi->cdsEnd-3);
	    }
	}
    axtFree(&axt);
    }
lineFileClose(&lf);
dumpCounts(f, &all, "all");
dumpCounts(f, &utr5, "utr5");
dumpCounts(f, &cds, "cds");
dumpCounts(f, &utr3, "utr3");
dumpM1(f, &c2All, "c2_all");
dumpM1(f, &c2Utr5, "c2_utr5");
dumpM1(f, &c2Cds, "c2_cds");
dumpM1(f, &c2Utr3, "c2_utr3");
for (i=0; i<10; ++i)
    {
    sprintf(label, "kozak[%d]", i-5);
    dumpCounts(f, &kozak[i], label);
    }
dumpCodon(f, &codons, "codon");
if (predictFile)
    {
    predict(kozak, &all, axtFile, predictFile, rsiHash);
    }
}
Exemplo n.º 2
0
int main(int argc, char *argv[])
{
  nf2.device_name = DEFAULT_IFACE;

  processArgs(argc, argv);

  // Open the interface if possible
  if (check_iface(&nf2))
    {
      exit(1);
    }
  if (openDescriptor(&nf2))
    {
      exit(1);
    }
  if(argc > 5){
      printf("Numero de argumentos deve ser < 4\n");
      argc=5;
  } 
  for(int i=0; i< argc-1; i++){
     pdrop[i] = atoi(argv[i+1]);
  }
  dumpCounts();

  closeDescriptor(&nf2);

  return 0;
}