String containing the name of a file to be written. The file extension is automatically added depending on the type of data the object contains. If you provide the extension, the function checks the consistency between the provided extension and the data format of the object. The file name can be prefixed by a file path. If the path is missing, the file is written to the same folder where the source file is located or to the current folder if the data is in memory.
Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
String specifying the type of file format. Available formats are 'FASTA', 'FASTQ', 'SAM', and 'BAM' for BioMap objects, and'FASTA' and 'FASTQ' for BioRead objects. Default format for BioRead objects is 'FASTA' when the objects do not contain qualities, i.e., the Quality property of the object is empty. Otherwise, the default is 'FASTQ'. Default format for BioMap objects is 'BAM'.
Boolean indicator specifying whether an existing file can be overwritten. Default is false. If true, the method overwrites the file and deletes any respective index file (*.idx,*.bai,*.linearindex) or ordered file (*.ordered.bam, *.ordered.sam) that has become stale.
Write the Contents of BioRead Object to a File
Create a BioRead object from a FASTQ file.
BRObj = BioRead('SRR005164_1_50.fastq');
Extract the first 10 elements from BRObj and store them in a new BioRead object.
subsetBRObj = getSubset(BRObj, [1:10]);
Write the contents of the subset object subsetBRObj to a file named subsetBRObj.fastq in a project folder (or any other folder) on a local C (or any other) drive.