{"__v":31,"_id":"573b02e67f35072900c8535f","category":{"__v":0,"_id":"5735936aafab441700723a54","project":"5735936aafab441700723a50","version":"5735936aafab441700723a53","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-13T08:42:18.644Z","from_sync":false,"order":0,"slug":"documentation","title":"Get Started"},"parentDoc":null,"project":"5735936aafab441700723a50","user":"573592b84b0ab120000b7d44","version":{"__v":12,"_id":"5735936aafab441700723a53","project":"5735936aafab441700723a50","createdAt":"2016-05-13T08:42:18.615Z","releaseDate":"2016-05-13T08:42:18.615Z","categories":["5735936aafab441700723a54","5735a32931a73b1700887c94","5735b55beceb872200abbc6c","5735b56eb667601700d3bd6f","5735b9ba4b0ab120000b7dd4","5735b9c94b0ab120000b7dd5","5735cb131f16241700c8a0f7","5735e5c4e4824c3400aa1f21","5735e5d9e4824c3400aa1f23","5735e5f2ec67f6290013ac72","573ecfe0804f901700a9dfc7","573f276c7eeb8b190094ca7d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-17T11:39:18.524Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Easy import approaches [Ensembl](http://ensembl.org) data import from a file-based perspective, beginning with sequences and gff and optionally loading additional data directly from program output files.\n\n## Configuration\nAll parameters for both [easy mirror](https://github.com/lepbase/easy-mirror) and [easy import](https://github.com/lepbase/easy-import) are set and passed to scripts through ``.ini`` files.  The configuration file format mirrors the use of ``.ini`` files in [ensembl-webcode](https://github.com/Ensembl/ensembl-webcode), which has the benefit that a user who sets up an [Ensembl](http://ensembl.org) instance using [easy import](https://github.com/lepbase/easy-import) will gain familiarity with the syntax conventions needed to further customise the instance. Use of configuration files rather than command line parameters also improves reproducibility since all parameters must be saved for the pipeline to be run.\n\n## Server setup\nSetting up an [Ensembl](http://ensembl.org) server to host locally imported data is essentially the same as setting up a mirror site (with just a couple of changes to config files) so the server setup and hosting steps simply reuse [easy mirror](https://github.com/lepbase/easy-mirror).\n\n## Core import\nThe challenge for a file-based approach to data import is dealing with the fragmentation of the ``.gff`` format and the diverse ways that names, ids and descriptions can be captured both in ``.gff`` attributes and across a range of other file types.  Most of the effort in designing [easy import](https://github.com/lepbase/easy-import) has been in creating a mechanism to allow gene models and annotations to be extracted from diverse, potentially \"broken\" files while maintaining a full and clear record of the import procedure to ensure full reproducibility. \n\nOne drawback to this approach is that separate configuration files are required for conceptually separate parts of the pipeline. This means that database connection data are repeated across multiple ``.ini`` files so care must be taken to use the correct template when making changes to the default settings.\n\n### Database creation\nConsistency with the latest [Ensembl](http://ensembl.org) database schema is ensured by importing the database schema for each new core database from the [ensembl](https://github.com/Ensembl/ensembl) ``table.sql`` file and using an existing database with the same schema version as a template with the [ensembl-production](https://github.com/Ensembl/ensembl-production) ``populate_production_db_tables.pl`` script.\n\n### Sequence data import\nScaffold/contig data will almost always be available as ``.fasta`` format (or possibly ``.fasta`` plus ``.agp``).  This is also the starting point for the [Ensembl](http://ensembl.org) import pipeline so sequence import uses scripts directly from [ensembl-pipeline](https://github.com/Ensembl/ensembl-pipeline).\n\n### Summary statistics\nBasic summary statistics can be calculated at the beginning of the core import.  A summary of ``.gff`` attribute counts by feature type is particularly useful in determining which fields may contain IDs, descriptions, etc. and whether any discrepancies in the counts of each attribute suggest that the ``.gff`` needs to be repaired by the [gff parser](https://github.com/rjchallis/gff_parser).\n\n### Parsing and repairing GFF\nOur flexible [gff parser](https://github.com/rjchallis/gff_parser) lies at the heart of [easy import](https://github.com/lepbase/easy-import).  It has been designed to embrace the diversity of real world ``.gff`` files by allowing full customisation of expected relationships and properties with functions to repair, warn or ignore errors during validation.  [gff parser](https://github.com/rjchallis/gff_parser) is a perl module that provides a mechanism to assign expectations and validation rules to specific ``.gff`` feature types while having very little hard-coded awareness of any official [gff specification](http://www.sequenceontology.org/gff3.shtml) allowing the flexibility to handle many more edge cases than other parsers.  For [easy import](https://github.com/lepbase/easy-import), a subset of the full functionality can be controlled through a meta-syntax in the core import ``.ini`` files and while the [gff parser](https://github.com/rjchallis/gff_parser) can accommodate most forms of ``.gff``, including ``.gtf``, [easy import](https://github.com/lepbase/easy-import) requires a ``.gff3`` compatible format in column nine. This approach initially adds some complexity to the parameter specification, but many patterns can be reused across most ``.gff3`` files and the benefit is that all modifications to the ``.gff3`` can be preserved in the ``.ini`` file.\n\n### Gene model import\nWhile the [gff parser](https://github.com/rjchallis/gff_parser) takes care of standardising ``.gff``, additional functionality in [easy import](https://github.com/lepbase/easy-import) allows for retrieval of gene IDs, synonyms and descriptions from ``.gff`` attributes as well as from ``.fasta`` headers and simple text files.  For a community resource like [Lepbase](http://lepbase.org), this provides the flexibility to easily incorporate information from diverse sources as supplied by individual labs rather than demanding a standardised format, which could act as a deterrent to full data sharing. For others implementing this pipeline, it offers the flexibility to integrate with existing protocols without the need to reformat data prior to import.\n\n### Import verification\nIn our experience, most problems with data import from ``.gff`` files can be detected through comparison of provider protein sequences with translations exported from an [Ensembl](http://ensembl.org) database.  [easy import](https://github.com/lepbase/easy-import) checks that the same IDs are present in each of these sets, and that the sequence lengths are identical.  The most common causes of differences are alternate interpretations of phase ([0,1,2] vs. [0,2,1]), and manual editing of the provided sequences file to terminate translations at the first stop codon.\n\n### Additional annotations\nSome xrefs can be imported via ``Dbxref`` attributes in a ``.gff`` file, however, we have deliberately limited the extent to which additional annotations can be imported from ``.gff`` due to the complexity of validating additional feature types and the complexity of mapping from potentially variable attribute names to specific fields in the core database tables.  Several xref types can be richly represented in the Ensembl database if all required attributes are provided and this is easiest to ensure by working directly with program outputs.  This also fits most closely with the [Lepbase](http://lepbase.org) model of ensuring consistency across genomes from diverse sources through annotating features with consistent databases/parameters.   [easy import](https://github.com/lepbase/easy-import) currently supports direct import of ``blastp``, ``interproscan`` and ``repeatmasker`` output files.\n\n### File export\nSequence file export (scaffold, protein and cds) makes it simple to access the bulk data files for analysis or to provide bulk downloads.  In addition to the basic formats, additional files are also exported for use with our comparative analysis pipeline.  Detailed summary statistics can also be exported in ``.json`` format, which are used on [ensembl.lepbase.org](http://ensembl.lepbase.org) to populate the assembly statistics tables and in our [assembly stats](https://github.com/rjchallis/assembly-stats) and [codon usage](https://github.com/rjchallis/codon-usage) visualisations.\n\n### Search indexing\n[Ensembl](http://ensembl.org) supports a very basic (direct ``MySQL``) search out of the box, this is best replaced with a search plugin so we have made ``index_database.pl`` available to generate an autocomplete/search index compatible with the [lepbase search](https://github.com/lepbase/lepbase-search) plugin.\n\nThe final round of summary statistic generation also produces template files for use on the species pages of an [Ensembl](http://ensembl.org) instance, including our highly detailed [assembly stats](https://github.com/rjchallis/assembly_stats) plots as used on [ensembl.lepbase.org](http://ensembl.lepbase.org).\n\n## Compara import\nA powerful feature of [Ensembl](http://ensembl.org) is the integration of single and cross-species analyses in a single genome browser.  At [lepbase.org](http://lepbase.org), we have recently finished implementing our own compara analysis for import using [easy import](https://github.com/lepbase/easy-import) and will add a full description of the analysis pipeline soon.","excerpt":"A brief description of the easy import pipeline","slug":"description","type":"basic","title":"Description"}

Description

A brief description of the easy import pipeline

Easy import approaches [Ensembl](http://ensembl.org) data import from a file-based perspective, beginning with sequences and gff and optionally loading additional data directly from program output files. ## Configuration All parameters for both [easy mirror](https://github.com/lepbase/easy-mirror) and [easy import](https://github.com/lepbase/easy-import) are set and passed to scripts through ``.ini`` files. The configuration file format mirrors the use of ``.ini`` files in [ensembl-webcode](https://github.com/Ensembl/ensembl-webcode), which has the benefit that a user who sets up an [Ensembl](http://ensembl.org) instance using [easy import](https://github.com/lepbase/easy-import) will gain familiarity with the syntax conventions needed to further customise the instance. Use of configuration files rather than command line parameters also improves reproducibility since all parameters must be saved for the pipeline to be run. ## Server setup Setting up an [Ensembl](http://ensembl.org) server to host locally imported data is essentially the same as setting up a mirror site (with just a couple of changes to config files) so the server setup and hosting steps simply reuse [easy mirror](https://github.com/lepbase/easy-mirror). ## Core import The challenge for a file-based approach to data import is dealing with the fragmentation of the ``.gff`` format and the diverse ways that names, ids and descriptions can be captured both in ``.gff`` attributes and across a range of other file types. Most of the effort in designing [easy import](https://github.com/lepbase/easy-import) has been in creating a mechanism to allow gene models and annotations to be extracted from diverse, potentially "broken" files while maintaining a full and clear record of the import procedure to ensure full reproducibility. One drawback to this approach is that separate configuration files are required for conceptually separate parts of the pipeline. This means that database connection data are repeated across multiple ``.ini`` files so care must be taken to use the correct template when making changes to the default settings. ### Database creation Consistency with the latest [Ensembl](http://ensembl.org) database schema is ensured by importing the database schema for each new core database from the [ensembl](https://github.com/Ensembl/ensembl) ``table.sql`` file and using an existing database with the same schema version as a template with the [ensembl-production](https://github.com/Ensembl/ensembl-production) ``populate_production_db_tables.pl`` script. ### Sequence data import Scaffold/contig data will almost always be available as ``.fasta`` format (or possibly ``.fasta`` plus ``.agp``). This is also the starting point for the [Ensembl](http://ensembl.org) import pipeline so sequence import uses scripts directly from [ensembl-pipeline](https://github.com/Ensembl/ensembl-pipeline). ### Summary statistics Basic summary statistics can be calculated at the beginning of the core import. A summary of ``.gff`` attribute counts by feature type is particularly useful in determining which fields may contain IDs, descriptions, etc. and whether any discrepancies in the counts of each attribute suggest that the ``.gff`` needs to be repaired by the [gff parser](https://github.com/rjchallis/gff_parser). ### Parsing and repairing GFF Our flexible [gff parser](https://github.com/rjchallis/gff_parser) lies at the heart of [easy import](https://github.com/lepbase/easy-import). It has been designed to embrace the diversity of real world ``.gff`` files by allowing full customisation of expected relationships and properties with functions to repair, warn or ignore errors during validation. [gff parser](https://github.com/rjchallis/gff_parser) is a perl module that provides a mechanism to assign expectations and validation rules to specific ``.gff`` feature types while having very little hard-coded awareness of any official [gff specification](http://www.sequenceontology.org/gff3.shtml) allowing the flexibility to handle many more edge cases than other parsers. For [easy import](https://github.com/lepbase/easy-import), a subset of the full functionality can be controlled through a meta-syntax in the core import ``.ini`` files and while the [gff parser](https://github.com/rjchallis/gff_parser) can accommodate most forms of ``.gff``, including ``.gtf``, [easy import](https://github.com/lepbase/easy-import) requires a ``.gff3`` compatible format in column nine. This approach initially adds some complexity to the parameter specification, but many patterns can be reused across most ``.gff3`` files and the benefit is that all modifications to the ``.gff3`` can be preserved in the ``.ini`` file. ### Gene model import While the [gff parser](https://github.com/rjchallis/gff_parser) takes care of standardising ``.gff``, additional functionality in [easy import](https://github.com/lepbase/easy-import) allows for retrieval of gene IDs, synonyms and descriptions from ``.gff`` attributes as well as from ``.fasta`` headers and simple text files. For a community resource like [Lepbase](http://lepbase.org), this provides the flexibility to easily incorporate information from diverse sources as supplied by individual labs rather than demanding a standardised format, which could act as a deterrent to full data sharing. For others implementing this pipeline, it offers the flexibility to integrate with existing protocols without the need to reformat data prior to import. ### Import verification In our experience, most problems with data import from ``.gff`` files can be detected through comparison of provider protein sequences with translations exported from an [Ensembl](http://ensembl.org) database. [easy import](https://github.com/lepbase/easy-import) checks that the same IDs are present in each of these sets, and that the sequence lengths are identical. The most common causes of differences are alternate interpretations of phase ([0,1,2] vs. [0,2,1]), and manual editing of the provided sequences file to terminate translations at the first stop codon. ### Additional annotations Some xrefs can be imported via ``Dbxref`` attributes in a ``.gff`` file, however, we have deliberately limited the extent to which additional annotations can be imported from ``.gff`` due to the complexity of validating additional feature types and the complexity of mapping from potentially variable attribute names to specific fields in the core database tables. Several xref types can be richly represented in the Ensembl database if all required attributes are provided and this is easiest to ensure by working directly with program outputs. This also fits most closely with the [Lepbase](http://lepbase.org) model of ensuring consistency across genomes from diverse sources through annotating features with consistent databases/parameters. [easy import](https://github.com/lepbase/easy-import) currently supports direct import of ``blastp``, ``interproscan`` and ``repeatmasker`` output files. ### File export Sequence file export (scaffold, protein and cds) makes it simple to access the bulk data files for analysis or to provide bulk downloads. In addition to the basic formats, additional files are also exported for use with our comparative analysis pipeline. Detailed summary statistics can also be exported in ``.json`` format, which are used on [ensembl.lepbase.org](http://ensembl.lepbase.org) to populate the assembly statistics tables and in our [assembly stats](https://github.com/rjchallis/assembly-stats) and [codon usage](https://github.com/rjchallis/codon-usage) visualisations. ### Search indexing [Ensembl](http://ensembl.org) supports a very basic (direct ``MySQL``) search out of the box, this is best replaced with a search plugin so we have made ``index_database.pl`` available to generate an autocomplete/search index compatible with the [lepbase search](https://github.com/lepbase/lepbase-search) plugin. The final round of summary statistic generation also produces template files for use on the species pages of an [Ensembl](http://ensembl.org) instance, including our highly detailed [assembly stats](https://github.com/rjchallis/assembly_stats) plots as used on [ensembl.lepbase.org](http://ensembl.lepbase.org). ## Compara import A powerful feature of [Ensembl](http://ensembl.org) is the integration of single and cross-species analyses in a single genome browser. At [lepbase.org](http://lepbase.org), we have recently finished implementing our own compara analysis for import using [easy import](https://github.com/lepbase/easy-import) and will add a full description of the analysis pipeline soon.