Skip to content
Martin Asser Hansen edited this page Oct 2, 2015 · 5 revisions

Biopiece: write_align

Description

write_align writes aligned sequence from the data stream as a pretty alignment with a ruler to indicate alignment position and a consensus sequence.

The ruler uses these symbols:

  • . for every 10 residues
  • : for every 50 residues
  • | for every 100 residues

The consensus is denoted Consensus: 50% and indicates that 50% of the residues in the column are conserved if there is a letter present.

Usage

... | write_align [options]

Options

[-?         | --help]               #  Print full usage description.
[-x         | --no_stream]          #  Do not emit records.
[-o <file>  | --data_out=<file>]    #  Write result to file.
[-w <uint>  | --wrap=<uint>]        #  Wrap sequences to a given width.
[-R         | --no_ruler]           #  Suppress ruler for multiple alignments.
[-C         | --no_consensus]       #  Suppress consensus for multiple alignments.
[-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 three Biopiece records:

SEQ: ACATAGACAGCACGTAC--GACGACGACG
SEQ_NAME: test2
---
SEQ: ACATCGTCAGCACGTACGGGACGACGACG
SEQ_NAME: test3
---
SEQ: ACATCGACAGCACGTAC----CGACGACG
SEQ_NAME: test1
---

To output these as a pretty alignment just pipe the stream to write_align:

... | write_align -x

                          .         .         
test2            ACATAGACAGCACGTAC--GACGACGACG
test3            ACATCGTCAGCACGTACGGGACGACGACG
test1            ACATCGACAGCACGTAC----CGACGACG
Consensus: 50%   ACAT-G-CAGCACGTAC--GACGACGACG

If the first sequence in the alignment is a reference sequence you can use invert_align to emphasize the changes (and disable the consensus with the -C since it is nonsense in this context):

read_fasta -i test.aln | align_seq | invert_align | write_align -Cx

                          .         .         
test2            ACATAGACAGCACGTAC__GACGACGACG
test3            ----C-T----------GG----------
test1            ----C--------------__--------

Now, if the stream only had two aligned records, a pairwise alignment would be output:

read_fasta -i test.aln | align_seq | head_records -n 2 | write_align -x

                     .           .       
test2       ACATAGACAGCACGTAC--GACGACGACG
            |||| | ||||||||||  ||||||||||
test3       ACATCGTCAGCACGTACGGGACGACGACG
                     .         .         

See also

invert_align

head_records

write_fasta

tile_seq

Author

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

mail@maasha.dk

August 2007

License

GNU General Public License version 2

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

Help

write_align is part of the Biopieces framework.

http://www.biopieces.org

Clone this wiki locally