write_reading(3)
π write_reading(3) β the Staden Package's little "save ur Read" era π
okay bestie, gather round, because this one is literally about writing a Read structure into a trace file, and it's giving "underrated utility function that deserves main character energy" β¨
β¨ SYNOPSIS β¨
#include <Read.h>
int write_reading(
char *filename,
Read *read,
int format);
int fwrite_reading(
FILE *fp,
Read *read,
int format);
like. two functions. one job. iconic behavior tbh π
πΈ DESCRIPTION πΈ
So these functions write a Read structure into a trace file. that's the whole vibe. that's what we're doing here.
The principle format support is the SCF format. no cap, that's the one everybody actually uses. Now β reading? reading is supported for ABI and ALF. but writing? NOT supported. so if you came here hoping to write out an ABI or an ALF file, bestie, i'm so sorry, it's not happening π
Additionally, it is possible to write using the plain (old) staden format files, or as Experiment files. and in both of those cases, only the sequence component of the trace file will be written. just the sequence. that's it. that's all you get. π
When writing as an experiment file, the QL, QR and SQ fields are generated from the Read structure. And here's the tea: if we previously created the Read structure from reading an experiment file, then the original experiment file data is also written. Otherwise, EN, ID, LN and LT lines are also generated. so like, it depends on where your Read came from. iykyk π¦
Now for the two sisters:
write_reading()β writes aReadstructure to the specified filename in the specified format. Formats available areTT_SCF,TT_PLNandTT_EXP. and listen, if you specify formatTT_ANY, it will be treated asTT_SCF. so don't be out here thinkingTT_ANYmeans "any", it means SCF, periodt.fwrite_reading()β writes aReadstructure to the specifiedFILEpointer in the specified format. Apart from writing to aFILEpointer instead of a filename, the function is identical towrite_reading(). same energy, different destination. π
π₯ RETURN VALUES π₯
On successful completion, the write_reading() and fwrite_reading() functions return 0. Otherwise these functions return -1.
so like, 0 = slay, -1 = something went off and you should probably check urself before you wreck urself π
π SEE ALSO π
read_reading(3)fread_reading(3)deallocate_reading(3)scf(4)ExperimentFile(4)
go read those too, they're the rest of the lore β
and that's the whole page, bestie!! this one came straight out of the Staden Package β the write_reading(3) manual, no date on the lil footer but it's still serving. stay hydrated, close your FILE pointers, and go write some trace files π
β¨π«Ά
π¦ 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