public class GtfValidationAction extends SingleFileValidationAction
ArrayDesign
.
The validation uses the GtfInputStream
. The number of lines
to parse is configurable. If the entire file is parsed, it will
set the ArrayDesign.getNumFileFeatures()
value to the number
of unique transcript_id values found in the file.
Modifier and Type | Field and Description |
---|---|
private DbControl |
dc |
private ArrayDesign |
design |
private int |
linesToParse |
Constructor and Description |
---|
GtfValidationAction(DbControl dc,
ArrayDesign design,
int linesToParse)
Create a new action.
|
Modifier and Type | Method and Description |
---|---|
void |
resetMetadata()
Reset all metadata that this class normally can set.
|
void |
validateAndExtractMetadata()
Validate and extract metadata from the file(s) that has been added to
this validator.
|
acceptFile, getAcceptedFile
private final DbControl dc
private final ArrayDesign design
private final int linesToParse
public GtfValidationAction(DbControl dc, ArrayDesign design, int linesToParse)
dc
- An open DbControldesign
- The array design the GTF file is connected withlinesToParse
- The maximum number of lines to parse from the GTF file.
Use Integer.MAX_VALUE
to ensure that the entire file is parsed.
The lowest value is 10public void validateAndExtractMetadata() throws InvalidDataException, InvalidRelationException
ValidationAction
ValidationAction.acceptFile(FileSetMember)
method
returns Accept.VALIDATE_IMMEDIATELY
this method is called
and the validator should work on the last accepted file.
This method is also called after all files has been processed if at
least one file returned Accept.VALIDATE_LATER
.
This method is recommended to throw an InvalidDataException
or a
subclass if the file is not a valid file. PermissionDeniedException
:s
are ignored by the core and will not change the validation status. An
exception of type InvalidRelationException
can be thrown if the
file itself is valid, but a related file that it depends on is not. The
core will still mark the file as invalid and store the error message,
but extracted metadata will not be reset.
InvalidDataException
- If the validator detects an invalid
fileInvalidRelationException
- If the validator detects that the
file is valid but another file that it depends on is not, metadata
extract will still happenpublic void resetMetadata()
ValidationAction