Class ExternalFileGeneLoaderServiceImpl
java.lang.Object
ubic.gemma.core.loader.genome.gene.ExternalFileGeneLoaderServiceImpl
- All Implemented Interfaces:
ExternalFileGeneLoaderService
@Component
public class ExternalFileGeneLoaderServiceImpl
extends Object
implements ExternalFileGeneLoaderService
Class to provide functionality to load genes from a tab delimited file. Typical usage is for non model organisms that
do not have genes in NCBI. Supports loading genes against a non species taxon such as a family e.g Salmonids. File
format is : Optional header which should be appended with a # to indicate not to process this line Then a line
containing 3 fields which should be 'Gene Symbol' 'Gene Name' 'UniProt id' (last is optional) separated by tabs. The
Class reads the file and looping through each line creates a gene (NCBI id is null) and one associated gene product.
The gene is populated with gene symbol, gene name, gene official name (gene symbol) and a description indicating that
this gene has been loaded from a text file. Then gene is associated with a gene product bearing the same name as the
gene symbol and persisted.
- Author:
- ldonnison
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ExternalFileGeneLoaderServiceImpl
public ExternalFileGeneLoaderServiceImpl()
-
-
Method Details
-
load
- Specified by:
load
in interfaceExternalFileGeneLoaderService
- Parameters:
geneInputStream
- gene input streamtaxonName
- taxon name- Returns:
- number of genes loaded
- Throws:
Exception
- Thrown with a file format error or problem in persisting gene to database.
-
load
Description copied from interface:ExternalFileGeneLoaderService
Work flow is: The file is first checked to see if readable, and the taxon checked to see it is in Gemma. If validation passes the file is read line by line. Each line equates to a gene and its gene product, which is created from the file details. The gene is then persisted. If successfully loaded taxon flag isGenesLoaded is set to true to indicate that there are genes loaded for this taxon.- Specified by:
load
in interfaceExternalFileGeneLoaderService
- Parameters:
geneFile
- Full path to file containing genes detailstaxonName
- taxonName to be associated to this gene, does not have to be a species.- Returns:
- number of genes loaded
- Throws:
Exception
- Thrown with a file format error or problem in persisting gene to database.
-