AbundanceReportGenerator
class AbundanceReportGenerator extends AnnotationReportGenerator
Traits
Properties
Collection | $options | Options for this report. |
from ReportGenerator |
string | $name | Name of the report for use in text. |
|
string | $filename | Name of the report for use as (part of) a filename. |
|
string | $extension | File extension of the report file. |
|
protected mixed | $source | Source this report belongs to (e.g. a volume). |
from ReportGenerator |
protected array | $tmpFiles | Temporary files that are created when generating a report. |
from ReportGenerator |
protected Collection|null | $labels | Cache for labels of all label trees that are used for this report. |
from ReportGenerator |
protected AnnotationSession|null | $annotationSession | Cache for the annotation session the report may be restricted to. |
from VolumeReportGenerator |
protected PythonScriptRunner | $pythonScriptRunner | Object that runs the Python script to generate a report. |
from VolumeReportGenerator |
Methods
Get the report generator for the given type.
Generate the report.
Constructs a label name from the names of all parent labels and the label itself.
Get all labels that belong to the label tree of the given label.
Should this report separate the output files for different label trees?
Should this report separate the output files for different user?
Returns the array of label ids to which this report should be restricted.
Determines if this report is restricted to a subset of labels.
Set the Python script runner object.
Get all labels that are attached to the volume of this report (through project label trees).
Execute the external report parsing Python script.
Should this report be restricted an annotation session?
Returns the annotation session this report should be restricted to.
Get the name of the annotation session if it exists.
Determines if this report should take only the newest label of each annotation.
Callback to be used in a when
query statement that restricts the results to a specific subset of annotation labels.
Callback to be used in a when
query statement that restricts the resulting annotations to the export area of the reansect of this report (if there is any).
Should this report be restricted to the export area?
Returns the annotation IDs to skip as outside of the volume export area.
Callback to be used in a when
query statement that restricts the results to the
newest annotation labels of each annotation.
Callback to be used in a when
query statement that restricts the resulting annotation labels to the annotation session of this report.
Assembles the part of the DB query that is the same for all annotation reports.
Determines if this report should aggregate child labels.
Assemble a new DB query for the volume of this report.
Create a CSV file for a single sheet of the spreadsheet of this report.
Aggregate the number of child labels to the number of the highest parent label and remove the child labels from the list.
Details
in
ReportGenerator at line 75
static ReportGenerator
get(string $sourceClass, ReportType $type, array $options = [])
Get the report generator for the given type.
in
VolumeReportGenerator at line 31
__construct(array $options = [])
Create a report generator instance.
in
ReportGenerator at line 116
string
generate(mixed $source)
Generate the report.
at line 39
generateReport(string $path)
Generate the report.
in
ReportGenerator at line 163
setSource(mixed $source)
Set the source.
in
AnnotationReportGenerator at line 20
string
getName()
Get the report name.
in
AnnotationReportGenerator at line 51
string
getFilename()
Get the filename.
in
ReportGenerator at line 193
string
getFullFilename()
Get the filename with extension.
in
VolumeReportGenerator at line 55
string
expandLabelName(int $id)
Constructs a label name from the names of all parent labels and the label itself.
Example: Animalia > Annelida > Polychaeta > Buskiella sp
in
ReportGenerator at line 237
protected Collection
getSiblingLabels(int $id)
Get all labels that belong to the label tree of the given label.
in
ReportGenerator at line 253
protected bool
shouldSeparateLabelTrees()
Should this report separate the output files for different label trees?
in
ReportGenerator at line 263
protected bool
shouldSeparateUsers()
Should this report separate the output files for different user?
in
ReportGenerator at line 273
protected array
getOnlyLabels()
Returns the array of label ids to which this report should be restricted.
in
ReportGenerator at line 283
protected bool
isRestrictedToLabels()
Determines if this report is restricted to a subset of labels.
in
VolumeReportGenerator at line 42
setPythonScriptRunner(mixed $runner)
Set the Python script runner object.
in
VolumeReportGenerator at line 71
protected Collection
getVolumeLabels()
Get all labels that are attached to the volume of this report (through project label trees).
in
VolumeReportGenerator at line 93
protected
executeScript(string $scriptName, string $path)
Execute the external report parsing Python script.
in
VolumeReportGenerator at line 103
protected bool
isRestrictedToAnnotationSession()
Should this report be restricted an annotation session?
in
VolumeReportGenerator at line 113
protected AnnotationSession|null
getAnnotationSession()
Returns the annotation session this report should be restricted to.
in
VolumeReportGenerator at line 127
protected string
getAnnotationSessionName()
Get the name of the annotation session if it exists.
in
VolumeReportGenerator at line 139
protected bool
isRestrictedToNewestLabel()
Determines if this report should take only the newest label of each annotation.
in
VolumeReportGenerator at line 151
protected Builder
restrictToLabelsQuery(Builder $query, string $table)
Callback to be used in a when
query statement that restricts the results to a specific subset of annotation labels.
in
RestrictsToExportArea at line 15
Builder
restrictToExportAreaQuery(Builder $query)
Callback to be used in a when
query statement that restricts the resulting annotations to the export area of the reansect of this report (if there is any).
in
RestrictsToExportArea at line 25
protected bool
isRestrictedToExportArea()
Should this report be restricted to the export area?
in
RestrictsToExportArea at line 38
protected array
getSkipIds()
Returns the annotation IDs to skip as outside of the volume export area.
We collect the IDs to skip rather than the IDs to include since there are probably fewer annotations outside of the export area.
in
RestrictsToNewestLabels at line 16
Builder
restrictToNewestLabelQuery($query, Volume $volume)
Callback to be used in a when
query statement that restricts the results to the
newest annotation labels of each annotation.
in
AnnotationReportGenerator at line 83
Builder
restrictToAnnotationSessionQuery(Builder $query)
Callback to be used in a when
query statement that restricts the resulting annotation labels to the annotation session of this report.
in
AnnotationReportGenerator at line 106
Builder
initQuery(mixed $columns = [])
Assembles the part of the DB query that is the same for all annotation reports.
in
AnnotationReportGenerator at line 133
protected bool
shouldAggregateChildLabels()
Determines if this report should aggregate child labels.
at line 76
protected Builder
query()
Assemble a new DB query for the volume of this report.
at line 103
protected CsvFile
createCsv(Collection $rows, string $title, Collection $labels)
Create a CSV file for a single sheet of the spreadsheet of this report.
at line 150
protected array
aggregateChildLabels(Collection $rows, Collection $labels)
Aggregate the number of child labels to the number of the highest parent label and remove the child labels from the list.