genomepy.files

Utility functions with files

Functions

bgzip_and_name(fname[, bgzip_file])

Bgzip file if requested.

extract_archive(fname[, outfile, concat])

Extract files from an archive.

extract_gzip(fname[, outfile])

Gunzips the file if gzipped.

extract_tarball(fname[, outfile, concat])

Convert tar of multiple FASTAs to one file.

extract_zip(fname[, outfile, concat])

Unzips the file if zipped.

extracted_file(fname)

Context manager to work with (b)gzipped file.

filter_fasta(infa[, outfa, regex, invert_match])

Filter fasta file based on regex.

get_file_info(fname)

Returns the lower case file type of a file, and if it is (g)zipped

glob_ext_files(dirname[, ext])

Return (gzipped) file names in directory containing the given extension.

gzip_and_name(fname[, gzip_file])

Gzip file if requested.

parse_file(fpath[, skip])

basic file parsing

read_readme(readme)

Parse a readme file.

update_readme(readme[, updated_metadata, ...])

Update a readme file with supplied information.

write_readme(readme, metadata[, lines])

Create a new readme file with supplied information.