ExperimentFile(3)
π ExperimentFile(3) β the Experiment File glow-up manual π
okay bestie, welcome to ExperimentFile(3) from the Staden Package β¨ this is the page where all the Experiment File manipulation functions live, and honestly? she's giving main character energy. reading, writing, editing β the whole girlboss toolkit. let's get into it π«Ά
β¨ NAME β¨
the squad, in order:
exp_read_info, exp_fread_info, exp_create_info, exp_destroy_info, exp_create_range, exp_extract_range, exp_get_feature_index, exp_get_int, exp_get_rng, exp_get_str, exp_put_int, exp_put_rng, exp_put_str, exp_print_line, exp_print_seq, exp_print_file, opos2str, str2opos, conf2str, str2conf
and their collective vibe? Manipulations of the Experiment File format. periodt π
π SYNOPSIS π
#include <expFileIO.h>
Exp_info *exp_read_info(
char *file);
Exp_info *exp_fread_info(
FILE *fp);
Exp_info *exp_create_info();
void exp_destroy_info(
Exp_info *e);
char *exp_create_range(
char *str,
int start,
int end);
int exp_extract_range(
char *str,
int *start,
int *end);
int exp_get_feature_index(
char *e);
int exp_get_int(
Exp_info *e,
int id,
int *val);
int exp_get_rng(
Exp_info *e,
int id,
int *from,
int *to);
int exp_get_str(
Exp_info *e,
int id,
char *s,
f_implicit s_l);
int exp_put_int(
Exp_info *e,
int id,
int *val);
int exp_put_rng(
Exp_info *e,
int id,
int *from,
int *to);
int exp_put_str(
Exp_info *e,
int id,
char *s,
f_implicit s_l);
int exp_print_line(
FILE *fp,
Exp_info *e,
int eflt,
int i);
int exp_print_seq(
FILE *fp,
Exp_info *e,
int eflt,
int i);
void exp_print_file(
FILE *fp,
Exp_info *e);
char *opos2str(
int2 *opos,
int len,
char *buf);
int str2opos(
int2 *opos,
char *buf);
char *conf2str(
int1 *conf,
int len,
char *buf);
int str2conf(
int1 *conf,
char *buf);
πΈ DESCRIPTION πΈ
so these functions manipulate Experiment Files β reading them, writing them, editing them, the whole shebang. the principle structure everything revolves around is Exp_info, and here's exactly what she looks like:
#define MAXIMUM_EFLT_LENGTH 4
#define MAXIMUM_EFLTS 48
#define EXP_FILE_LINE_LENGTH 128
typedef Array Exp_entries;
typedef struct {
Array entries[MAXIMUM_EFLTS]; /* array of array of entries */
int Nentries[MAXIMUM_EFLTS]; /* array of number of entries */
FILE *fp;
} Exp_info;
#define NULL_Exp_info ( (Exp_info *) NULL )
β οΈ important bestie: for the purposes of simple and efficient coding, each line on an experiment file must be smaller than the definedEXP_FILE_LINE_LENGTH, which is128characters. no exceptions, she does not bend π
a bunch of these functions take an experiment file line type identifier as an argument β you'll see them written as taking int id in the prototypes. that id should be specified using one of the macros defined in the header file, and they look like EFLT_XX where XX is the line type. for instance, the ID line type identifier should be written as EFLT_ID. iykyk β¨
the C functions available follow. some FORTRAN interfaces are also available, but they're not documented β check the include file for their prototypes if that's your thing π
π¦ the functions, one by one π¦
exp_read_infoandexp_fread_infoβ read an experiment file into an allocatedExp_infostructure. if it goes well you get the structure pointer back; otherwise you get the null pointer. πexp_create_infoβ allocates and initialises a brand new, blank,Exp_infostructure. success = structure pointer returned. otherwise = null pointer returned.exp_destroy_infoβ deallocates anExp_infostructure. it's giving cleanup era π§Ήexp_create_rangeβ creates a string using the experiment file range format of"start..stop". this format is used by theAQ,ON,TGandTCline types. the buffer you pass in should be large enough to hold the string, bestie, don't play with her. the function returns thestrpointer you supplied as an argument. πexp_extract_rangeβ pulls the start and end values out of the string representation of a range;"start..stop". the values get stored in the integer pointers you send as arguments. if it works, returns0. otherwise returns-1. π«Άexp_get_feature_indexβ converts a string representation of an experiment file line type into its integer value. for example,exp_get_feature_index("SQ")returns the integer22, which is the same as theEFLT_SQdefinition. iconic conversion behaviour β¨exp_get_intβ grabs the integer value held in a specific line type. it lands in the integer pointerval. if successful, returns0. otherwise returns1.exp_get_rngβ grabs the range values held in a specific line type. they land in the integer pointersfromandto. if successful, returns0. otherwise returns1.exp_get_strβ grabs the string value held in a specific line type. it lands in the strings, and at mosts_lcharacters are copied. if successful, returns0. otherwise returns1. no overflow, we don't do that here πexp_put_intβ writes the integer pointed to byvalto the specified line type. if successful, returns0. otherwise returns1.exp_put_rngβ writes the range pointed to byfromandtoto the specified line type. if successful, returns0. otherwise returns1.exp_put_strβ writes the stringsof lengths_lto the specified line type. if successful, returns0. otherwise returns1.exp_print_lineβ outputs all entries of the specified type to the specified file pointer. go off, printer queen πexp_print_seqβ okay so bestie, the original page literally just lists her name here and gives no description at all π she's in the synopsis, she's real, and that's genuinely all this page says. i'm not gonna make anything up about her, that's not the vibe.exp_print_fileβ outputs all entries of all line types to the specified file pointer. the full dump, the whole story, no crumbs left πopos2strβ converts an array of original positions held inoposwithlenelements to a string suitable for use in theONline type. thebufshould be large enough to hold the string, which in the worst case will be4 * sequence length. returnsbuf. β¨str2oposβ converts the experiment file original position string held inbufto an array of original positions to be stored inopos.oposmust be large enough to hold the data, hence it should be of the same length as the sequence. returns the number of elements written to theoposarray. πconf2strβ converts an array of confidence values helf inconfRwithlenelements to a string suitable for use in theAVline type. thebufshould be large enough to hold the string, which in the worst case will be4 * sequence length. returnsbuf. (yes, the original page says "helf", and i am nothing if not faithful to the source, so "helf" it stays π)str2confβ convers the experiment file confidence values string held inbufto an array of confidence values to be stored inconf.confmust be large enough to hold the data, hence it should be of the same length as the sequence. returns the number of elements written to theconfarray. π
π₯ SEE ALSO π₯
ExperimentFile(4) β go read her next bestie, she's the companion piece fr fr π
and that's the whole page, babe π«Ά this was ExperimentFile(3), straight out of the Staden Package, manual section 3. thanks for reading, you ate that, no cap β¨π
ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libstaden-read-dev 1.14.15-1 Β· GRL OR MRC
- debian trixie: libstaden-read-dev 1.15.0-1.1+b2 Β· GRL OR MRC
- fedora 43: staden-io_lib-devel 1.14.8-6.fc43 Β· MIT
- fedora 43: staden-io_lib-devel 1.14.8-6.fc43 Β· MIT
- fedora 44: staden-io_lib-devel 1.14.8-7.fc44 Β· MIT
- fedora 44: staden-io_lib-devel 1.14.8-7.fc44 Β· MIT
- nixos 26.05: libstaden-read 1-15-1
- nixpkgs unstable: libstaden-read 1-15-1
- ubuntu jammy: libstaden-read-dev 1.14.14+dfsg-1 Β· GRL OR MRC
- ubuntu noble: libstaden-read-dev 1.15.0-1.1build2 Β· GRL OR MRC
- ubuntu questing: libstaden-read-dev 1.15.0-1.1build2
- ubuntu resolute: libstaden-read-dev 1.15.0-1.1build3 Β· GRL OR MRC
- ubuntu stonking: libstaden-read-dev 1.15.1-1 Β· GRL OR MRC
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms