Package ubic.gemma.core.analysis.service
Class ArrayDesignAnnotationServiceImpl
- java.lang.Object
-
- ubic.gemma.core.analysis.service.ArrayDesignAnnotationServiceImpl
-
- All Implemented Interfaces:
ArrayDesignAnnotationService
@Component public class ArrayDesignAnnotationServiceImpl extends Object implements ArrayDesignAnnotationService
- Author:
- Paul
- See Also:
ArrayDesignAnnotationService
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ubic.gemma.core.analysis.service.ArrayDesignAnnotationService
ArrayDesignAnnotationService.OutputType
-
-
Field Summary
-
Fields inherited from interface ubic.gemma.core.analysis.service.ArrayDesignAnnotationService
ANNOT_DATA_DIR, ANNOTATION_FILE_SUFFIX, BIO_PROCESS_FILE_SUFFIX, NO_PARENTS_FILE_SUFFIX, STANDARD_FILE_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description ArrayDesignAnnotationServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
create(ArrayDesign inputAd, Boolean overWrite)
Create (or update) all the annotation files for the given platform.void
deleteExistingFiles(ArrayDesign ad)
int
generateAnnotationFile(Writer writer, Collection<Gene> genes)
Generate an annotation for a list of genes, instead of probes.static File
getFileName(String fileBaseName)
static String
mungeFileName(String fileBaseName)
Remove file separators (e.g., "/") from the file names.static Map<Long,Collection<Gene>>
readAnnotationFile(ArrayDesign arrayDesign)
static Map<Long,String[]>
readAnnotationFileAsString(ArrayDesign arrayDesign)
This tries to read one of the annotation files (noparents, bioprocess or regular) to get the gene information - GO annotations are not part of the result.
-
-
-
Method Detail
-
mungeFileName
public static String mungeFileName(String fileBaseName)
Remove file separators (e.g., "/") from the file names.- Parameters:
fileBaseName
- file base name- Returns:
- munged name
-
readAnnotationFile
public static Map<Long,Collection<Gene>> readAnnotationFile(ArrayDesign arrayDesign)
- Parameters:
arrayDesign
- array design- Returns:
- Map of composite sequence ids and transient (incomplete) genes. The genes only have the symbol filled in.
-
readAnnotationFileAsString
public static Map<Long,String[]> readAnnotationFileAsString(ArrayDesign arrayDesign)
This tries to read one of the annotation files (noparents, bioprocess or regular) to get the gene information - GO annotations are not part of the result.- Parameters:
arrayDesign
- array design- Returns:
- Map of composite sequence ids to an array of delimited strings: [probe name,genes symbol, gene Name, gemma gene id, ncbi id] for a given probe id. format of string is geneSymbol then geneNames same as found in annotation file.
-
create
public void create(ArrayDesign inputAd, Boolean overWrite) throws IOException
Description copied from interface:ArrayDesignAnnotationService
Create (or update) all the annotation files for the given platform. Side effect: any expression experiment data files that use this platform will be deleted. Format details: There is a one-line header. The columns are:- Probe name
- Gene symbol. Genes located at different genome locations are delimited by "|"; multiple genes at the same location are delimited by ",". Both can happen simultaneously.
- Gene name, delimited as for the symbol except '$' is used instead of ','.
- GO terms, delimited by '|'; multiple genes are not handled specially (for compatibility with ermineJ)
- Gemma's gene ids, delimited by '|'
- NCBI gene ids, delimited by '|'
- Specified by:
create
in interfaceArrayDesignAnnotationService
- Parameters:
inputAd
- platform to processoverWrite
- if true existing files will be clobbered- Throws:
IOException
-
deleteExistingFiles
public void deleteExistingFiles(ArrayDesign ad)
- Specified by:
deleteExistingFiles
in interfaceArrayDesignAnnotationService
-
generateAnnotationFile
public int generateAnnotationFile(Writer writer, Collection<Gene> genes)
Description copied from interface:ArrayDesignAnnotationService
Generate an annotation for a list of genes, instead of probes. The second column will contain the NCBI id, if available. Will generate the 'short' version.- Specified by:
generateAnnotationFile
in interfaceArrayDesignAnnotationService
- Parameters:
writer
- the writergenes
- genes- Returns:
- code
-
-