FingerprintsTextFileIO
use FileIO::FingerprintsTextFileIO;
use FileIO::FingerprintsTextFileIO qw(:all);
FingerprintsTextFileIO class provides the following methods:
new, GetDataColLabels, GetDataLineWords, GetFingerprints, GetFingerprintsString, IsFingerprintsDataValid, IsFingerprintsFileDataValid, IsFingerprintsTextFile, Next, Read, SetBitStringFormat, SetBitsOrder, SetColMode, SetDataColLabels, SetDataLineWords, SetDetailLevel, SetFingerprints, SetFingerprintsString, SetFingerprintsStringMode, SetInDelim, SetOutDelim, SetVectorStringFormat, WriteFingerprints, WriteFingerprintsString
The following methods can also be used as functions:
IsFingerprintsTextFile
FingerprintsTextFileIO class is derived from FileIO class and uses its methods to support generic file related functionality.
The fingerprints CSV/TSV text file format with .csv or .tsv file extensions supports two types of fingerprints string data: fingerprints bit-vectors and fingerprints vector strings. The fingerprints string data is treated as column value in a text file.
Example of text file format containing fingerprints string data:
The current release of MayaChemTools supports the following types of fingerprint bit-vector and vector strings:
Using specified IOParameters names and values hash, new method creates a new object and returns a reference to a newly created FingerprintsTextFileIO object. By default, the following properties are initialized during Read mode:
During Write mode, the following properties get initialize by default:
Examples:
Returns an array of ColLabels from first line in text file. In scalar context, it returns number of column labels.
Returns an array of DataWords in current data line. In scalar context, it returns number of data words.
Returns FingerprintsObject generated for current data line using fingerprints bit-vector or vector string data. The fingerprints object corresponds to any of the supported fingerprints such as PathLengthFingerprints, ExtendedConnectivity, and so on.
Returns FingerprintsString for current data line.
Returns 1 or 0 based on whether FingerprintsObject is valid.
Returns 1 or 0 based on whether text file contains valid fingerprints data.
Returns 1 or 0 based on whether FileName is a fingerprints text file.
Reads next available fingerprints line in text file, processes the data, generates appropriate fingerprints object, and returns FingerprintsTextFileIO. The generated fingerprints object is available using method GetFingerprints.
Sets bit string Format for fingerprints bit-vector string data in a text file and returns FingerprintsTextFileIO. Possible values for BitStringFormat: BinaryString or HexadecimalString.
Sets BitsOrder for fingerprints bit-vector string data in a text file and returns FingerprintsTextFileIO. Possible values for BitsOrder: Ascending or Descending.
Sets ColMode for a text file and returns FingerprintsTextFileIO. Possible values for ColMode: ColNum or ColLabel.
Sets ColLabels for a text file using an array or a reference to an array containing column labels and returns FingerprintsTextFileIO.
Sets DataLineWords for a text file using an array or a reference to an array containing data words and returns FingerprintsTextFileIO.
Sets details Level for generating diagnostics messages during text file processing and returns FingerprintsTextFileIO. Possible values: Positive integers.
Sets FingerprintsObject for current data line and returns FingerprintsTextFileIO.
Sets FingerprintsString for current data line and returns FingerprintsTextFileIO.
Sets FingerprintsStringMode for text file and returns FingerprintsTextFileIO. Possible values: AutoDetect, FingerprintsBitVectorString, or FingerprintsVectorString
Sets InDelim for text file and returns FingerprintsTextFileIO. Possible values: comma, semicolon, tab.
Sets OutDelim for text file and returns FingerprintsTextFileIO. Possible values: comma, semicolon, tab.
Sets VectorStringFormat for text file and returns FingerprintsTextFileIO. Possible values: IDsAndValuesString, IDsAndValuesPairsString, ValuesAndIDsString, ValuesAndIDsPairsString.
Writes fingerprints string generated from FingerprintsObject object and other data including DataColValues to text file and returns FingerprintsTextFileIO.
Writes FingerprintsString and other data including DataColValues to text file and returns FingerprintsTextFileIO.
Caveats:
FingerprintsSDFileIO.pm, FingerprintsFPFileIO.pm
Copyright (C) 2024 Manish Sud. All rights reserved.
This file is part of MayaChemTools.
MayaChemTools is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.