예제 #1
0
파일: Weights.java 프로젝트: wmaier/uparse
 private void increment(List<String> features, int transition, float delta) {
   for (String feat : features) {
     if (!data.containsKey(feat)) {
       data.put(feat, new FeatureWeights());
     }
     data.get(feat).increment(transition, delta, i);
   }
 }
 static {
   // Same comments as for walkers
   deprecatedGATKAnnotations.put("DepthOfCoverage", "2.4 (renamed to Coverage)");
 }
 static {
   // Indicate recommended replacement in parentheses if applicable
   deprecatedGATKWalkers.put(
       "ReduceReads", "3.0 (use recommended best practices pipeline with the HaplotypeCaller)");
   deprecatedGATKWalkers.put(
       "CountCovariates", "2.0 (use BaseRecalibrator instead; see documentation for usage)");
   deprecatedGATKWalkers.put(
       "TableRecalibration",
       "2.0 (use PrintReads with -BQSR instead; see documentation for usage)");
   deprecatedGATKWalkers.put("AlignmentWalker", "2.2 (no replacement)");
   deprecatedGATKWalkers.put("CountBestAlignments", "2.2 (no replacement)");
   deprecatedGATKWalkers.put(
       "SomaticIndelDetector", "2.0 (replaced by MuTect2; see documentation for usage)");
   deprecatedGATKWalkers.put(
       "BeagleOutputToVCF",
       "3,4 (replaced by Beagle native functions; see Beagle 4 documentation at https://faculty.washington.edu/browning/beagle/beagle.html)");
   deprecatedGATKWalkers.put(
       "VariantsToBeagleUnphased",
       "3.4 (replaced by Beagle native functions; see Beagle 4 documentation at https://faculty.washington.edu/browning/beagle/beagle.html)");
   deprecatedGATKWalkers.put(
       "ProduceBeagleInput",
       "3.4 (replaced by Beagle native functions; see Beagle 4 documentation at https://faculty.washington.edu/browning/beagle/beagle.html)");
   deprecatedGATKWalkers.put(
       "ReadAdaptorTrimmer",
       "3.5 (this tool was unsound and untested -- no specific replacement, see Picard tools for alternatives)");
   deprecatedGATKWalkers.put(
       "BaseCoverageDistribution",
       "3.5 (use DiagnoseTargets instead; see documentation for usage)");
   deprecatedGATKWalkers.put(
       "CoveredByNSamplesSites", "3.5 (use DiagnoseTargets instead; see documentation for usage)");
   deprecatedGATKWalkers.put(
       "VariantValidationAssessor", "3.5 (this tool was unsound and untested -- no replacement)");
   deprecatedGATKWalkers.put(
       "LiftOverVariants", "3.5 (use Picard LiftoverVCF instead; see documentation for usage)");
   deprecatedGATKWalkers.put(
       "FilterLiftedVariants",
       "3.5 (use Picard LiftoverVCF instead; see documentation for usage)");
   deprecatedGATKWalkers.put(
       "ListAnnotations", "3.5 (this tool was impractical; see the online documentation instead)");
 }
예제 #4
0
  /**
   * Read the platform information from a GEO platform file.
   *
   * @param filename
   * @throws SyntaxErrorException
   * @throws IOException
   */
  public void read(final String filename) throws SyntaxErrorException, IOException {
    if (filename == null) {
      return;
    }
    final GeoPlatformFileReader reader = new GeoPlatformFileReader();
    final Reader lowLevelReader;
    if (filename.endsWith(".gz")) {
      lowLevelReader = new InputStreamReader(new GZIPInputStream(new FileInputStream(filename)));
    } else {
      lowLevelReader = new FileReader(filename);
    }

    final Table platformFileContent = reader.read(lowLevelReader);
    final Table.RowIterator ri = platformFileContent.firstRow();

    int probeSetIdColumnIndex = -1;
    int genbankAcColumnIndex = -1;
    int genbankListColumnIndex = -1;
    int genbankColumnIndex = -1;
    final String probeIdColumnName = "ID";
    final String genbankAcColumnName = "GB_ACC";
    final String genbankListColumnName = "GB_LIST";

    try {
      probeSetIdColumnIndex = platformFileContent.getColumnIndex(probeIdColumnName);
    } catch (InvalidColumnException e) {
      assert false;
    }
    try {
      genbankAcColumnIndex = platformFileContent.getColumnIndex(genbankAcColumnName);
    } catch (InvalidColumnException e) { // NOPMD
      // OK, see below.
    }
    try {
      genbankListColumnIndex = platformFileContent.getColumnIndex(genbankListColumnName);
    } catch (InvalidColumnException e) { // NOPMD
      // OK, see below.
    }

    genbankColumnIndex =
        (genbankListColumnIndex != -1 ? genbankListColumnIndex : genbankAcColumnIndex);
    if (probeSetIdColumnIndex == -1 || genbankColumnIndex == -1) {
      throw new SyntaxErrorException(
          0,
          "One of the following column names could not be found in the platformFileContent description file: "
              + probeIdColumnName
              + ", (at least one of : "
              + genbankAcColumnName
              + ", "
              + genbankListColumnName
              + " ).");
    }

    int count = 0;

    while (!ri.end()) {
      try {
        final String probesetId = (String) platformFileContent.getValue(probeSetIdColumnIndex, ri);
        final String genbankAccession =
            (String) platformFileContent.getValue(genbankColumnIndex, ri);
        probesetId2GenbankList.put(probesetId, genbankAccession);
        count++;
      } catch (TypeMismatchException e) {
        throw new InternalError("Column type does not match" + e.getMessage());
      } catch (InvalidColumnException e) {
        throw new InternalError("Should never happen");
      }
      ri.next();
    }
    this.count = count;
  }