public class SDRF extends AbstractGraph<SDRFNode>
AbstractGraph.getNode(String, Class) method.  Because nodes are arranged in a graph-like structure, each
 node contains a reference to the ID of the child node.
 
 For example, lets consider we have an SDRF snippet like:
 
 Source Characteristic[organism] ... source_1 homo sapiens ... source_2 mus musculus ...The SDRF representation on the object model is slightly different from the IDF, it stores the graph rather than a direct representation of the spreadsheet. Therefore, you can use the methods getNode() and getAllNodes() on the SDRF to access the top-level nodes on the graph. These methods are generically typed, so for example you could do:
 // this list will contain two nodes
 List sources = investigation.SDRF.getAllNodes(SourceNode.class);
 
 // will print "source_1" then "source_2"
 for (SourceNode source : sources) {
   System.out.println(source.getNodeName());
 }
  
 Alternatively, if you already know the node name, you can retrieve it specifically
 
 
 // this is the first source node, source_1 SourceNode source_1 =
 investigation.SDRF.getNode("source_1", SourceNode.class);
 
 
 You can then extract the attributes of these by accessing the public fields. Some nodes can have a list of
 attributes, in which case the public field returns a list.  For characteristics of this source_1 node, you might want
 some code like this:
 
 
 // this list will contain one element List
 characteristicsList = source_1.characteristics;
  
 
 To get the specific types and values, now all you need to do with this list of elements is the following;
 
 
 for (CharacteristicsAttribute characteristics : characteristicsList) {
   // will return "organism" for the above snippet
   String organism = characteristics.type;
   // will return "homo sapiens" for source_1
   String homo_sapiens = characteristics.getNodeName();
 }
 
 
 Obviously, because the attributes are tied to each node, it isn't possible to get all values from a single attribute
 column - you have to iterate over all the nodes in the graph to "rebuild" the attribute columns.
 
 Note that protocols are the exception to this general pattern.  To obtain Protocols, you should not use the AbstractGraph.getNodes(Class) method, instead look for the public field on the node to which this protocol is associated. So, for
 example...
 
 
   SourceNode src = ...
   List protocols = src.protocols
  | Constructor and Description | 
|---|
SDRF()  | 
| Modifier and Type | Method and Description | 
|---|---|
int | 
getChannelNumber(String label)
Returns the channel number assigned to any given label. 
 | 
String | 
getLabelForChannel(int channelNumber)
Returns the label that tags a given channel. 
 | 
SDRFLayout | 
getLayout()
Get the layout of this SDRF. 
 | 
URL | 
getLocation()
Get the known location of this SDRF, being the location of the file which was parsed to generate it. 
 | 
int | 
getNumberOfChannels()
Returns the number of channels in this experiment. 
 | 
boolean | 
hasBeenHandled(String nodeName,
              Class<? extends SDRFNode> nodeType)
Determine whether a given node has been handled already, and exists in the graph. 
 | 
<T extends SDRFNode>  | 
lookupNode(String nodeName,
          Class<T> nodeType)
Deprecated. 
 
since version 1.1, use  
AbstractGraph.getNode(String, Class) instead | 
SDRFNode | 
lookupNode(String nodeName,
          String nodeType)
Deprecated. 
 
since version 1.1, use  
AbstractGraph.getNode(String, String) instead | 
<T extends SDRFNode>  | 
lookupNodes(Class<T> nodeType)
Deprecated. 
 
since version 1.1, use  
AbstractGraph.getNodes(Class) instead | 
Collection<? extends SDRFNode> | 
lookupNodes(String nodeType)
Deprecated. 
 
since version 1.1, use  
AbstractGraph.getNodes(String) instead | 
Collection<String> | 
lookupProtocols()
Lookup all named protocols references in this SDRF. 
 | 
void | 
removeNodeFromGraph(SDRFNode node)
Deprecated. 
 
since version 1.1, use  
AbstractGraph.removeNode(uk.ac.ebi.arrayexpress2.magetab.datamodel.graph.Node)
             instead | 
void | 
setLocation(URL location)
Get the known location of this SDRF, being the location of the file which was parsed to generate it. 
 | 
void | 
storeNode(SDRFNode node)
Deprecated. 
 
since version 1.1, use  
AbstractGraph.addNode(uk.ac.ebi.arrayexpress2.magetab.datamodel.graph.Node)
             instead | 
addNode, checkForCycles, getAllNodes, getLog, getNode, getNode, getNodeCount, getNodes, getNodes, getRootNodes, removeNode, resolveGraphStructure, updateNodepublic URL getLocation()
public void setLocation(URL location)
location - the full URL of the SDRF file represented by this SDRF objectpublic SDRFLayout getLayout()
@Deprecated public void storeNode(SDRFNode node) throws ParseException
AbstractGraph.addNode(uk.ac.ebi.arrayexpress2.magetab.datamodel.graph.Node)
             insteadnode - the node to storeParseException - if the node being stored would violate the principle that the graph is acyclic@Deprecated public void removeNodeFromGraph(SDRFNode node)
AbstractGraph.removeNode(uk.ac.ebi.arrayexpress2.magetab.datamodel.graph.Node)
             insteadnode - the node to removepublic boolean hasBeenHandled(String nodeName, Class<? extends SDRFNode> nodeType)
lookupNode(String, Class).nodeName - the name of the nodenodeType - the class type of the node@Deprecated public <T extends SDRFNode> T lookupNode(String nodeName, Class<T> nodeType)
AbstractGraph.getNode(String, Class) insteadT - the generic node type to lookupnodeName - the node namenodeType - the class type of the node@Deprecated public SDRFNode lookupNode(String nodeName, String nodeType)
AbstractGraph.getNode(String, String) insteadnodeName - the node namenodeType - the tag that describes the node in the SDRF spec@Deprecated public <T extends SDRFNode> Collection<T> lookupNodes(Class<T> nodeType)
AbstractGraph.getNodes(Class) insteadT - the generic node type to lookupnodeType - the class type of the nodepublic Collection<? extends SDRFNode> lookupNodes(String nodeType)
AbstractGraph.getNodes(String) insteadnodeType - the class type of the nodepublic int getNumberOfChannels()
public int getChannelNumber(String label)
FactorValueAttribute.scannerChannel).
 This method returns the scanner channel assigned to a given label.label - the label that uniquely identifies a channel in an SDRFpublic String getLabelForChannel(int channelNumber)
channelNumber - the channel number assigned to a factor value attributepublic Collection<String> lookupProtocols()
getAllNodes(ProtocolApplicationNode.class);.
 By iterating over the list of returned protocol application nodes, and extracting the protocol from each (use
 protocolApplicationNode.protocol) you can reconstruct this list, or count the number of times a
 particular protocol was applied, and so on.
 
 This method returns a collection that only contains the names of the protocols referenced in the SDRF.  It does
 not contain duplicates, and ti does not imply anything about the usage of these protocols or a collection of the
 "nodes" that utilise these protocols.  You can acquire more detailed information about protocol usages by
 retrieving a list of ProtocolApplicationNodes using the AbstractGraph.getNodes(Class) and providing the
 parameter "ProtocolApplicationNode.classCopyright © 2014. All rights reserved.