public class GafDocument extends Object
GeneAnnotation
and Bioentity
objects.GafObjectsBuilder
Constructor and Description |
---|
GafDocument(String id,
String documentPath)
Create a new document instance.
|
GafDocument(String id,
String documentPath,
Map<String,Bioentity> bioentities)
Create a new document instance.
|
Modifier and Type | Method and Description |
---|---|
Bioentity |
addBioentity(Bioentity bioentity)
Add a
Bioentity object to the document. |
void |
addComment(String c)
Add a comment line.
|
void |
addGeneAnnotation(GeneAnnotation ga)
Add a single annotation to the document.
|
Collection<Bioentity> |
getBioentities()
Get all registered
Bioentity objects. |
Bioentity |
getBioentity(String id)
Retrieve the
Bioentity object for the given id. |
List<String> |
getComments()
Get the current set of comments.
|
String |
getDocumentPath()
Retrieve the source path for this document
|
GeneAnnotation |
getGeneAnnotationByLineNumber(int lineNumber)
Retrieve the (first) annotation for the given line number or null.
|
List<GeneAnnotation> |
getGeneAnnotations()
Get all annotations from this document.
|
Collection<GeneAnnotation> |
getGeneAnnotations(String bioentity)
Get all annotations for a given
Bioentity id. |
List<GeneAnnotation> |
getGeneAnnotationsByDirectGoCls(String cls)
Search for all annotations with the given cls String.
|
String |
getId() |
void |
index()
Index all current annotations of this document.
|
void |
setGeneAnnotations(List<GeneAnnotation> annotations)
Replace the current set of annotations with the given list.
|
public GafDocument(String id, String documentPath)
id
- documentPath
- public String getId()
public String getDocumentPath()
public Bioentity getBioentity(String id)
Bioentity
object for the given id.id
- public Collection<Bioentity> getBioentities()
Bioentity
objects.public List<GeneAnnotation> getGeneAnnotations()
public Collection<GeneAnnotation> getGeneAnnotations(String bioentity)
Bioentity
id. If index()
was called, this is a lookup operation, otherwise this is a linear scan
of all annotations.bioentity
- index()
public void index()
getGeneAnnotations(String)
public List<GeneAnnotation> getGeneAnnotationsByDirectGoCls(String cls)
cls
- public GeneAnnotation getGeneAnnotationByLineNumber(int lineNumber)
lineNumber
- public Bioentity addBioentity(Bioentity bioentity)
Bioentity
object to the document. Will return the canonical
instance for the entity in this GAF.bioentity
- public void addGeneAnnotation(GeneAnnotation ga)
ga
- public void setGeneAnnotations(List<GeneAnnotation> annotations)
annotations
- public List<String> getComments()
public void addComment(String c)
c
- Copyright © 2010–2015. All rights reserved.