Enum Class SamFlagField

java.lang.Object
java.lang.Enum<SamFlagField>
htsjdk.samtools.SamFlagField
All Implemented Interfaces:
Serializable, Comparable<SamFlagField>, Constable

public enum SamFlagField extends Enum<SamFlagField>
This determines how flag fields are represented in the SAM file. In a string FLAG, each character represents one bit with p=0x1 (paired), P=0x2 (properly paired), u=0x4 (unmapped), U=0x8 (mate unmapped), r=0x10 (reverse), R=0x20 (mate reverse) 1=0x40 (first), 2=0x80 (second), s=0x100 (not primary), x=0x200 (failure), d=0x400 (duplicate), and S=0x800 (secondary). This was inspired by 'samtools view -X'. We also output a character when the following bits *are not* set: m=0x4 (mapped), M=0x8 (mate mapped), f=0x10 (forward), F=0x20 (mate forward).
  • Enum Constant Details

  • Method Details

    • values

      public static SamFlagField[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SamFlagField valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • format

      public abstract String format(int flag)
      Returns the string associated with this flag field.
    • parse

      public final int parse(String flag)
      Parses the flag. Validates that the flag is of the correct type.
    • parseDefault

      public static int parseDefault(String flag)
      Infers the format from the flag string and parses the flag.
    • parseWithoutValidation

      protected abstract int parseWithoutValidation(String flag)
      Performs the actual parsing based on the radix. No validation that the flag is of the correct radix should be performed.
    • of

      public static SamFlagField of(String s)
      Returns the type of flag field for this string. This does not guarantee it is of the flag field, as it only checks the first two characters.