seqenv.fasta package

Submodules

seqenv.fasta.splitable module

class seqenv.fasta.splitable.SplitableFASTA(path, num_parts=None, part_size=None, base_dir=None)[source]

Bases: seqenv.fasta.FASTA

A FASTA file which you can split into chunks. Either you give the number of parts you want to generate, or you can give a target size in bytes for each part.

split()[source]
status

Has the splitting been done already ?

Module contents

class seqenv.fasta.FASTA(path)[source]

Bases: seqenv.common.autopaths.FilePath

A single FASTA file somewhere in the filesystem. You can read from it in several convenient ways. You can write to it in a automatically buffered way. There are several other things you can do with a FASTA file. Look at the class.

add_seq(seq)[source]
add_str(seq, name=None, description='')[source]
buffer_size = 1000
close()[source]
count
create()[source]
extension = 'fasta'
extract_sequences(new_fasta, ids)[source]

Will take all the sequences from the current file who’s id appears in the ids given and place them in the new file path given.

flush()[source]
format = 'fasta'
gzipped
ids

All the sequences ids in a set

open(mode='r')[source]
parse()[source]
rename_sequences(new_fasta, mapping)[source]

Given a new file path, will rename all sequences in the current fasta file using the mapping dictionary also provided.

write(reads)[source]