Package: smallgenomeutilities
The smallgenomeutilities are a collection of scripts that is useful for dealing and manipulating NGS data of small viral genomes. They are written in Python 3 with a small number of dependencies.The smallgenomeutilities are part of theV-pipe workflow for analysing NGS data of short viral genomes.DependenciesYou can install these python modules either using pip orbioconda:biopythonbcbio-gffnumpypandasprogresspysampysamstatssklearnmatplotlibprogresspyyamlIn addition to the modules, frameshift_deletions_checks currently requiresmafftbeing installed – it is alsoavailable on bioconda.InstallationThe recommended way to install the smallgenomeutilities is using thebioconda package:mambainstallsmallgenomeutilitiesAnother possibility is using pip:# install from the current directorypipinstall--editable.# install from GitHubpipinstallgit+https://github.com/cbg-ethz/smallgenomeutilities.git# install from PypipipinstallsmallgenomeutilitiesDescription of utilitiesaln2basecntextract base counts and coverage information from a single alignment filecompute_mdsCompute multidimensional scaling for visualizing distances among reconstructed haplotypes.convert_qrConvert QuasiRecomb output of a transmitter and recipient set of haplotypes to a combined set of haplotypes, where gaps have been filtered. Optionally translate to peptide sequence.convert_referencePerform a genomic liftover. Transform an alignment in SAM or BAM format from one reference sequence to another. Can replaceMstates by=/X.coverageCalculate average coverage for a target region on a different contig.coverage_statsCalculate average coverage for a target region of an alignment.extract_consensusBuild consensus sequences including either the majority base or the ambiguous bases from an alignment (BAM) file.extract_coverage_intervalsExtract regions with sufficient coverage for running ShoRAH. Half-open intervals are returned, [start:end), and 0-based indexing is used.extract_samExtract subsequences of an alignment, with the option of converting it to peptide sequences. Can filter on the basis of subsequence frequency or gap frequencies in subsequences.extract_seqExtract sequences of alignments into a FASTA file where the sequence id matches a given string.frameshift_deletions_checksProduce a report about frameshifting indels in a consensus sequencesgather_coveragegather multiple per sample coverage information into a single unified filemapperDetermine the genomic offsets on a target contig, given an initial contig and offsets. Can be used to map between reference genomes.min_coveragefind the minimum coverage in a region from an alignmentminority_freqExtract frequencies of minority variants from multiple samples. A region of interest is also supported.pair_sequencesCompare sequences from a multiple sequence alignment from transmitter and recipient samples in order to determine the optimal matching of transmitters to recipients.predict_num_readsPredict number of reads after quality preprocessing.prepare_primersStarting with a primers BED file, generate the other files used by V-pipe (inserts BED file, and TSV and FASTA file of primers sequences)remove_gaps_msaGiven a multiple sequence alignment, remove loci with a gap fraction above a certain threshold.ContributionsDavid Seifert <david.seifert@bsse.ethz.ch>Susana Posada Cespedes        <susana.posada@bsse.ethz.ch>Ivan Blagoev Topolsky <ivan.topolsky@sib.swiss>Lara Fuhrmann <lara.fuhrmann@bsse.ethz.ch>Mateo Carrara <carrara@nexus.ethz.ch>