gtf-nostream
Version:
utilities to read GTF data
86 lines (85 loc) • 2.28 kB
TypeScript
/** @module util */
/**
* Unescape a string/text value used in a GTF attribute.
* Textual attributes should be surrounded by double quotes
* source info:
* https://mblab.wustl.edu/GTF22.html
* https://en.wikipedia.org/wiki/Gene_transfer_format
*
* @param {String} s
* @returns {String}
*/
export declare function unescape(s: any): string | null;
export declare function escape(s: any): string;
/**
* Escape a value for use in a GTF column value.
*
* @param {String} s
* @returns {String}
*/
export declare function escapeColumn(s: any): string;
/**
* Parse the 9th column (attributes) of a GTF feature line.
*
* @param {String} attrString
* @returns {Object}
*/
export declare function parseAttributes(attrString: any): {};
/**
* Parse a GTF feature line.
*
* @param {String} line
* returns the parsed line in an object
*/
export declare function parseFeature(line: any): {};
/**
* Parse a GTF directive/comment line.
*
* @param {String} line
* @returns {Object} the information in the directive
*/
export declare function parseDirective(line: any): {
directive: string;
} | null;
/**
* Format an attributes object into a string suitable for the 9th column of GTF.
*
* @param {Object} attrs
*/
export declare function formatAttributes(attrs: any): string;
/**
* Format a feature object or array of
* feature objects into one or more lines of GTF.
*
* @param {Object|Array[Object]} featureOrFeatures
*/
export declare function formatFeature(featureOrFeatures: any): any;
/**
* Format a directive into a line of GTF.
*
* @param {Object} directive
* @returns {String}
*/
export declare function formatDirective(directive: any): string;
/**
* Format a comment into a GTF comment.
* Yes I know this is just adding a # and a newline.
*
* @param {Object} comment
* @returns {String}
*/
export declare function formatComment(comment: any): string;
/**
* Format a sequence object as FASTA
*
* @param {Object} seq
* @returns {String} formatted single FASTA sequence
*/
export declare function formatSequence(seq: any): string;
/**
* Format a directive, comment, or feature,
* or array of such items, into one or more lines of GTF.
*
* @param {Object|Array} itemOrItems
*/
export declare function formatItem(itemOrItems: any): any;