Header menu logo BioFSharp

Fasta Module

Functions to read and write fasta formatted files

Functions and values

Function or value Description

append sequenceItemConverter filePath data

Full Usage: append sequenceItemConverter filePath data

Parameters:
    sequenceItemConverter : 'SequenceItem -> char - Function to convert each item of the sequence of each record to the desired type
    filePath : string - The file to write to
    data : FastaItem<'SequenceItem> seq - A sequence of fasta items to write to the input file path

Writes a sequence of FastaItem to a stream. The passed converter function is used to convert each item in the sequence of each record to the desired type. If the file already exists, it is appended.

sequenceItemConverter : 'SequenceItem -> char

Function to convert each item of the sequence of each record to the desired type

filePath : string

The file to write to

data : FastaItem<'SequenceItem> seq

A sequence of fasta items to write to the input file path

read sequenceConverter filePath

Full Usage: read sequenceConverter filePath

Parameters:
    sequenceConverter : char seq -> 'a - Function to convert the sequence of each record to the desired type
    filePath : string - Path to a fasta formatted file

Returns: FastaItem<'SequenceItem> seq Sequence of FastaItems

Creates a sequence of FastaItems by parsing the input line per line. The passed converter function is used to convert the sequence of each record to the desired type. Lines starting with '#' or ';' are ignored.

sequenceConverter : char seq -> 'a

Function to convert the sequence of each record to the desired type

filePath : string

Path to a fasta formatted file

Returns: FastaItem<'SequenceItem> seq

Sequence of FastaItems

InvalidDataException If the input is not in the correct fasta format

readGzip sequenceConverter filePath

Full Usage: readGzip sequenceConverter filePath

Parameters:
    sequenceConverter : char seq -> 'a - Function to convert the sequence of each record to the desired type
    filePath : string - Path to a gzip compressed fasta formatted file

Returns: FastaItem<'SequenceItem> seq Sequence of FastaItems

Creates a sequence of FastaItems by parsing the input line per line. The passed converter function is used to convert the sequence of each record to the desired type. Lines starting with '#' or ';' are ignored.

sequenceConverter : char seq -> 'a

Function to convert the sequence of each record to the desired type

filePath : string

Path to a gzip compressed fasta formatted file

Returns: FastaItem<'SequenceItem> seq

Sequence of FastaItems

InvalidDataException If the input is not in the correct fasta format

readLines sequenceConverter lines

Full Usage: readLines sequenceConverter lines

Parameters:
    sequenceConverter : char seq -> 'a - Function to convert the sequence of each record to the desired type
    lines : string seq - The input to parse in the form of strings each representing a line of a fasta formatted file

Returns: FastaItem<'SequenceItem> seq Sequence of FastaItems

Creates a sequence of FastaItems by parsing the input line per line. The passed converter function is used to convert the sequence of each record to the desired type. Lines starting with '#' or ';' are ignored.

sequenceConverter : char seq -> 'a

Function to convert the sequence of each record to the desired type

lines : string seq

The input to parse in the form of strings each representing a line of a fasta formatted file

Returns: FastaItem<'SequenceItem> seq

Sequence of FastaItems

InvalidDataException If the input is not in the correct fasta format

write sequenceItemConverter filePath data

Full Usage: write sequenceItemConverter filePath data

Parameters:
    sequenceItemConverter : 'SequenceItem -> char - Function to convert each item of the sequence of each record to the desired type
    filePath : string - The file to write to
    data : FastaItem<'SequenceItem> seq - A sequence of fasta items to write to the input file path

Writes a sequence of FastaItem to a stream. The passed converter function is used to convert each item in the sequence of each record to the desired type. If the file already exists, it is overwritten.

sequenceItemConverter : 'SequenceItem -> char

Function to convert each item of the sequence of each record to the desired type

filePath : string

The file to write to

data : FastaItem<'SequenceItem> seq

A sequence of fasta items to write to the input file path

writeToStream sequenceItemConverter stream data

Full Usage: writeToStream sequenceItemConverter stream data

Parameters:
    sequenceItemConverter : 'SequenceItem -> char - Function to convert each item of the sequence of each record to the desired type
    stream : Stream - The stream to write to
    data : FastaItem<'SequenceItem> seq - A sequence of fasta items to write to the input stream

Writes a sequence of FastaItem to a stream. The passed converter function is used to convert each item in the sequence of each record to the desired type. The passed stream stays open and is not disposed after writing to it. If you want to reuse the stream (e.g. you are not writing to a file stream but a memory stream that gets used afterwards) you have to reset the position with `stream.Seek(0L, SeekOrigin.Begin)`

sequenceItemConverter : 'SequenceItem -> char

Function to convert each item of the sequence of each record to the desired type

stream : Stream

The stream to write to

data : FastaItem<'SequenceItem> seq

A sequence of fasta items to write to the input stream

Type something to start searching.