Package htsjdk.samtools
Enum SamFlagField
- java.lang.Object
-
- java.lang.Enum<SamFlagField>
-
- htsjdk.samtools.SamFlagField
-
- All Implemented Interfaces:
Serializable
,Comparable<SamFlagField>
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 Summary
Enum Constants Enum Constant Description DECIMAL
HEXADECIMAL
NONE
OCTAL
STRING
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
format(int flag)
Returns the string associated with this flag field.static SamFlagField
of(String s)
Returns the type of flag field for this string.int
parse(String flag)
Parses the flag.static int
parseDefault(String flag)
Infers the format from the flag string and parses the flag.protected abstract int
parseWithoutValidation(String flag)
Performs the actual parsing based on the radix.static SamFlagField
valueOf(String name)
Returns the enum constant of this type with the specified name.static SamFlagField[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final SamFlagField NONE
-
DECIMAL
public static final SamFlagField DECIMAL
-
HEXADECIMAL
public static final SamFlagField HEXADECIMAL
-
OCTAL
public static final SamFlagField OCTAL
-
STRING
public static final SamFlagField STRING
-
-
Method Detail
-
values
public static SamFlagField[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SamFlagField c : SamFlagField.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SamFlagField valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- 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.
-
-