|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.importer.spotdata.BaseFileInfo
public class BaseFileInfo
Collects information about a BASEfile as it gets parsed
by a BaseFileImporter
. Information in one section is
often needed when parsing other sections or after the parsing
has been completed.
Nested Class Summary | |
---|---|
static class |
BaseFileInfo.ChildBioAssay
Keeps information about a new child bioassay from the 'assays' section or 'spot' sections. |
static class |
BaseFileInfo.SpotSectionInfo
Keeps information about headers and more in a 'spot' section. |
Field Summary | |
---|---|
private boolean |
assaysHaveParentAssaysMapping
|
private Map<Integer,BaseFileInfo.ChildBioAssay> |
childAssays
|
private boolean |
childHasDifferentReporterPositionMapping
|
private Map<Integer,Integer> |
childReporterPositions
|
private Map<String,ExtraValueType> |
extraFloats
|
private FileWrapper |
file
|
private Map<Short,List<Short>> |
parentChildColumnMapping
|
private boolean |
parentHasNullReporter
|
private boolean |
parentHasZeroReporter
|
private Map<Integer,Integer> |
parentReporterPositions
|
private Map<Integer,BaseFileInfo.SpotSectionInfo> |
spotSectionInfo
|
Constructor Summary | |
---|---|
BaseFileInfo(File file)
Deprecated. In 2.16, use BaseFileInfo(FileWrapper) instead |
|
BaseFileInfo(FileWrapper file)
The source file which should be a BASEfile. |
Method Summary | |
---|---|
boolean |
addChildAssay(BaseFileInfo.ChildBioAssay child)
Add information about a child assay. |
Integer |
addChildReporter(Integer position,
Integer reporterId)
Add a child position/reporter mapping from the parsed BASEfile. |
ExtraValueType |
addExtraFloat(DbControl dc,
String extraFloatId)
Add information about an extra float value that appears in the BASEfile. |
void |
addSpotSectionInfo(int spotSection,
BaseFileInfo.SpotSectionInfo info)
Adds information about a 'spot' section. |
void |
checkBioAssay(DbControl dc,
int id,
int line)
Checks that the bioassay with the given id exists in the database. |
boolean |
getAssaysHaveParentAssaysMapping()
A flag that indicates if the BASEfile includes a mapping from child to parent assays. |
String |
getCharacterSet()
Get the character set used by the file, or null if not known. |
BaseFileInfo.ChildBioAssay |
getChildAssay(int id)
Get the child bioassay with the given id (from the BASEfile). |
Collection<BaseFileInfo.ChildBioAssay> |
getChildAssays()
Get information about all child bioassays referenced in the file. |
List<Short> |
getChildColumns(short parentColumn)
Get all child columns that have been mapped to the specified parent column. |
boolean |
getChildHasDifferentReporterPositionMapping()
A flag that indicates if the child data has a different position/reporter mapping than the parent bioassay set. |
Map<Integer,Integer> |
getChildReporterPositions()
Get a map with all added child position/reporter mappings. |
ExtraValueType |
getExtraFloat(String extraFloatId)
Get the extra value type that has the given external id. |
String |
getName()
Get the name of the file. |
boolean |
getParentHasNullReporter()
A flag that indicates if at least one position in the parent bioassay set has a null reporter or not. |
boolean |
getParentHasZeroReporter()
A flag that indicates if at least one position in the parent bioassay set has a reporter with ID=0. |
long |
getSize()
Get the file size. |
BaseFileInfo.SpotSectionInfo |
getSpotSectionInfo(int spotSection)
Get information about a spot section. |
void |
loadParentReporterPositions(DbControl dc,
BioAssaySet parent)
Load position/reporter mapping from the parent bioassay set. |
void |
mapParentChildColumns(short parentColumn,
short childColumn)
Maps a parent data cube column to a child cube column. |
void |
setAssaysHaveParentAssaysMapping(boolean haveMapping)
Set a flag that indicates if the BASEfile includes a mapping from child to parent assays. |
void |
setChildHasDifferentReporterPositionMapping(boolean flag)
Set a flag that indicates if the child data has a different position/reporter mapping than the parent bioassay set. |
void |
setParentHasNullReporter(boolean parentHasNullReporter)
Set a flag indicating that at least one position in the parent bioassay set has a null reporter. |
void |
setParentHasZeroReporter(boolean parentHasZeroReporter)
Set a flag indicating that at least one position in the parent bioassay set has a reporter with ID=0. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final FileWrapper file
private boolean assaysHaveParentAssaysMapping
private Map<Integer,BaseFileInfo.ChildBioAssay> childAssays
private boolean parentHasNullReporter
private boolean parentHasZeroReporter
private Map<Integer,Integer> parentReporterPositions
private Map<Short,List<Short>> parentChildColumnMapping
private Map<Integer,BaseFileInfo.SpotSectionInfo> spotSectionInfo
private Map<String,ExtraValueType> extraFloats
private boolean childHasDifferentReporterPositionMapping
private Map<Integer,Integer> childReporterPositions
Constructor Detail |
---|
@Deprecated public BaseFileInfo(File file)
BaseFileInfo(FileWrapper)
instead
public BaseFileInfo(FileWrapper file)
Method Detail |
---|
public String getName()
public String getCharacterSet()
public long getSize()
public void setAssaysHaveParentAssaysMapping(boolean haveMapping)
public boolean getAssaysHaveParentAssaysMapping()
public boolean addChildAssay(BaseFileInfo.ChildBioAssay child)
child
- Information about the child assay
public Collection<BaseFileInfo.ChildBioAssay> getChildAssays()
public BaseFileInfo.ChildBioAssay getChildAssay(int id)
id
- The ID in the BASEfile
public void checkBioAssay(DbControl dc, int id, int line)
dc
- The DbControl to useid
- The id of the bioassayline
- The current line
ItemNotFoundException
- If the bioassay doesn't exists in the
databasepublic void setParentHasNullReporter(boolean parentHasNullReporter)
parentHasNullReporter
- TRUE if there is a position with a null reporter,
FALSE otherwiseloadParentReporterPositions(DbControl, BioAssaySet)
public boolean getParentHasNullReporter()
getParentHasZeroReporter()
public void setParentHasZeroReporter(boolean parentHasZeroReporter)
public boolean getParentHasZeroReporter()
getParentHasNullReporter()
public void loadParentReporterPositions(DbControl dc, BioAssaySet parent)
getParentHasNullReporter()
/getParentHasZeroReporter()
flags.
dc
- A DbControl to useparent
- The parent bioassay setpublic void setChildHasDifferentReporterPositionMapping(boolean flag)
addChildReporter(Integer, Integer)
public boolean getChildHasDifferentReporterPositionMapping()
public Integer addChildReporter(Integer position, Integer reporterId)
getChildHasDifferentReporterPositionMapping()
flag is set if the mapping has changed.
If a mapping for the given position already exists, a check is made if the mapping is identical or different. If the mapping is different the reporter id of the already existing mapping is returned. It is up to the called to take any appropriate action in this case (usually; throw an exception). If the mapping doesn't exist or if the mapping is identical the 'reporterId' value is returned. Thus, it is easy to check for success by simply comparing:
if (reporterId != addChildReporter(position, reporterId)) { // ... throw exception }
position
- The position valuereporterId
- The ID of the reporter
public Map<Integer,Integer> getChildReporterPositions()
public void mapParentChildColumns(short parentColumn, short childColumn)
parentColumn
- The parent data cube columnchildColumn
- The child data cube columnpublic List<Short> getChildColumns(short parentColumn)
public void addSpotSectionInfo(int spotSection, BaseFileInfo.SpotSectionInfo info)
spotSection
- The ordinal number of the spot section as it
appears in the BASEfile, starting with 1info
- The informationpublic BaseFileInfo.SpotSectionInfo getSpotSectionInfo(int spotSection)
spotSection
- The ordinal number of the spot section as it
appears in the BASEfile, starting with 1public ExtraValueType addExtraFloat(DbControl dc, String extraFloatId)
ExtraValueType
with the given external id exists. If not, a new float-type extra
value type is created.
dc
- A DbControl object to use for database accessextraFloatId
- The external id of an extra value typepublic ExtraValueType getExtraFloat(String extraFloatId)
addExtraFloat(DbControl, String)
before.
extraFloatId
- The external id of an extra value type
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |