Skip to content
Martin Asser Hansen edited this page Oct 1, 2015 · 6 revisions

#summary Introduce mutations into sequences in the stream.

Biopiece: mutate_seq

Description

mutate_seq introduces mutations into sequences in the stream based on either an exact number of mutations, or a percentage of the sequence length. The type of sequence is guessed and mutations are introduced at random in such a way that no two mutations can occur at the same position.

Usage

... | mutate_seq [options]

Options

[-?          | --help]               #  Print full usage description.
[-n <uint>   | --number=<uint>]      #  Number of mutations to introduce.
[-p <float>  | --percent=<float>]    #  Percentage of residues to mutate.
[-t <string> | --type=<sting>]       #  Sequence type (dna|rna|protein)  -  Default=guessed!
[-I <file!>  | --stream_in=<file!>]  #  Read input from stream file      -  Default=STDIN
[-O <file>   | --stream_out=<file>]  #  Write output to stream file      -  Default=STDOUT
[-v          | --verbose]            #  Verbose output.

Examples

Consider the following entry in the FASTA file test.fna:

>test
ATGTGCACATTCGACTAGCA

Now, we can read this sequence with read_fasta and pipe it to mutate_seq and specify a number of mutations to be introduced via the -n switch:

read_fasta -i test.fna | mutate_seq -n 3                                          

SEQ: ATGTGCACACTCTACTAGCG
SEQ_NAME: test
SEQ_LEN: 20
---

We can also illustrate this by re-reading the sequence and compare the original with a sequence with 10% (using the -p switch) mutated residues using align_seq:

read_fasta -i test.fna | mutate_seq -p 10 | read_fasta -i test.fna | write_align -x

                     .         .
test        ATGTGAACATTCGAGTAGCA
            ||||| |||||||| |||||
test        ATGTGCACATTCGACTAGCA
                     .         .

See also

read_fasta

write_align

Author

Martin Asser Hansen - Copyright (C) - All rights reserved.

[email protected]

June 2009

License

GNU General Public License version 2

http://www.gnu.org/copyleft/gpl.html

Help

mutate_seq is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally