package fastdoop
Type Members
-
final
case class
FAIRecord(id: String, length: Long, start: Long, bpsPerLine: Int, bytesPerLine: Int) extends Product with Serializable
FAI (fasta index) record.
FAI (fasta index) record.
Example entries in a FAI file:
ENA|LR865458|LR865458.1 590561804 75 60 61 ENA|LR865459|LR865459.1 685720839 600404651 60 61 ENA|LR865460|LR865460.1 490910922 1297554246 60 61
- id
Sequence ID
- length
length in bps
- start
start position (byte offset in file)
- bpsPerLine
bps per line
- bytesPerLine
bytes per line
-
class
FAIUtils extends AnyRef
Routines for reading a FASTA index (.fai) file efficiently.
Routines for reading a FASTA index (.fai) file efficiently. They can be generated by e.g. 'seqkit faidx'
This algorithm tries to seek to the best position in the FAI file based on the current offset in the fasta file, assuming the records are on average evenly spread out. This is to help performance in the case where FAI files are huge, and we would otherwise need to parse the whole thing for each split. Additional records may be included before or after, so the start position of each record should still be checked.
-
class
IndexedFastaFormat extends FileInputFormat[Text, PartialSequence]
Hadoop input format for FASTA files with an accompanying .fai index file.
Hadoop input format for FASTA files with an accompanying .fai index file.
- Version
1.0
- See also
-
class
IndexedFastaReader extends RecordReader[Text, PartialSequence]
FASTA file reader that uses a faidx (.fai) file to track sequence locations.
FASTA file reader that uses a faidx (.fai) file to track sequence locations. .fai indexes can be generated by various tools, for example seqkit: https://github.com/shenwei356/seqkit/
This reader can read a mix of full and partial sequences. If the sequence is fully contained in this split, it will be read as a single PartialSequence record. Otherwise, it will be read as multiple records. Partial sequences can be identified and reassembled using their header (corresponding to sequence ID) and seqPosition fields.
Partial sequences are read together with (k-1) bps from the next part to ensure that full k-mers can be processed.
The reader for every split must stream the FAI file. Thus, it is not recommended to use this reader for e.g. short reads, or when the maximum size of a sequence is relatively small. ShortReadsRecordReader and FASTQReadsRecordReader are better suited to such a task. For reading a single long sequence without a FAI index, LongReadsRecordReader can be used instead.
- Version
1.0
- See also
-
class
PartialSequence extends Serializable
This class is used to store fragments of a long input FASTA sequence as an array of bytes.
This class is used to store fragments of a long input FASTA sequence as an array of bytes.
- Version
1.0