Module reference

Reference of ibidas modules

The ibidas module contains all main functions for working with ibidas objects.

ibidas.Rep(data=None, dtype=None, unpack=True, name=None, allow_convert=False)

Packs python data structures into a ibidas.representor.Representor object.

Parameters:
  • data – any python object
  • dtype (str or ibidas.itypes.rtypes.Type) – type of data. See createType() for allowed string formats (default=autodetect).
  • unpack – determines if data object is unpacked. For example, unpacking an array means that subsequent operations are performed on the elements instead of on the array structure
  • name (str, lower case) – Name of the main slice, representing the data (default=’data’).
Examples:

Let the python data that needs to be represented be a simple table (collection of tuples):

>>> data = [('gene1',0.5),('gene2',0.3),('gene100',0.9)]

The, to load using type autodetection, use:

>>> r = Rep(data)
Slices: f0       f1     
Types:  bytes[7] real64 
Dims:   d1:3     .   

Specifying type directly:

>>> r = Rep(data,"[genes]<(name:string, value:real64)")
Slices: name    value
Types:  string  real64
Dims:   genes:* .

Effect of setting unpack to False:

>>> r = Rep(data,"[genes]<(name:string, value:real64)", unpack=False)
Slices: data                                  
Types:  [genes:*]:(name=string, value=real64) 
Dims: 

Specifying root slice name:

>>> r = Rep(data,"[genes]<(name:string, value:real64)", unpack=False, name="gene_table")
Slices: gene_table                                  
Types:  [genes:*]:(name=string, value=real64) 
Dims: 
ibidas.Read(url, **kwargs)
ibidas.Import(url, **kwargs)
ibidas.Connect(url, **kwargs)
class ibidas.CyNetwork(name=None, url=None, exists=False)
AddEdges(rep, left=0, right=1, itype=None, directed=True, addNodes=True)
AddNodes(rep, primary=0)
CreateDiscreteColorMap(elems, colormap=None)
Direct
EdgeAttributeInfo()
EdgeAttributes(edges=None, attributes=None)
EdgeCount
Edges()
GetLayoutNames()
Id
Name
NodeAttributeInfo()
NodeAttributes(nodes=None, attributes=None)
NodeCount
Nodes()
PerformLayout(name=None)
SelEdges()
SelNodes()
SetNodeLabel(name=None)
ibidas.Unpack(filename, subfiles=None, force=False)
ibidas.Addformat(ext, read_fn)
ibidas.Array(*params, **kwds)
ibidas.Tuple(*params, **kwds)
class ibidas.Combine(*sources)
ibidas.HArray(*params, **kwds)
ibidas.Pos(*params, **kwds)
ibidas.Argsort(*params, **kwds)
ibidas.Rank(*params, **kwds)
ibidas.IsMissing(*params, **kwds)
ibidas.CumSum(*params, **kwds)
ibidas.Any(*params, **kwds)
ibidas.All(*params, **kwds)
ibidas.Max(*params, **kwds)
ibidas.Min(*params, **kwds)
ibidas.Argmin(*params, **kwds)
ibidas.Argmax(*params, **kwds)
ibidas.Mean(*params, **kwds)
ibidas.Median(*params, **kwds)
ibidas.Sum(*params, **kwds)
ibidas.Prod(*params, **kwds)
ibidas.Count(*params, **kwds)
class ibidas.Broadcast(sources, *args, **kwds)
ibidas.CreateType(name, dimpos=0, refdims=[], env={})

Creates a type object from string representation.

Parameters:name – str
Format:
Description of type formats
Examples:
>>> createType("unicode")
>>> createType("array(int64)[]")
>>> createType("tuple(int64,unicode)")
ibidas.MatchType(name, matchtype, env=None, dims=None)
ibidas.Corr(*params, **kwds)
ibidas.Serve(portnumber=9889)

Starts xml-rpc server on the supplied port number. Can be used to contact ibidas from other applications.

XML-RPC interface:

  • startSession() (optional): create session namespace, returns sessionid
  • closeSession(sessionid): closes specified session
  • query(query, sessionid=-1): executes query string in session, returns result.
  • execute(query, sessionid=-1): exexutes query string in session
  • set(name, val, sessionid=-1): sets variable in session

The default session id of -1 gives direct contact with the ibidas command line session

Starting the server:

$ ibidas
>>> s = Serve()
>>> z = Rep([1,2,3,4])

Connecting to ibidas (python, but can be any other application supporting xml-rpc):

$ipython
>>> import xmlrpclib
>>> s = xmlrpclib.ServerProxy("http://localhost:9889")
>>> s.query("z + 4")
[5,6,7,8]
ibidas.Load(filename, **kwargs)
ibidas.Save(r, filename)
ibidas.Invert(*params, **kwds)
ibidas.Abs(*params, **kwds)
ibidas.Negative(*params, **kwds)
ibidas.Log(*params, **kwds)
ibidas.Log2(*params, **kwds)
ibidas.Log10(*params, **kwds)
ibidas.Sqrt(*params, **kwds)
ibidas.Upper(*params, **kwds)
ibidas.Lower(*params, **kwds)
ibidas.Add(*params, **kwds)
ibidas.Subtract(*params, **kwds)
ibidas.Multiply(*params, **kwds)
ibidas.Modulo(*params, **kwds)
ibidas.Divide(*params, **kwds)
ibidas.FloorDivide(*params, **kwds)
ibidas.And(*params, **kwds)
ibidas.Or(*params, **kwds)
ibidas.Xor(*params, **kwds)
ibidas.Power(*params, **kwds)
ibidas.Equal(*params, **kwds)
ibidas.NotEqual(*params, **kwds)
ibidas.LessEqual(*params, **kwds)
ibidas.Less(*params, **kwds)
ibidas.GreaterEqual(*params, **kwds)
ibidas.Greater(*params, **kwds)
ibidas.Each(*params, **kwds)
ibidas.Like(*params, **kwds)
ibidas.SplitOnPattern(*params, **kwds)
ibidas.HasPattern(*params, **kwds)

Previous topic

Basic concepts

Next topic

Representor object

This Page