Main Content

seqdisp

Format long sequence output for easy viewing

Description

seqdisp(Seq) displays a sequence in rows, with a default row length of 60 and a default column width of 10.

example

seqdisp(Seq,Name=Value) adjusts aspects of the displayed sequence, such as the row length and column width, using name-value arguments.

Examples

collapse all

Read sequence information from the GenBank® database.

mouseHEXA = getgenbank("AK080777");

Display the sequence in rows with 50 letters, and within a row, separate every 10 letters with a space.

seqdisp(mouseHEXA,Row=50,Column=10)
ans = 38x60 char array
    '>gb|AK080777.1| Mus musculus 9.5 days embryo parthenogeno...'
    '   1  GCTGCTGGAA GGGGAGCTGG CCGGTGGGCC ATGGCCGGCT GCAGGCTCTG'
    '  51  GGTTTCGCTG CTGCTGGCGG CGGCGTTGGC TTGCTTGGCC ACGGCACTGT'
    ' 101  GGCCGTGGCC CCAGTACATC CAAACCTACC ACCGGCGCTA CACCCTGTAC'
    ' 151  CCCAACAACT TCCAGTTCCG GTACCATGTC AGTTCGGCCG CGCAGGCGGG'
    ' 201  CTGCGTCGTC CTCGACGAGG CCTTTCGACG CTACCGTAAC CTGCTCTTCG'
    ' 251  GTTCCGGCTC TTGGCCCCGA CCCAGCTTCT CAAATAAACA GCAAACGTTG'
    ' 301  GGGAAGAACA TTCTGGTGGT CTCCGTCGTC ACAGCTGAAT GTAATGAATT'
    ' 351  TCCTAATTTG GAGTCGGTAG AAAATTACAC CCTAACCATT AATGATGACC'
    ' 401  AGTGTTTACT CGCCTCTGAG ACTGTCTGGG GCGCTCTCCG AGGTCTGGAG'
    ' 451  ACTTTCAGTC AGCTTGTTTG GAAATCAGCT GAGGGCACGT TCTTTATCAA'
    ' 501  CAAGACAAAG ATTAAAGACT TTCCTCGATT CCCTCACCGG GGCGTACTGC'
    ' 551  TGGATACATC TCGCCATTAC CTGCCATTGT CTAGCATCCT GGATACACTG'
    ' 601  GATGTCATGG CATACAATAA ATTCAACGTG TTCCACTGGC ACTTGGTGGA'
    ' 651  CGACTCTTCC TTCCCATATG AGAGCTTCAC TTTCCCAGAG CTCACCAGAA'
    ' 701  AGGGGTCCTT CAACCCTGTC ACTCACATCT ACACAGCACA GGATGTGAAG'
    ' 751  GAGGTCATTG AATACGCAAG GCTTCGGGGT ATCCGTGTGC TGGCAGAATT'
    ' 801  TGACACTCCT GGCCACACTT TGTCCTGGGG GCCAGGTGCC CCTGGGTTAT'
    ' 851  TAACACCTTG CTACTCTGGG TCTCATCTCT CTGGCACATT TGGACCGGTG'
    ' 901  AACCCCAGTC TCAACAGCAC CTATGACTTC ATGAGCACAC TCTTCCTGGA'
    ' 951  GATCAGCTCA GTCTTCCCGG ACTTTTATCT CCACCTGGGA GGGGATGAAG'
    '1001  TCGACTTCAC CTGCTGGAAG TCCAACCCCA ACATCCAGGC CTTCATGAAG'
    '1051  AAAAAGGGCT TTACTGACTT CAAGCAGCTG GAGTCCTTCT ACATCCAGAC'
    '1101  GCTGCTGGAC ATCGTCTCTG ATTATGACAA GGGCTATGTG GTGTGGCAGG'
    '1151  AGGTATTTGA TAATAAAGTG AAGGTTCGGC CAGATACAAT CATACAGGTG'
    '1201  TGGCGGGAAG AAATGCCAGT AGAGTACATG TTGGAGATGC AAGATATCAC'
    '1251  CAGGGCTGGC TTCCGGGCCC TGCTGTCTGC TCCCTGGTAC CTGAACCGTG'
    '1301  TAAAGTATGG CCCTGACTGG AAGGACATGT ACAAAGTGGA GCCCCTGGCG'
    '1351  TTTCATGGTA CGCCTGAACA GAAGGCTCTG GTCATTGGAG GGGAGGCCTG'
    '1401  TATGTGGGGA GAGTATGTGG ACAGCACCAA CCTGGTCCCC AGACTCTGGC'
    '1451  CCAGAGCGGG TGCCGTCGCT GAGAGACTGT GGAGCAGTAA CCTGACAACT'
    '1501  AATATAGACT TTGCCTTTAA ACGTTTGTCG CATTTCCGTT GTGAGCTGGT'
    '1551  GAGGAGAGGA ATCCAGGCCC AGCCCATCAG TGTAGGCTGC TGTGAGCAGG'
    '1601  AGTTTGAGCA GACTTGAGCC ACCAGTGCTG AACACCCAGG AGGTTGCTGT'
    '1651  CCTTTGAGTC AGCTGCGCTG AGCACCCAGG AGGGTGCTGG CCTTAAGAGA'
    '1701  GCAGGTCCCG GGGCAGGGCT AATCTTTCAC TGCCTCCCGG CCAGGGGAGA'
    '1751  GCACCCCTTG CCCGTGTGCC CCTGTGACTA CAGAGAAGGA GGCTGGTGCT'
    '1801  GGCACTGGTG TTCAATAAAG ATCTATGTGG CATTTTCTC            '

Create and save a FASTA file with two sequences, and then display it.

hdr = ['Sequence A'; 'Sequence B'];
seq = ['TAGCTGRCCAAGGCCAAGCGAGCTTN';'ATCGACYGGTTCCGGTTCGCTCGAAN']
seq = 2x26 char array
    'TAGCTGRCCAAGGCCAAGCGAGCTTN'
    'ATCGACYGGTTCCGGTTCGCTCGAAN'

fastawrite("local.fa",hdr,seq);
seqdisp("local.fa",ShowNumbers=false)
ans = 5x65 char array
    '>Sequence A                                                      '
    'TAGCTGRCCA AGGCCAAGCG AGCTTN                                     '
    '                                                                 '
    '>Sequence B                                                      '
    'ATCGACYGGT TCCGGTTCGC TCGAAN                                     '

Input Arguments

collapse all

Nucleotide or amino acid sequence, specified as one of the following:

  • Character array or string vector containing a sequence

  • Character vector or string scalar containing the FASTA file name

  • Structure with the field Sequence

The seqdisp function supports multiply aligned sequences.

FASTA files can have the file extension fa, fasta, fas, fsa, or fst.

Data Types: char | string | struct

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: seqdisp(mouseHEXA,Row=50) displays a sequence with rows of length 50.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: seqdisp(mouseHEXA,"Row",50)

Length of each row, specified as a positive integer. The value of Row must be larger than and evenly divisible by the value of Column.

Column width or number of symbols before displaying a space, specified as a positive integer.

Display numbers at the start of each row, specified as a numeric or logical true (1) or false (0). Specify true to show numbers, or false to hide numbers.

Version History

Introduced before R2006a