# File

## Overview

File data model hosts information about any file.

### Summary

| Field            |                                         Create                                        |                                         Update                                        |                                         Unique                                        |                                        Required                                       |
| ---------------- | :-----------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------: |
| id               | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |
| uuid             |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| name             | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| type             | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| format           | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| bioformat        | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| checksum         | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| uri              | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| path             | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| release          | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| creationDate     | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| modificationDate | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| description      | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| external         | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| size             | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| software         | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| experiment       | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| sampleIds        | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| jobId            | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| tags             | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| relatedFiles     | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| qualityControl   | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| stats            | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| status           | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| internal         | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |
| attributes       | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) | ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/yes.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |  ![](https://github.com/opencb/opencga/blob/develop/docs/data-models/no.png?raw=true) |

## Data Model

### File

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/File.java).

| Field                                                                                                                                                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>id</strong><br><em>String</em><br></p>                                                                                                                           | Object ID is a mandatory parameter when creating a new one, this ID cannot be changed at the moment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>uuid</strong><br><em>String</em><br></p>                                                                                                                         | Unique 32-character identifier assigned automatically by OpenCGA.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| <p><strong>name</strong><br><em>String</em><br></p>                                                                                                                         | The name of the file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>type</strong><br><em>Type</em><br></p>                                                                                                                           | The type can have the values FILE or DIRECTORY.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>format</strong><br><em>Format</em><br></p>                                                                                                                       | The format can have the values VCF, BCF, GVCF, TBI, BIGWIG, SAM, BAM, BAI, CRAM, CRAI, FASTQ, FASTA, PED, TAB\_SEPARATED\_VALUES, COMMA\_SEPARATED\_VALUES, XML, PROTOCOL\_BUFFER, JSON, AVRO, PARQUET, IMAGE, PLAIN, BINARY, NONE and UNKNOWN.                                                                                                                                                                                                                                                                                                                        |
| <p><strong>bioformat</strong><br><em>Bioformat</em><br></p>                                                                                                                 | The bioformat can have the values MICROARRAY\_EXPRESSION\_ONECHANNEL\_AGILENT, MICROARRAY\_EXPRESSION\_ONECHANNEL\_AFFYMETRIX, MICROARRAY\_EXPRESSION\_ONECHANNEL\_GENEPIX, MICROARRAY\_EXPRESSION\_TWOCHANNELS\_AGILENT, MICROARRAY\_EXPRESSION\_TWOCHANNELS\_GENEPIX, DATAMATRIX\_EXPRESSION, IDLIST, IDLIST\_RANKED, ANNOTATION\_GENEVSANNOTATION, OTHER\_NEWICK, OTHER\_BLAST, OTHER\_INTERACTION, OTHER\_GENOTYPE, OTHER\_PLINK, OTHER\_VCF, OTHER\_PED, @Deprecated VCF4, VARIANT, ALIGNMENT, COVERAGE, SEQUENCE, PEDIGREE, REFERENCE\_GENOME, NONE and UNKNOWN. |
| <p><strong>checksum</strong><br><em>String</em><br></p>                                                                                                                     | The checksum of the file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| <p><strong>uri</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#uri"><em>URI</em></a><br></p>                                                          | The uri of the file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>path</strong><br><em>String</em><br></p>                                                                                                                         | The path of the file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>release</strong><br><em>int</em><br></p>                                                                                                                         | An integer describing the current data release.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>creationDate</strong><br><em>String</em><br></p>                                                                                                                 | Autogenerated date following the format YYYYMMDDhhmmss containing the date when the entry was first registered.                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>modificationDate</strong><br><em>String</em><br><br><em>since</em>: 1.0</p>                                                                                      | Autogenerated date following the format YYYYMMDDhhmmss containing the date when the entry was last modified.                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><strong>description</strong><br><em>String</em><br></p>                                                                                                                  | Users may provide a description for the entry.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><strong>external</strong><br><em>boolean</em><br></p>                                                                                                                    | Indicates the file is external or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| <p><strong>size</strong><br><em>long</em><br></p>                                                                                                                           | The size of the file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>software</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#software"><em>Software</em></a><br></p>                                           | Software related with file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| <p><strong>experiment</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#fileexperiment"><em>FileExperiment</em></a><br></p>                             | File experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| <p><strong>sampleIds</strong><br><em>List\<String></em><br></p>                                                                                                             | List of sample ids of the file.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| <p><strong>jobId</strong><br><em>String</em><br></p>                                                                                                                        | File job id.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| <p><strong>tags</strong><br><em>List\<String></em><br></p>                                                                                                                  | File tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <p><strong>relatedFiles</strong><br><em>List<</em><a href="https://docs.opencga.opencb.org/data-models/file#filerelatedfile"><em>FileRelatedFile</em></a><em>></em><br></p> | List of objects FileRelatedFiles describing related files.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| <p><strong>qualityControl</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#filequalitycontrol"><em>FileQualityControl</em></a><br></p>                 | Contains different metrics to evaluate the quality of the individual.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><del><strong>stats</strong></del><br><em>Map\<String,Object></em><br><br><em>Deprecated</em></p>                                                                         | Stats of the object.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| <p><strong>status</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#status"><em>Status</em></a><br></p>                                                 | Object to set a custom status.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| <p><strong>internal</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#fileinternal"><em>FileInternal</em></a><br></p>                                   | Internal field for manage the object.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| <p><strong>attributes</strong><br><em>Map\<String,Object></em><br></p>                                                                                                      | You can use this field to store any other information, keep in mind this is not indexed so you cannot search by attributes.                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### FileExperiment

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/FileExperiment.java).

### FileRelatedFile

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/FileRelatedFile.java).

### Software

You can find the Java code [here](https://github.com/opencb/biodata/tree/develop/biodata-models/src/main/java/org/opencb/biodata/models/clinical/interpretation/Software.java).

| Field                                                              | Description         |
| ------------------------------------------------------------------ | ------------------- |
| <p><strong>name</strong><br><em>String</em><br></p>                | Software name       |
| <p><strong>version</strong><br><em>String</em><br></p>             | Software version    |
| <p><strong>repository</strong><br><em>String</em><br></p>          | Software repository |
| <p><strong>commit</strong><br><em>String</em><br></p>              | Software commit     |
| <p><strong>website</strong><br><em>String</em><br></p>             | Software website    |
| <p><strong>params</strong><br><em>Map\<String,String></em><br></p> | Software params     |

### Status

You can find the Java code [here](https://github.com/opencb/biodata/tree/develop/biodata-models/src/main/java/org/opencb/biodata/models/common/Status.java).

### URI

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/java/net/URI.java).

### FileInternal

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/FileInternal.java).

| Field                                                                                                                                                        | Description                                                                                                                       |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>status</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#filestatus"><em>FileStatus</em></a><br></p>                          | File status can have the values READY, DELETED, TRASHED, STAGE, MISSING, PENDING\_DELETE, DELETING, REMOVED and MISSING\_SAMPLES. |
| <p><strong>variant</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#fileinternalvariant"><em>FileInternalVariant</em></a><br></p>       | File internal variant.                                                                                                            |
| <p><strong>alignment</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#fileinternalalignment"><em>FileInternalAlignment</em></a><br></p> | File internal alignment.                                                                                                          |
| <p><strong>sampleMap</strong><br><em>Map\<String,String></em><br></p>                                                                                        | Map of samples.                                                                                                                   |
| <p><strong>missingSamples</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#missingsamples"><em>MissingSamples</em></a><br></p>          | Object describes missing samples.                                                                                                 |
| <p><strong>status</strong><br><a href="https://docs.opencga.opencb.org/data-models/file#internalstatus"><em>InternalStatus</em></a><br></p>                  | Status of the internal object.                                                                                                    |
| <p><strong>registrationDate</strong><br><em>String</em><br></p>                                                                                              | Registration date of the internal object.                                                                                         |
| <p><strong>lastModified</strong><br><em>String</em><br></p>                                                                                                  | Date of the last modification of the internal object.                                                                             |

### FileQualityControl

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/FileQualityControl.java).

### MissingSamples

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/MissingSamples.java).

| Field                                                             | Description                   |
| ----------------------------------------------------------------- | ----------------------------- |
| <p><strong>existing</strong><br><em>List\<String></em><br></p>    | List of existing samples.     |
| <p><strong>nonExisting</strong><br><em>List\<String></em><br></p> | List of non existing samples. |

### FileStatus

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/FileStatus.java).

### FileInternalAlignment

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/FileInternalAlignment.java).

### InternalStatus

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/common/InternalStatus.java).

### FileInternalVariant

You can find the Java code [here](https://github.com/opencb/opencga/tree/TASK-1587/opencga-core/src/main/java/org/opencb/opencga/core/models/file/FileInternalVariant.java).
