Class DynamicSMILESFileFormat
java.lang.Object
de.unijena.cheminf.deglycosylation.tools.DynamicSMILESFileFormat
Data wrapper for defining the outline of a SMILES file or CSV file containing SMILES codes.
- Version:
- 1.0.0.0
- Author:
- Jonas Schaub
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default SMILES column position for files with only one column.static final int
Placeholder ID column position for files without an ID column.static final Character
Placeholder separator char for files that have only one column. -
Constructor Summary
ConstructorsConstructorDescriptionDynamicSMILESFileFormat
(boolean aHasHeaderLine) Defines the format as a file that has only one column of SMILES codes and nothing else, so no ID column and no separator character.DynamicSMILESFileFormat
(boolean aHasHeaderLine, Character aSeparatorChar, int aSMILESCodeColumnPosition, int anIDColumnPosition) Defines the format as a file that has at least two columns, defines the character that separates the columns, the position of the SMILES code column and the ID/name column, and whether the first line in the file is a header or contains a valid SMILES code as well. -
Method Summary
Modifier and TypeMethodDescriptionint
Position of the ID/name column in the file.Character that separates the columns.int
Position of the SMILES column in the file.boolean
Whether the first line in the file is a header or contains a valid SMILES code as well.boolean
Whether the file has an additional column containing names/IDs of the structures.
-
Field Details
-
PLACEHOLDER_SEPARATOR_CHAR
Placeholder separator char for files that have only one column. -
PLACEHOLDER_ID_COLUMN_POSITION
public static final int PLACEHOLDER_ID_COLUMN_POSITIONPlaceholder ID column position for files without an ID column.- See Also:
-
DEFAULT_SMILES_COLUMN_POSITION
public static final int DEFAULT_SMILES_COLUMN_POSITIONDefault SMILES column position for files with only one column.- See Also:
-
-
Constructor Details
-
DynamicSMILESFileFormat
public DynamicSMILESFileFormat(boolean aHasHeaderLine) Defines the format as a file that has only one column of SMILES codes and nothing else, so no ID column and no separator character. All other fields will be set to their placeholder values.- Parameters:
aHasHeaderLine
- whether the first line in the file is a header or contains a valid SMILES code as well
-
DynamicSMILESFileFormat
public DynamicSMILESFileFormat(boolean aHasHeaderLine, Character aSeparatorChar, int aSMILESCodeColumnPosition, int anIDColumnPosition) Defines the format as a file that has at least two columns, defines the character that separates the columns, the position of the SMILES code column and the ID/name column, and whether the first line in the file is a header or contains a valid SMILES code as well.
No parameter checks to keep this data container flexible and be able to use the placeholder values here as well, so be careful!- Parameters:
aHasHeaderLine
- whether the first line in the file is a header or contains a valid SMILES code as wellaSeparatorChar
- character that separates the columnsaSMILESCodeColumnPosition
- position of the SMILES code columnanIDColumnPosition
- position of the ID/name column
-
-
Method Details
-
hasHeaderLine
public boolean hasHeaderLine()Whether the first line in the file is a header or contains a valid SMILES code as well.- Returns:
- whether the first line of the file should be parsed as well or skipped
-
getSeparatorChar
Character that separates the columns. If the file has only one column, this field will be set to its placeholder value (check whether the file has an ID/name column).- Returns:
- character separating the columns
-
getSMILESCodeColumnPosition
public int getSMILESCodeColumnPosition()Position of the SMILES column in the file.- Returns:
- position of SMILES column
-
hasIDColumn
public boolean hasIDColumn()Whether the file has an additional column containing names/IDs of the structures. If false, it can be assumed that the files has only one column, the SMILES column. The separator character and the ID column position will be set to their placeholder values.- Returns:
- whether the file has an additional column containing names/IDs of the structures
-
getIDColumnPosition
public int getIDColumnPosition()Position of the ID/name column in the file. If the file has only one column, this field will be set to its placeholder value (check whether the file has an ID/name column).- Returns:
- position of ID/name column
-