Beispiel #1
0
void usage(void) {
    version();
    fprintf(stderr, "Usage: mafStrander --maf alignment.maf --seq hg18 --strand + > positive.maf \n\n"
            "mafStrander is a program to coerce a particular strandedness for all blocks\n"
            "based the strandedness of a target sequence. When a block contains the target sequence but\n"
            "in the flipped orientation (relative to the --strand option) then the block is flipped,\n"
            "i.e. all start coordinates are transformed, and all sequence fields are reverse-complemented.\n"
            "If the block contains the target sequence multiple times and with conflicing strands\n"
            "(i.e. both + and - strands are observed), then nothing is done.\n");
    fprintf(stderr, "Options: \n");
    usageMessage('h', "help", "show this help message and exit.");
    usageMessage('m', "maf", "input alignment maf file.");
    usageMessage('\0', "seq", "sequence to base block strandedness upon. (string comparison only done for length of input, i.e. --seq=hg18 will match hg18.chr1, hg18.chr2, etc etc)");
    usageMessage('\0', "strand", "strand to enforce, when possible. may be + or -, defaults to +.");
    exit(EXIT_FAILURE);
}
Beispiel #2
0
void usage(void) {
    version();
    fprintf(stderr, "Usage: mafPositionFinder --maf [path to maf] "
            "--seq [sequence name (and possibly chr)] "
            "--pos [position to search for, zero based coords] [options]\n\n"
            "mafPositionFinder is a program that will look through a maf file for a\n"
            "particular sequence name and location. If a match is found the line\n"
            "number and first few fields are returned. If no match is found\n"
            "nothing is returned.\n\n");
    fprintf(stderr, "Options: \n");
    usageMessage('h', "help", "show this help message and exit.");
    usageMessage('m', "maf", "path to maf file.");
    usageMessage('s', "seq", "sequence name, e.g. `hg18.chr2'.");
    usageMessage('p', "pos", "position along the chromosome you are searching for. "
                 "Must be a positive number.");
    usageMessage('v', "help", "turns on verbose output.");
    exit(EXIT_FAILURE);
}
void usage(void) {
    version();
    fprintf(stderr, "Usage: mafDuplicateFilter --maf mafWithDuplicates.maf > pruned.maf \n\n"
            "mafDuplicateFilter is a program to filter out duplications from a Multiple \n"
            "Alignment Format (maf) file. This program assumes the sequence name field is \n"
            "formatted as in \"speciesName.chromosomeName\" using the first period charater, \".\",\n"
            "as the delimiter between the species name and the chromosome name. For every \n"
            "block present in the alignment, mBDF looks for any duplicated species within the \n"
            "block. Instead of stripping out all copies of the duplication, the sequence with \n"
            "the highest similarity to the consensus of the block is left, all others are \n"
            "removed. Sequence similarity is computed as a bit score in comparison to the \n"
            "IUPAC-enabled consensus. Ties are resolved by picking the sequence that appears \n"
            "earliest in the file. \n\n");
    fprintf(stderr, "Options: \n");
    usageMessage('h', "help", "show this help message and exit.");
    usageMessage('m', "maf", "path to maf file.");
    usageMessage('v', "verbose", "turns on verbose output.");
    exit(EXIT_FAILURE);
}
void usage(void) {
  version();
  fprintf(stderr, "Usage: mafToFastaStitcher --maf mafFile.maf --seqs seq1.fa,seq2.fa[,...] --breakpointPenalty 5 --interstitialSequence 20 --outMfa output.mfa \n\n"
          "\n\n");
  fprintf(stderr, "Options: \n");
  usageMessage('h', "help", "show this message and exit.");
  usageMessage('m', "maf", "path to the maf file.");
  usageMessage('\0', "seqs", "comma separated list of fasta sequences. each fasta may contain multiple entries. all sequences in the input alignment must be accounted for with an element in a fasta.");
  usageMessage('\0', "outMfa", "multiple sequence fasta output file.");
  usageMessage('\0', "breakpointPenalty", "number of `N' characters to insert into a sequence when a breakpoint is detected.");
  usageMessage('\0', "interstitialSequence", "maximum length of interstitial sequence to be added (from a fasta) into the fasta before a breakpoint is declared and the <code>--breakpointPenalty</code> number of <code>N</code>'s is added instead.");
  usageMessage('\0', "outMaf", "multiple alignment format output file.");
  usageMessage('\0', "reference", "optional. The name of the reference sequence. All intervening reference sequence between the first and last block of the input --maf will be read out in the output.");
  usageMessage('v', "verbose", "turns on verbose output.");
  exit(EXIT_FAILURE);
}
Beispiel #5
0
int
main(int argc, char *argv[])
{
  pid_t pid;
  char log[128];
  unsigned int used_args;

  strcpy(log, "valgreen.log");

  cea::DebugLog::create(log);
  cea::DebugLog::clear();

  // Wattmeter
  cea::AcpiPowerMeter pm;
  cea::DebugLog::writeMsg(cea::DebugLog::INFO, "main()",
      "ACPI power meter created.");

  // Initial values
  double w[3] =
    { -1.13, 17.16, 32.60 };

  // Power estimator
  cea::DPELRCpuProcs pe(pm, w);
  cea::DebugLog::writeMsg(cea::DebugLog::INFO, "main()",
      "DPELRCpuProcs power estimator created.");

  used_args = 1;

  if ((argc == 1) || (!strcmp(argv[1], "--help")))
    {
      usageMessage();

      return 0;
    }

  if ((!strcmp(argv[1], "--calibrate")))
    {
      cea::DebugLog::writeMsg(cea::DebugLog::WARNING, "calibration process",
          "Please close all other applications during the calibration");
      cea::DebugLog::writeMsg(cea::DebugLog::WARNING, "calibration process",
          "The notebook must be kept unplugged during the entire calibration.");

      pthread_t thread;
      // Runs the benchmark in a new thread
      if (pthread_create(&thread, NULL, benchmark, NULL) == -1)
        {
          cea::DebugLog::writeMsg(cea::DebugLog::ERROR, "model calibration",
              "The benchmark execution thread could not be created.");
          exit(1);
        }
      pe.getLatency();
//      pe.collectData(400);
      pe.collectData(100);
      pe.calibrate();

      std::ofstream ofs("valgreen.cfg");
      ofs << pe;
      ofs.close();

      pthread_cancel(thread);

      return 0;
    }

  for (int i = 1; i < argc; i++)
    {
      if (!strncmp(argv[i], "--log-file=", LG_LOG_ARG))
        {
          strcpy(log, (argv[i] + LG_LOG_ARG));
          used_args++;
          std::cout << "log=" << log;
          cea::DebugLog::create(log);
          cea::DebugLog::clear();
        }
    }

  //read information stored into config file
  std::ifstream ifs("valgreen.cfg");
  if (ifs.good())
    {
      ifs >> pe;
    }
int main(int argc, char **argv)
{
    int size, rank;

    int threadProvided;

    char *queryFileName = 0;
    char *outFileName = 0;

    // command line to invoke the blast tool
    char **blastArgs;

    // malloc an arg array for the blast command
    // not all the slots will be used however
    blastArgs = malloc(sizeof(char*) * argc);
    if (blastArgs == NULL) fatal("malloc failed in main\n");

    // run through args and pull out the -query and -out args
    int i = 1;
    int j = 0;
    while (i < argc)
    {
      if (!strcmp(argv[i], "-query"))
      {
        queryFileName = argv[i+1];
        i += 2;
      }
      else if (!strcmp(argv[i], "-out"))
      {
        outFileName = argv[i+1];
        i += 2;
      }
      else
      {
        blastArgs[j] = argv[i];
        j += 1;
        i += 1;
      }
    }
    blastArgs[j] = NULL;

    // make sure that -query and -out were all given
    if (queryFileName == 0 || outFileName == 0) usageMessage();

    //initialize MPI
    MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &threadProvided);

    //get number of processors
    MPI_Comm_size(MPI_COMM_WORLD, &size);
  
    //get this process's rank
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  
    if(rank == SCHEDULER_PROCESS)
    {
        scheduler(queryFileName, size);
    }
    else if(rank == WRITER_PROCESS)
    {
        writer(outFileName);
    }
    else
        worker(rank, blastArgs);

    MPI_Barrier(MPI_COMM_WORLD);

    MPI_Finalize();

    return 0;
}
Beispiel #7
0
    void
AlignerOptions::usage()
{
    usageMessage();
    exit(1);
}