Package: cflib-pomo
Counts file libraryThis python librarycflibprovides scripts to convert between fasta, VCF and
counts files. Counts files are used byPoMo, an
implementation of a polymorphism-aware phylogenetic model. We advice you to use
PoMo implemented inIQ-TREE.For a reference, please see and cite:Schrempf, D., Minh, B. Q., De Maio, N., von Haeseler, A., &
Kosiol, C. (2016). Reversible Polmorphism-Aware Phylotenetic
Models and their Application to Tree Inference. Journal of
Theoretical Biology, in press.Requirementscflibrequirespython(Version 3.x)to be
installed.cflibalso uses the following python libraries that will be
automatically pulled when installingcflib:scipy,numpyandpysam.InstallationInstallcfliband the conversion scripts withpipinstall--usercflib-pomoNote that the name ofcflibon the PyPI repository (which is used bypip) iscflib-pomo, since the namecflibwas taken!If the standard Python version of your operation system is still 2.x (e.g.,
OSX), make sure that you use,pip3.The--userflag is optional and tells Python to installcfliband
the scripts only for this user but not system wide.If you want to uninstallcflib,pipuninstallcflib-pomoThe [conversion scripts](#Conversion scripts) should be directly available if
yourPATHenvironment variable is setup correctly. For my Linux installation,
the Python path~/.local/binhad to be included. This may vary for your
operating system.ExampleSample data can be found inexamples. Assuming that have installedcflibwe will now convertexample.fastato a
counts file namedexample_from_fasta.cf. Thescriptthat we will use is calledFastaToCounts.py.
First, we have a look at the help message:FastaToCounts.py--helpusage: FastaToCounts.py [-h] [-v] [--iupac] fastaFile output

Convert fasta to counts format.

The (aligned) sequences in the fasta file are read in and the data is
written to a counts format file.

Sequence names are stripped at the first dash.  If the stripped
sequence name coincide, individuals are put into the same population.

E.g., homo_sapiens-XXX and homo_sapiens-YYY will be in the same
population homo_sapiens.

Take care with large files, this uses a lot of memory.

The input as well as the output files can additionally be gzipped
(indicated by a .gz file ending).

If heterozygotes are encoded with IUPAC codes (e.g., 'r' for A or G),
homozygotes need to be counted twice so that the level of polymorphism
stays correct.  This can be done with the `--iupac` flag.

positional arguments:
  fastaFile      path to (gzipped) fasta file
  output         name of (gzipped) outputfile in counts format

optional arguments:
  -h, --help     show this help message and exit
  -v, --verbose  turn on verbosity (-v or -vv)
  --iupac        heteorzygotes are encoded with IUPAC codesAs requested, the sequence names inexample.fastaare, e.g.,Sheep-1,Sheep-2, and so on.  The following code converts the fileexample.fastainto the counts fileexample_from_fasta.cf:FastaToCounts.pyexample.fastaexample_from_fasta.cfNote on IUPAC codesIUPAC codes are supported and handled adequately.In particular,Ncan be used to denote any base or that the base is unknown; the letter*can also be used in this case, although it is non-standard;-or.denote a gap or a deletion.Also the other IUPAC codes are supported.Conversion scriptsCountsToFasta.py: Convert a counts file to a
fasta file.FastaToCounts.py: Convert a fasta file to counts
format.FastaToVCF.py: Convert a fasta file to variant call
format.FastaVCFToCounts.py: Convert a fasta
reference with VCF files to counts format.FilterMSA.py: Filter a multiple sequence alignment
file (apply standard filters; cf.libPoMo).GPToCounts.py: Experimental. Convert gene
prediction files with reference to counts format.MSAToCounts.py: Convert multiple sequence
alignments with VCF files to counts format.Each script comes with its own documentation. Please execute, e.g.,FastaToCounts.py--helpAll conversion scripts can be found in thescriptsfolder.DocumentationIf you are interested incflibitself, please refer to thecflib reference manual.