Scala Data - Tools for reading various scientific data formats
At the moment this library contains very primitive Scala code for reading 1-dimensional numpy arrays from .npy files and NAMD generated dcd trajectory files.
Only a asmall subset of possible dataypes that can be stored in the .npy files is supported. Following table lists correspondance between supported numpy types their Scala types.
|NPY Type||Scala Type|
Due to the nature of library an explicit type conversion/declaration is required as is shown in the fowllowing example
import net.priimak.scala.data.npy._ val v: NPYVector[Int] = NPYVector.valueOf("voltage.npy")
If specified type does not match Scala type as defined in the table above then runtime error will be thrown at the time you access elements of the vector.
Numpy type (NPY Type) can also be retireved by calling
NPYVector extends from the
IndexedSeq and therefore has access to all
methods of Scala collection API.
NUMD DCD Trajectory files
The library is capable of reading 32bit DCD trajectory files generated by the NAMD application. It can be used like so
import net.priimak.scala.data.dcd._ val dcd = DCD.valueOf("dry.dcd") val xAverage = dcd.atom(100).map(_.x).sum/dcd.frames
atom($index) returns sequence of coordinates (class