示例#1
0
  /**
   * checks if the read has a platform tag in the readgroup equal to 'name'. Assumes that 'name' is
   * upper-cased.
   *
   * @param read the read to test
   * @param name the upper-cased platform name to test
   * @return whether or not name == PL tag in the read group of read
   */
  public static boolean isPlatformRead(SAMRecord read, String name) {

    SAMReadGroupRecord readGroup = read.getReadGroup();
    if (readGroup != null) {
      Object readPlatformAttr = readGroup.getAttribute("PL");
      if (readPlatformAttr != null) return readPlatformAttr.toString().toUpperCase().contains(name);
    }
    return false;
  }